Daniel Trebbien created NETBEANS-196: ----------------------------------------
Summary: Regression from NB 8.2: Undoing Introduce Field causes incorrect "Local variable hides a field" and "No valid expressions found" error when attempting to introduce another field Key: NETBEANS-196 URL: https://issues.apache.org/jira/browse/NETBEANS-196 Project: NetBeans Issue Type: Bug Reporter: Daniel Trebbien Steps to reproduce: # Start with the following file: {code:java} package hintstest; public class UndoIntroduceTest { public void test() { String str = "test"; } public void test2() { String str2 = "test2"; } } {code} # Place the editor caret within {{str}}. Right click, select *Refactor > Introduce > Field…* Pick the {{String str = "test";}} expression. Select "Ok" on the "Introduce Field" dialog, using the default settings. # Undo. Notice that there is now an incorrect "Local variable hides a field" warning on {{str}}. # Place the editor caret within {{str2}}. Notice that "usages" highlighting does not work; NB is still highlighting usages of {{str}}. Nevertheless, right click, select *Refactor > Introduce > Field…* An "Error" dialog pops open with the message "No valid expressions found". I tested the above steps in NetBeans 8.2 Patch 2 (NetBeans IDE 8.2 (Build 201609300101)) and did not observe these issues, indicating a regression. -- This message was sent by Atlassian JIRA (v6.4.14#64029)