item = new JMenuItem(jEdit.getProperty("MacOSPlugin.menu.recentDir.none"));
item.setEnabled(false);
add(item);
return;
item = new NSMenuItem(jEdit.getProperty("MacOSPlugin.menu.macros.none"),null,"");
item.setEnabled(false);
addItem(item);
return;
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/jars/MacOS/macos/menu/ShowRecentDirMenu.java
|
|
File path: /jEdit-4.2/jars/MacOS/macos/Delegate.java
|
Method name: void construct()
|
|
Method name: void updateMenu()
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | item = new JMenuItem(jEdit.getProperty("MacOSPlugin.menu.recentDir.none"));↵ | | 1 | item = new NSMenuItem(jEdit.getProperty("MacOSPlugin.menu.macros.none"),null,"");↵
|
2 | item.setEnabled(false);↵ | | 2 | item.setEnabled(false);↵
|
3 | add(item);↵ | | 3 | addItem(item);↵
|
4 | return; | | 4 | return;
|
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.0 |
Clones location | Clones are in different classes |
Number of node comparisons | 16 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
6 | item = new JMenuItem(jEdit.getProperty("MacOSPlugin.menu.recentDir.none")); | | | |
| | | 9 | item = new NSMenuItem(jEdit.getProperty("MacOSPlugin.menu.macros.none"), null, ""); |
7 | item.setEnabled(false); | | 10 | item.setEnabled(false); |
8 | add(item); | | | |
| | | 11 | addItem(item); |
9 | return; | | 12 | return; |
Precondition Violations (4)
Row |
Violation |
1 | Type javax.swing.JMenuItem of variable item does not match with type com.apple.cocoa.application.NSMenuItem of variable item |
2 | Unmatched statement add(item); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Conditional return; |
4 | Conditional return; |