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 211913 - Introduce Parameter: Using On Super Constructor Adds Invalid Code To Sub Constructor
Summary: Introduce Parameter: Using On Super Constructor Adds Invalid Code To Sub Cons...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 7.2
Hardware: PC Windows Vista
: P3 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords:
: 211914 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-05-01 21:08 UTC by MackSix
Modified: 2012-05-27 21:29 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Project to use for reproduction. (20.39 KB, application/zip)
2012-05-01 21:08 UTC, MackSix
Details

Note You need to log in before you can comment on or make changes to this bug.
Description MackSix 2012-05-01 21:08:40 UTC
Created attachment 118932 [details]
Project to use for reproduction.

1) Open up attached project.
2) Open up SuperClass.java.
3) Put cursor on value "99.456". Right click>>Refactor>>Introduce Parameter. Choose Refactor.
4) Observer the 3 subclasses have the invalid code "(99.456);" added.

Expected: "super(99.456);" added to subclasses.


Product Version: NetBeans IDE Dev (Build 201205010400)
Java: 1.7.0_04; Java HotSpot(TM) Client VM 23.0-b21
System: Windows Vista version 6.0 running on x86; Cp1252; en_US (nb)
Comment 1 Jiri Prox 2012-05-02 09:42:16 UTC
reproducible
Comment 2 Jan Becicka 2012-05-03 07:12:56 UTC
Looks like generator issue
Comment 3 Jan Becicka 2012-05-03 07:13:25 UTC
*** Bug 211914 has been marked as a duplicate of this bug. ***
Comment 5 Quality Engineering 2012-05-25 05:42:51 UTC
Integrated into 'main-golden', will be available in build *201205250002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/f46f632046d2
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #211913: rewriting inside of an synthetic tree needs to un-synthetize the tree.
Comment 6 MackSix 2012-05-27 21:14:02 UTC
The subclasses are not updated with a call to super to pass in the parameter. Was that the intention?
Comment 7 MackSix 2012-05-27 21:29:35 UTC
Now it is working. I checked "replace all occurrences" and it started working. It works now without checking that that option now. 

I deleted userdir and cachedir and tried again and it still works. 

I don't know why it didn't work the first couple of times I tried it.