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 236374 - [Introduce Parameter] Replace all occurrences should be properly enabled/disabled and have right text
Summary: [Introduce Parameter] Replace all occurrences should be properly enabled/disa...
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P4 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-25 14:15 UTC by ssazonov
Modified: 2016-07-07 07:16 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ssazonov 2013-09-25 14:15:53 UTC
Lets observe behavior of Introduce Constatn "Replace all occurrences" checkbox (which works properly) and than compare it to Introduce Parameter "Replace all occurrences" checkbox (which doesn't work properly).

1. Create two separated classes OneOccurrence and TwoOccurrences:

public class OneOccurrence {
    public void method(){
        System.out.println("text");
    }
}

public class TwoOccurrences {
    public void method(){
        System.out.println("text");
        String s = "text";
    }
}

2) Select "text" in OneOccurrence class and using Alt+Shift+C invoke Introduce Constant dialog - note, that "Replace All Occurrences" checkbox is DISABLED. Press cancel and using Alt+Shift+P invoke Introduce Parameter dialog - "Replace All Occurrences" checkbox in Introduce Parameter dialog is now ENABLED, although there is only one occurrence.

>> "Replace All Occurrences" checkbox should be disabled when only one occurence.

3) Select "text" in TwoOccurrences class and using Alt+Shift+C invoke Introduce Constant dialog - note, that "Replace All Occurrences" checkbox have caption "Replace All Occurrences (2)". Press cancel and using Alt+Shift+P invoke Introduce Parameter dialog - "Replace All Occurrences" checkbox in Introduce Parameter dialog have now caption "Replace All Occurrences".

>> "Replace All Occurrences" should have following text "Replace All Occurrences (occurences_count)" than more then one occurrences.

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)
Comment 1 Martin Balin 2016-07-07 07:16:10 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss