item = new NSMenuItem(jEdit.getProperty("MacOSPlugin.menu.buffers.none"),null,"");
item.setEnabled(false);
addItem(item);
item = new JMenuItem(jEdit.getProperty("MacOSPlugin.menu.buffers.none"));
item.setEnabled(false);
add(item);
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/jars/MacOS/macos/Delegate.java
|
|
File path: /jEdit-4.2/jars/MacOS/macos/menu/ShowBufferMenu.java
|
Method name: void updateMenu()
|
|
Method name: void construct()
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | item = new NSMenuItem(jEdit.getProperty("MacOSPlugin.menu.buffers.none"),null,"");↵ | | 1 | item = new JMenuItem(jEdit.getProperty("MacOSPlugin.menu.buffers.none"));↵
|
2 | item.setEnabled(false);↵ | | 2 | item.setEnabled(false);↵
|
3 | addItem(item); | | 3 | add(item);
|
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 | 9 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 1 |
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 |
| | | 10 | item = new JMenuItem(jEdit.getProperty("MacOSPlugin.menu.buffers.none")); |
13 | item = new NSMenuItem(jEdit.getProperty("MacOSPlugin.menu.buffers.none"), null, ""); | | | |
14 | item.setEnabled(false); | | 11 | item.setEnabled(false); |
| | | 12 | add(item); |
15 | addItem(item); | | | |
Precondition Violations (2)
Row |
Violation |
1 | Type com.apple.cocoa.application.NSMenuItem of variable item does not match with type javax.swing.JMenuItem 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 |