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.
[ BUILD # : 201206291011 ] [ JDK VERSION : 1.7.5 ] I will attach a sample project and steps soon.
Created attachment 121707 [details] Sample project 1. Open the attached project and both classes inside it; 2. Put the cursor at Bean class, line 5 and column 22; 3. Call Refactor > Rename and mark all options and change the name to 'name1' and confirm; The result in Caller class should be: public String getName() { return bean.Bean.super.getName(); } public void setName(String name) { bean.Bean.super.setName(name); } During my test, only once, it worked, so I tried again renaming from 'name1' to 'name' again and the problem appeared. In my production project, it is not random, all the time I did it today, the issue showed up.
It looks to be a stopper for me.
Well, I was intriguing by the fact that sometime it took me twice to reproduce the issue, so I tried it with a clean install at a Windows workstation and it really took me twice to reproduce the issue. So, given the steps I told before, it is just necessary to do the step 3 again, changing 'name1' to 'name' I have the following result: public String getName() { return bean.Bean.super.getName(); } public void setName(String name) { bean.Bean.super.setName(name); } I have tested it at: Product Version: NetBeans IDE 7.2 (Build 201206291011) Java: 1.7.0_03; Java HotSpot(TM) 64-Bit Server VM 22.1-b02 System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
(In reply to comment #3) > Well, I was intriguing by the fact that sometime it took me twice to reproduce > the issue, so I tried it with a clean install at a Windows workstation and it > really took me twice to reproduce the issue. > > So, given the steps I told before, it is just necessary to do the step 3 again, > changing 'name1' to 'name' I have the following result: > > public String getName() { > return bean.Bean.super.getName(); > } > > public void setName(String name) { > bean.Bean.super.setName(name); > } > This is showing the incorrect code, right?
I can changed the field name on line 5 all I want to any other name and it works right, but if I change the name from any name to "name" it generates the wrong code in Caller.java. I changed it from "name" to "name1" then "name2" then "name3" and it would work, but I change it back to "name" again, it fails in Caller.java. It is like "name" is some sort of a keyword that causes the bug to happen.
Product Version: NetBeans IDE 7.2 (Build 201206291011) Java: 1.7.0_05; Java HotSpot(TM) Client VM 23.1-b03 System: Windows Vista version 6.0 running on x86; Cp1252; en_US (nb)
Thank you for the report. The problem is in the comparison of supertypes. The super keyword should only be added if there is a naming collision from a usage in a subtype. I do not think this is a stopper as the visibility is low, it has been introduced in September 2011. I will mark it as P2 and patch candidate.
Changeset: 22cb5949f040 Author: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org> Date: 2012-07-04 11:42 Message: Issue #215139 - [Rename] Method and Field rename incorrectly adds Type.super
(In reply to comment #7) > I do not think this is a stopper as the visibility is low, it has been > introduced in September 2011. I will mark it as P2 and patch candidate. I agree we can wait for patch 1. Thanks for the quickly analysis and fix, and everyone for evaluations and better steps to reproduce.
Integrated into 'main-golden', will be available in build *201207060002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/22cb5949f040 User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org> Log: Issue #215139 - [Rename] Method and Field rename incorrectly adds Type.super
v. Build 20120705-0c78cea2f726
http://hg.netbeans.org/releases/rev/1c9fd623d751
Integrated into 'releases', will be available in build *201209010822* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/1c9fd623d751 User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org> Log: Issue #215139 - [Rename] Method and Field rename incorrectly adds Type.super