String selection = dialog.getSelection();
if(selection == null)
return;
int index = list.getSelectedIndex();
if(index == -1)
index = listModel.getSize();
else
index++;
Button selection = dialog.getSelection();
if(selection == null)
return;
int index = list.getSelectedIndex();
if(index == -1)
index = listModel.getSize();
else
index++;
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/options/ContextOptionPane.java
|
|
File path: /jEdit-4.2/src/org/gjt/sp/jedit/options/ToolBarOptionPane.java
|
Method name: void actionPerformed(ActionEvent)
|
|
Method name: void actionPerformed(ActionEvent)
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | String selection = dialog.getSelection();↵ | | 1 | Button selection = dialog.getSelection();↵
|
2 | if(selection == null)↵ | | 2 | if(selection == null)↵
|
3 | return;↵ | | 3 | return;↵
|
|
4 | int index = list.getSelectedIndex();↵ | | 4 | int index = list.getSelectedIndex();↵
|
5 | if(index == -1)↵ | | 5 | if(index == -1)↵
|
6 | index = listModel.getSize();↵ | | 6 | index = listModel.getSize();↵
|
7 | else↵ | | 7 | else↵
|
8 | index++; | | 8 | index++;
|
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.8 |
Clones location | Clones are in different classes |
Number of node comparisons | 25 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.4 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
| | | 4 | Button selection = dialog.getSelection(); |
4 | String selection = dialog.getSelection(); | | | |
5 | if (selection == null) | | 5 | if (selection == null) |
6 | | | 6 | |
7 | int index = list.getSelectedIndex(); | | 7 | int index = list.getSelectedIndex(); |
8 | if (index == -1) | | 8 | if (index == -1) |
9 | index = listModel.getSize(); | | 9 | index = listModel.getSize(); |
| | | | |
10 | | | 10 | |
Precondition Violations (3)
Row |
Violation |
1 | Type java.lang.String of variable selection does not match with type org.gjt.sp.jedit.options.ToolBarOptionPane.Button of variable selection |
2 | Conditional return; |
3 | Conditional return; |