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 249089 - Generate constructor, setters, should have modifier options
Summary: Generate constructor, setters, should have modifier options
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P3 normal with 1 vote (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-03 15:45 UTC by Leperous
Modified: 2014-12-03 15:45 UTC (History)
0 users

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 Leperous 2014-12-03 15:45:37 UTC
The insert code tool should have options on the "Generate Constructor" and "Generate Setters" pages to set the modifiers on the method and the arguments, perhaps in the form of checkboxes/dropdowns at the bottom of the popup.

For example, if I have a class:

class Foo {
  private String bar;
}

The current constructor code generator will generate the following:

class Foo {
  private String bar;
  public Foo(String bar) {
    this.bar = bar;
  }
}

It should be possible to auto-generate the following:

class Foo {
  private String bar;
  Foo(final String bar) {
    this.bar = bar;
  }
}

User's choice should be saved, but overridden by context-aware circumstance, e.g. the modifier should not be selected to be more open than the one on the class.