String item = historyModel.getItem(i);
if(item.startsWith(text))
{
replaceSelection(item.substring(text.length()));
select(text.length(),getDocument().getLength());
index = i;
return;
}
}
getToolkit().beep();
String item = historyModel.getItem(i);
if(item.startsWith(text))
{
replaceSelection(item.substring(text.length()));
select(text.length(),getDocument().getLength());
index = i;
return;
}
}
getToolkit().beep();
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/HistoryTextField.java
|
|
File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/HistoryTextField.java
|
Method name: void doForwardSearch()
|
|
Method name: void doBackwardSearch()
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | String item = historyModel.getItem(i);↵ | | 1 | String item = historyModel.getItem(i);↵
|
2 | if(item.startsWith(text))↵ | | 2 | if(item.startsWith(text))↵
|
3 | {↵ | | 3 | {↵
|
4 | replaceSelection(item.substring(text.length()));↵ | | 4 | replaceSelection(item.substring(text.length()));↵
|
5 | select(text.length(),getDocument().getLength());↵ | | 5 | select(text.length(),getDocument().getLength());↵
|
6 | index = i;↵ | | 6 | index = i;↵
|
7 | return;↵ | | 7 | return;↵
|
8 | }↵ | | 8 | }↵
|
9 | }↵ | | 9 | }↵
|
|
10 | getToolkit().beep(); | | 10 | getToolkit().beep();
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 27 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 2.0 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
10 | String item = historyModel.getItem(i); | | 10 | String item = historyModel.getItem(i); |
11 | if (item.startsWith(text)) | | 11 | if (item.startsWith(text)) |
12 | replaceSelection(item.substring(text.length())); | | 12 | replaceSelection(item.substring(text.length())); |
13 | select(text.length(), getDocument().getLength()); | | 13 | select(text.length(), getDocument().getLength()); |
14 | | | 14 | |
15 | | | 15 | |
Precondition Violations (2)
Row |
Violation |
1 | Conditional return; |
2 | Conditional return; |