| Summary: | [extract method] finds too many duplicate fragments when executed on a name | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Tom Hofmann <eclipse> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | Ben.Aveling |
| Version: | 3.2 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux-GTK | ||
| Whiteboard: | stalebug | ||
I'll add here a comment where it doesn't find as many duplicates as I'd like.
If I have this code
String a = "A";
String b = "B";
doX(); doY(a); doZ(); //line 1
doX(); doY(b); doZ(); //line 2
And I try to extract method on line 1, it detects that line 2 is a duplicate.
But if I have
doX(); doY("a"); doZ(); //line 3
doX(); doY("b"); doZ(); //line 4
It doesn't detect lines 3 and 4 as duplicates either of each other, or of lines 1 or 2.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |
3.2 M5 - have a compilation unit with many local variables of type String - on one local variable use, executed "extract method" - choose to replace duplicate code fragments > actual result: any references to local variables of type String are also replaces with calls to the newly introduced method. < expected: in such a simple, case, we should not find all structurally identical cases, but only references to the same variable. The hard part is to decide where to draw the line - but in this case, the current behavior is clearly unexpected.