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 235299 - [Introduce Parameter] check if name is already used
Summary: [Introduce Parameter] check if name is already used
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-30 09:35 UTC by ssazonov
Modified: 2013-09-17 11:50 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
01 Before refactoring (8.75 KB, image/png)
2013-08-30 09:35 UTC, ssazonov
Details
02 Select text than Alt+Enter (25.23 KB, image/png)
2013-08-30 09:35 UTC, ssazonov
Details
03 Enter new name (40.36 KB, image/png)
2013-08-30 09:36 UTC, ssazonov
Details
04 After refactoring (11.84 KB, image/png)
2013-08-30 09:36 UTC, ssazonov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ssazonov 2013-08-30 09:35:14 UTC
1. Create new java project and add ClassA:

//============================
package javaapplication3;

public class ClassA {
    public String myText = "aaa";
    public void m(){
      myText = "";
      String s = "text";
      System.out.println(s);
    }
}
//============================

2. Select "text" (part of: String s = "text";) and using Alt+Enter invoke Introduce Parameter dialog

3. Type Name: myText and press Refactor

>> new parameter have been introduced, but sentence of code have been changed (see attachment files)
Comment 1 ssazonov 2013-08-30 09:35:36 UTC
Created attachment 139476 [details]
01 Before refactoring
Comment 2 ssazonov 2013-08-30 09:35:50 UTC
Created attachment 139477 [details]
02 Select text than Alt+Enter
Comment 3 ssazonov 2013-08-30 09:36:04 UTC
Created attachment 139478 [details]
03 Enter new name
Comment 4 ssazonov 2013-08-30 09:36:24 UTC
Created attachment 139479 [details]
04 After refactoring
Comment 5 Ralph Ruijs 2013-08-30 15:52:28 UTC
I'm not really sure what you wanted here, but I think it is fixed by http://hg.netbeans.org/jet-main/rev/98d621c00f6f
Comment 6 ssazonov 2013-09-17 11:50:27 UTC
Verified

Product Version: NetBeans IDE 7.4 RC1 (Build 201309152201)
Java: 1.7.0_40; Java HotSpot(TM) Client VM 24.0-b56
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b43
System: Windows 7 version 6.1 running on x86; Cp1252; en_US (nb)