Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 352446 - [extract constant] 'Extract to constant' refactoring does not replace the string with the constant
Summary: [extract constant] 'Extract to constant' refactoring does not replace the str...
Status: CLOSED DUPLICATE of bug 211529
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-19 07:57 EDT by Ankur Sharma CLA
Modified: 2011-07-19 09:32 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ankur Sharma CLA 2011-07-19 07:57:28 EDT
Snippet

		switch (string) {
		case "one":
			System.out.println("Accept");
			return true;
		case "two":
			System.out.println("Unsure");
			return true;
		default:
			System.out.println("Fail");
			return false;
		}


1. Select the string "two" in second case statement
2. Press Ctrl + 1 and invoke extract to constant

The result is creation of a constant 

private static final String TWO = "two";

however, the string "two" is not replaced by the constant TWO in second case statement.
Comment 1 Deepak Azad CLA 2011-07-19 09:32:20 EDT
Not a new bug.

*** This bug has been marked as a duplicate of bug 211529 ***