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 109520 - "Add throws clause" does not follow configured source code formatting
Summary: "Add throws clause" does not follow configured source code formatting
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Pavel Flaska
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-12 15:22 UTC by matthies
Modified: 2007-12-15 00:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description matthies 2007-07-12 15:22:47 UTC
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.
Comment 1 Pavel Flaska 2007-07-19 15:15:46 UTC
Reproducible. Incorrectly selected position.
Comment 2 Pavel Flaska 2007-07-20 08:58:41 UTC
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
Comment 3 Pavel Flaska 2007-07-20 09:09:41 UTC
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
Comment 4 matthies 2007-12-15 00:14:31 UTC
Verified in build 200711261600.