Community
Participate
Working Groups
My preferences: Code formatter profile: Java Conventions Editor: Displayed tab width: 8 Editor: Insert spaces for tabs: true Now, consider the following code: package foo; public class Test { private void thrower() throws java.sql.SQLException, java.io.IOException { } } If I select it all and "correct indentation" (Ctrl-I), the three method's lines get shifted 4 spaces each. According to the Java coding conventions, the "throws" line should get shifted 12 spaces instead. By the way, that's what (correctly) happens if a long method header is wrapped within a parameter list.
Tom, please check whether it's the text code or the formatter
Correct indentation is always text. However, it does not currently support continuation indentation for method declarations. This is something we may look at for 3.1.
marking as dup since it is the same issue: continuation. *** This bug has been marked as a duplicate of 65317 ***
This is not fixed with the fix for bug 65317.
Created attachment 181905 [details] Patch (In reply to comment #4) > This is not fixed with the fix for bug 65317. The JavaHeuristicScanner was identifying 'throws' as a keyword but didn't have a specific token symbol defined for it and so was returning a generic symbol. Defined a new Symbol for 'throws' and modified the scanner to return the same. Also added a new test.
The patch looks good and works fine! Two things: - Did you verify that current clients of the findReferencePosition(int, boolean*) method couldn't profit from the new one? - Copyright date is not updated.
(In reply to comment #6) > The patch looks good and works fine! Two things: > - Did you verify that current clients of the findReferencePosition(int, > boolean*) method couldn't profit from the new one? I had looked at the current users of that method and didn't see them needing the new method(so did consider making it private). Did a check again, since throws is not a scope introducer and this is specifically for 'SmartIndentBeforeThrows' scenario, don't see it being used elsewhere currently.
Good. Thanks Rajesh. Committed the patch plus copyright updates to HEAD. Available in builds >= N20101104-2000.
All recently made indent fixes had to be reverted due to several regressions (bug 331028, bug 330556 and bug 331734).
Committed Rajesh's modified patch (patch will be attached soon).
Created attachment 187943 [details] Patch