CharsetMenuItem menuItem = new CharsetMenuItem(charset); group.add(menuItem); menuItem.addActionListener(this); if (charset != null) hashtable.put(charset, menuItem); return menuItem;
JRadioButtonMenuItem menu = new JRadioButtonMenuItem(name); group.add(menu); menu.setActionCommand(actionCommand); menu.addActionListener(this); return menu;
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/charset/CharacterEncodingSubMenu.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/globalactions/SwitchPerspectiveSubmenu.java
Method name: CharsetMenuItem createMenuItem(Charset) Method name: JRadioButtonMenuItem createMenu(String, String)
Number of AST nodes: 6 Number of AST nodes: 5
1
CharsetMenuItem menuItem = new CharsetMenuItem(charset);
1
JRadioButtonMenuItem menu = new JRadioButtonMenuItem(name);
2
		group.add(menuItem);
2
		group.add(menu);
3
		menuItem.addActionListener(this);
3
		menu
4
		if (charset != null)
5
			hashtable.put(charset, menuItem
4
.setActionCommand(actionCommand);
6
);
5
		menu.addActionListener(this);
7
		return menuItem;
6
		return menu;
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 having the same super class
Number of node comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    CharsetMenuItem menuItem = new CharsetMenuItem(charset);
    1
    CharsetMenuItem menuItem = new CharsetMenuItem(charset);
    1
    JRadioButtonMenuItem menu = new JRadioButtonMenuItem(name);
    Differences
    Expression1Expression2Difference
    org.columba.mail.gui.charset.CharsetMenuItemjavax.swing.JRadioButtonMenuItemSUBCLASS_TYPE_MISMATCH
    menuItemmenuVARIABLE_NAME_MISMATCH
    org.columba.mail.gui.charset.CharsetMenuItemjavax.swing.JRadioButtonMenuItemSUBCLASS_TYPE_MISMATCH
    org.columba.mail.gui.charset.CharsetMenuItemjavax.swing.JRadioButtonMenuItemSUBCLASS_TYPE_MISMATCH
    charsetnameVARIABLE_NAME_MISMATCH
    java.nio.charset.Charsetjava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression new CharsetMenuItem(charset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.nio.charset.Charset of variable charset does not match with type java.lang.String of variable name
    • Make classes java.nio.charset.Charset and java.lang.String extend a common superclass
    1
    JRadioButtonMenuItem menu = new JRadioButtonMenuItem(name);
    2
    group.add(menuItem);
    2
    group.add(menuItem);
    2
    group.add(menu);
    Differences
    Expression1Expression2Difference
    menuItemmenuVARIABLE_NAME_MISMATCH
    org.columba.mail.gui.charset.CharsetMenuItemjavax.swing.JRadioButtonMenuItemSUBCLASS_TYPE_MISMATCH
    2
    group.add(menu);
                                                                                    
    3
    menu.setActionCommand(actionCommand);
    Preondition Violations
    Unmatched statement menu.setActionCommand(actionCommand); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3
    menu.setActionCommand(actionCommand);
    3
    menuItem.addActionListener(this);
    3
    menuItem.addActionListener(this);
    4
    menu.addActionListener(this);
    Differences
    Expression1Expression2Difference
    menuItemmenuVARIABLE_NAME_MISMATCH
    org.columba.mail.gui.charset.CharsetMenuItemjavax.swing.JRadioButtonMenuItemSUBCLASS_TYPE_MISMATCH
    4
    menu.addActionListener(this);
    6
    return menuItem;
    6
    return menuItem;
    5
    return menu;
    Differences
    Expression1Expression2Difference
    menuItemmenuVARIABLE_NAME_MISMATCH
    org.columba.mail.gui.charset.CharsetMenuItemjavax.swing.JRadioButtonMenuItemSUBCLASS_TYPE_MISMATCH
    5
    return menu;
    Precondition Violations (4)
    Row Violation
    1Expression new CharsetMenuItem(charset) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Type java.nio.charset.Charset of variable charset does not match with type java.lang.String of variable name
    3Unmatched statement menu.setActionCommand(actionCommand); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Clone fragment #1 returns variable menuItem with type org.columba.mail.gui.charset.CharsetMenuItem , while Clone fragment #2 returns variable menu with type javax.swing.JRadioButtonMenuItem