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 225682 - Let generated setters optionally return this
Summary: Let generated setters optionally return this
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.4
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Assignee: Dusan Balek
Depends on:
Reported: 2013-02-04 05:36 UTC by pekarna
Modified: 2015-10-05 13:26 UTC (History)
0 users

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description pekarna 2013-02-04 05:36:38 UTC
Currently, NetBeans generates normal setter, i.e. returns void.
It's quite popular nowadays to have setters returning this to chain them like
     new Foo().setBar("bar").setBaz("baz");

It's possible to change the template, but sometimes (in other projects), void setters are needed.

So, it would be nice if the "Generate [getters and] setters dialog had a checkbox, which would pass a boolean value to the template which could then create one or the other setter style.

Thanks for considering.