Bug 196719 - Renaming method thru refactoring removes arguments, when arguments are annotated
Renaming method thru refactoring removes arguments, when arguments are annotated
Status: VERIFIED FIXED
Product: java
Classification: Unclassified
Component: Source
7.0
All All
: P1 (vote)
: 7.0
Assigned To: Jan Lahoda
issues@java
: REGRESSION
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-15 10:13 UTC by tnleeuw
Modified: 2011-03-24 09:32 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tnleeuw 2011-03-15 10:13:16 UTC
Product Version = NetBeans IDE Dev (Build 201103130400)
Operating System = Windows Vista version 6.0 running on x86
Java; VM; Vendor = 1.6.0_24
Runtime = Java HotSpot(TM) Client VM 19.1-b02

The methods in my SpringFramekwork Controllers are annotated. In a refactoring excersize I'm renaming some of those methods, using the rename-refactoring (put cursor on method name, hit ctrl-r).

Before refactoring the method signature is as follows:

    @RequestMapping(value="/something", method= RequestMethod.POST)
    public String listDataImportDefs(@RequestParam(required=false) Environment environment, Model model) {
        // ... Body omitted
    }

After the renaming, the method signature is:

    @RequestMapping(value="/something", method= RequestMethod.POST)
    public String listDataImportDef(@RequestParam(required=false) {
        // ... Body omitted
    }

Which is clearly incorrect - even syntactically it's incorrect.
Comment 1 Jan Becicka 2011-03-17 11:00:25 UTC
reproducible with any annotation with parameters:
    void a(@SuppressWarnings("a") int b, int c) {
    }

Looks like generator issue
Comment 2 Jan Lahoda 2011-03-18 14:40:51 UTC
Thanks for the report, this should fix the problem in trunk:
http://hg.netbeans.org/jet-main/rev/2c3be4b84202
("when searching for closing ')' of method's parameters list, start at the end position of the last parameter.")

Jara, if you will agree, I would like to integrate to release70 on Monday. Thanks.
Comment 3 Dusan Balek 2011-03-18 16:33:18 UTC
The patch seems fine to me.
Comment 4 Jaromir Uhrik 2011-03-19 08:04:46 UTC
Verified in the latest jet-main build and heven't found any problem. I agree with integration in 7.0.
Comment 5 Quality Engineering 2011-03-19 09:42:58 UTC
Integrated into 'main-golden', will be available in build *201103190400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/2c3be4b84202
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #196719: when searching for closing ')' of method's parameters list, start at the end position of the last parameter.
Comment 6 tnleeuw 2011-03-21 10:04:05 UTC
The defect is fixed for me -- in build 201103190400, I can no longer reproduce this problem.
Comment 7 Jan Lahoda 2011-03-21 10:11:53 UTC
Thanks.

Transplated to release70:
http://hg.netbeans.org/releases/rev/8474830046ac
Comment 8 Jaromir Uhrik 2011-03-24 09:32:47 UTC
Verified in the following 7.0 build:
Product Version: NetBeans IDE 7.0 RC1 (Build 201103240000)
Java: 1.6.0_24; Java HotSpot(TM) Client VM 19.1-b02
System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb)


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo