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.
Steps to reproduce: 1) Configure formatting to add newlines before braces but not before 'throws'. 2) Create a class with this method: void f() { throw new Exception(); } 3) Execute the hint "Add throws clause for java.lang.Exception". Result is: void f() throws Exception { throw new Exception(); } Result of re-formatting source (Alt+Shift+F) is: void f() throws Exception { throw new Exception(); } which should have been generated in the first place.
Reproducible. Incorrectly selected position.
Regression test. Checking in test/unit/src/org/netbeans/api/java/source/gen/MethodThrowsTest.java; /cvs/java/source/test/unit/src/org/netbeans/api/java/source/gen/MethodThrowsTest.java,v <-- MethodThrowsTest.java new revision: 1.9; previous revision: 1.8 done
Checking in org/netbeans/modules/java/source/save/CasualDiff.java; /cvs/java/source/src/org/netbeans/modules/java/source/save/CasualDiff.java,v <-- CasualDiff.java new revision: 1.172; previous revision: 1.171 done
Verified in build 200711261600.