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.
Create sample project add dummy method private void foo(JLabel label) { } => import javax.swing.JLabel; is added to file => OK use Change Method Parameter to add one more boolean parameter. Refactor => one more import javax.swing.JLabel; is added When method has N parameters with not built-in types => any manipulation through Change Method Parameter doubles imports
P2 due to regression
Product Version: NetBeans IDE Dev (Build 090508) Java: 1.6.0_11; Java HotSpot(TM) Client VM 11.0-b16 System: SunOS version 5.10 running on x86; UTF-8; en_US (nb)
Reproducible. Regression caused by fixing issue 138303.
msauer: I suggest to remove your patch at least for the Change Parameters refactoring. SourceUtils.addImports does not fit to this case. E.g. it expects that existing imports are sorted. More suitable would be SourceUtils.resolveImport IMO. But your patch also ignores cases like array types, varargs and generics. This will require to add more sophisticated code.
Fixed the import issue. I'll leave the rest of the patch there, since it is better to support at least simple parameters than nothing. We can consider adding some better logic similar to java.editor's fix imports for next release. --- http://hg.netbeans.org/jet-main/rev/6cee45ca664f
Integrated into 'main-golden', will be available in build *200905140201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/6cee45ca664f User: Max Sauer <msauer@netbeans.org> Log: #164764: Very annoying duplication of includes when change method parameters