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 243383

Summary: Improve 'Assign return value for new variable' for factory methods
Product: java Reporter: ceklock
Component: HintsAssignee: Svata Dedic <sdedic>
Status: NEW ---    
Severity: normal CC: markiewb
Priority: P3    
Version: 8.0   
Hardware: PC   
OS: Windows 7   
Issue Type: ENHANCEMENT Exception Reporter:

Description ceklock 2014-03-30 14:58:50 UTC
For factory methods like 'MyClass.createObject()', the 'Assign return value for new variable' generates a variable with the same name of the method.

It would be nice if methods starting with 'create' or 'new', like createObject or newInstance had the same behaviour of getters, where the prefix is ignored, and the suffix is the name of the variable.


method name: createObject() -> variable name: object

method name: newInstance() -> variable name: instance