Button selection = dialog.getSelection();
if(selection == null)
return;
int index = list.getSelectedIndex();
Button selection = dialog.getSelection();
if(selection == null)
return;
int index = list.getSelectedIndex();
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/options/ToolBarOptionPane.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: 4
|
|
Number of AST nodes: 4
|
|
1 | Button 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();
|
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.2 |
Clones location | Clones are in the same method |
Number of node comparisons | 9 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 0.6 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
4 | Button selection = dialog.getSelection(); | | 38 | Button selection = dialog.getSelection(); |
5 | if (selection == null) | | 39 | if (selection == null) |
6 | | | 40 | |
7 | int index = list.getSelectedIndex(); | | 41 | int index = list.getSelectedIndex(); |
Precondition Violations (3)
Row |
Violation |
1 | Conditional return; |
2 | Conditional return; |
3 | Clone fragment #1 returns variables index, selection , while Clone fragment #2 returns variables selection, index |