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 - Improve 'Assign return value for new variable' for factory methods
Summary: Improve 'Assign return value for new variable' for factory methods
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-30 14:58 UTC by ceklock
Modified: 2014-05-14 12:12 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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