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

Summary: [Introduce Parameter] check if name is already used
Product: java Reporter: ssazonov
Component: RefactoringAssignee: Ralph Ruijs <ralphbenjamin>
Status: VERIFIED FIXED    
Severity: normal    
Priority: P3    
Version: 7.4   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:
Attachments: 01 Before refactoring
02 Select text than Alt+Enter
03 Enter new name
04 After refactoring

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)