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);
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are in different classes
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 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);
    14
    item.setEnabled(false);
    11
    item.setEnabled(false);
    Differences
    Expression1Expression2Difference
    com.apple.cocoa.application.NSMenuItemjavax.swing.JMenuItemVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type com.apple.cocoa.application.NSMenuItem of variable item does not match with type javax.swing.JMenuItem of variable item
    • Make classes com.apple.cocoa.application.NSMenuItem and javax.swing.JMenuItem extend a common superclass
    11
    item.setEnabled(false);
                                
    12
    add(item);
    Preondition Violations
    Unmatched statement add(item); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    12
    add(item);
    15
    addItem(item);
                                        
    Precondition Violations (2)
    Row Violation
    1Type com.apple.cocoa.application.NSMenuItem of variable item does not match with type javax.swing.JMenuItem of variable item
    2Unmatched statement add(item); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted