if(action != null)
{
setEnabled(true);
addActionListener(new EditAction.Wrapper(context,action));
addMouseListener(new MouseHandler());
}
else
setEnabled(false);
if(action != null)
{
setEnabled(true);
addActionListener(new EditAction.Wrapper(context,action));
addMouseListener(new MouseHandler());
}
else
setEnabled(false);
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/menu/EnhancedCheckBoxMenuItem.java
|
|
File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/EnhancedButton.java
|
Method name: void EnhancedCheckBoxMenuItem(String, String, ActionContext)
|
|
Method name: void EnhancedButton(Icon, String, String, ActionContext)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if(action != null)↵ | | 1 | if(action != null)↵
|
2 | {↵ | | 2 | {↵
|
3 | setEnabled(true);↵ | | 3 | setEnabled(true);↵
|
4 | addActionListener(new EditAction.Wrapper(context,action));↵ | | 4 | addActionListener(new EditAction.Wrapper(context,action));↵
|
|
5 | addMouseListener(new MouseHandler());↵ | | 5 | addMouseListener(new MouseHandler());↵
|
6 | }↵ | | 6 | }↵
|
7 | else↵ | | 7 | else↵
|
8 | setEnabled(false); | | 8 | setEnabled(false);
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 25 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
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.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
8 | if (action != null) | | 3 | if (action != null) |
9 | | | 4 | |
10 | addActionListener(new EditAction.Wrapper(context, action)); | | 5 | addActionListener(new EditAction.Wrapper(context, action)); |
11 | addMouseListener(new MouseHandler()); | | 6 | addMouseListener(new MouseHandler()); |
| | | | |
12 | | | 7 | |
Precondition Violations (0)
Row |
Violation |