This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 270978 - Not recognized variables after use Hints: "create local variable" and "Split into assign.."
Summary: Not recognized variables after use Hints: "create local variable" and "Split ...
Status: NEW
Alias: None
Product: ide
Classification: Unclassified
Component: Code (show other bugs)
Version: 8.2
Hardware: PC Windows 10 x64
: P2 normal (vote)
Assignee: issues@ide
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-27 11:42 UTC by FiruzzZ
Modified: 2017-06-27 11:42 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (182.15 KB, text/plain)
2017-06-27 11:42 UTC, FiruzzZ
Details

Note You need to log in before you can comment on or make changes to this bug.
Description FiruzzZ 2017-06-27 11:42:25 UTC
When I use these 2 hints: "Create Local Var" and "Split into declaration and assignment", any further use of this variable is not recognized by the IDE, I have to make some little and intentional syntax error (to the variable just created) to be recognized.

Example: 
Have one String Class parameter like:

public class Something  {
	private String description; //this will be removed and declared as local wherever is used
	private String detail; //this too
	private void method() {
		...
		//Here is where I will move the locals declarations after after split it
		//Note: local variables are not initialized to null, just declared
		try {
			...
			description = " bla bla"; //here is when Hints are applied here, after removing the private declaration
			detail = ..... //here is when Hints are applied here, after removing the private declaration
			if(description.isEmpty() || detail.isEmpty()) {
				throws new XXXException(...);
			}
			new UserLog(user, description, detail); // IDE error "cannot find symbol"
		} catch (XXXException ex) {
			Log.trace("bla bla {}, {}", description, detail); // IDE error "cannot find symbol"
		}
	}
}


Product Version = NetBeans IDE 8.2 (Build 201609300101)
Operating System = Windows 10 version 10.0 running on amd64
Java; VM; Vendor = 1.8.0_131
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.131-b11

Reproducibility: Happens sometimes, but not always
Comment 1 FiruzzZ 2017-06-27 11:42:32 UTC
Created attachment 164637 [details]
IDE log