checkBox.setActionCommand("CHECKBOX"); checkBox.addActionListener(this); okButton = new ButtonWithMnemonic(GlobalResourceLoader.getString("", "", "close")); okButton.setActionCommand("CLOSE"); okButton.addActionListener(this); helpButton = new ButtonWithMnemonic(GlobalResourceLoader.getString("", "", "help")); // associate with JavaHelp HelpManager.getInstance().enableHelpOnButton(helpButton, "extending_columba_2"); HelpManager.getInstance().enableHelpKey(getRootPane(), "extending_columba_2"); XmlElement profiles = ProfileManager.getInstance().getProfiles(); model = new DefaultListModel(); model.addElement("Default"); for (int i = 0; i < profiles.count(); i++) { XmlElement p = profiles.getElement(i); String name = p.getAttribute("name"); model.addElement(name); } list = new JList(model);
okButton.setActionCommand("OK"); okButton.addActionListener(this); cancelButton = new ButtonWithMnemonic(GlobalResourceLoader.getString( "", "", "cancel")); cancelButton.setActionCommand("CANCEL"); cancelButton.addActionListener(this); helpButton = new ButtonWithMnemonic(GlobalResourceLoader.getString("", "", "help")); // associate with JavaHelp HelpManager.getInstance().enableHelpOnButton(helpButton, "extending_columba_2"); HelpManager.getInstance().enableHelpKey(getRootPane(), "extending_columba_2"); XmlElement profiles = ProfileManager.getInstance().getProfiles(); model = new DefaultListModel(); model.addElement("Default"); for (int i = 0; i < profiles.count(); i++) { XmlElement p = profiles.getElement(i); String name = p.getAttribute("name"); model.addElement(name); } list = new JList(model);
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/profiles/ProfileManagerDialog.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/profiles/ProfileChooserDialog.java
Method name: void initComponents() Method name: void initComponents()
Number of AST nodes: 16 Number of AST nodes: 16
1
checkBox.setActionCommand("CHECKBOX");
1
okButton.setActionCommand("
2
		checkBox
2
OK");
3
.addActionListener(this);
3
        okButton.addActionListener(this);
4
		ok
4
        
5
Button = new ButtonWithMnemonic(GlobalResourceLoader.getString("",
5
        cancelButton = new ButtonWithMnemonic(GlobalResourceLoader.getString(
6
				"", "close"));
7
		ok
6
            "", "", "cancel"));
8
Button.setActionCommand("CLOSE");
7
        cancelButton.setActionCommand("C
9
		ok
8
ANCEL");
10
Button.addActionListener(this);
9
        cancelButton.addActionListener(this);
11
		
10
        
12
helpButton = new ButtonWithMnemonic(GlobalResourceLoader.getString("",
11
        helpButton = new ButtonWithMnemonic(GlobalResourceLoader.getString("",
13
				"", "help"));
12
            "", "help"));
14
		
13
        
15
// associate with JavaHelp
14
        // associate with JavaHelp
16
		HelpManager.getInstance().enableHelpOnButton(helpButton,
15
        HelpManager.getInstance().enableHelpOnButton(helpButton,
17
				"extending_columba_2");
16
            "extending_columba_2");
18
		HelpManager.getInstance().enableHelpKey(getRootPane(),
17
        HelpManager.getInstance().enableHelpKey(getRootPane(),
19
				"extending_columba_2");
18
            "extending_columba_2");
20
		
19
        
21
XmlElement profiles = ProfileManager.getInstance().getProfiles();
20
        XmlElement profiles = ProfileManager.getInstance().getProfiles();
22
		model = new DefaultListModel();
21
        model = new DefaultListModel();
23
		model.addElement("Default");
22
        model.addElement("Default");
24
		
23
        
25
for (int i = 0; i < profiles.count(); i++) {
24
        for (int i = 0; i < profiles.count(); i++) {
26
			XmlElement p = profiles.getElement(i);
25
            XmlElement p = profiles.getElement(i);
27
			String name = p.getAttribute("name");
26
            String name = p.getAttribute("name");
28
			model.addElement(name);
27
            model.addElement(name);
29
		}
30
		
28
        }
29
        
31
list = new JList(model);
30
        list = new JList(model);
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.3
Clones locationClones are in different classes having the same super class
Number of node comparisons90
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements16
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)8.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    23
    checkBox.setActionCommand("CHECKBOX");
    23
    checkBox.setActionCommand("CHECKBOX");
    15
    cancelButton.setActionCommand("CANCEL");
    Differences
    Expression1Expression2Difference
    "CHECKBOX""CANCEL"LITERAL_VALUE_MISMATCH
    checkBoxcancelButtonVARIABLE_NAME_MISMATCH
    javax.swing.JCheckBoxjavax.swing.JButtonSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression cancelButton cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15
    cancelButton.setActionCommand("CANCEL");
    24
    checkBox.addActionListener(this);
    24
    checkBox.addActionListener(this);
    16
    cancelButton.addActionListener(this);
    Differences
    Expression1Expression2Difference
    checkBoxcancelButtonVARIABLE_NAME_MISMATCH
    javax.swing.JCheckBoxjavax.swing.JButtonSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression cancelButton cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16
    cancelButton.addActionListener(this);
    25
    okButton = new ButtonWithMnemonic(GlobalResourceLoader.getString("", "", "close"));
    25
    okButton = new ButtonWithMnemonic(GlobalResourceLoader.getString("", "", "close"));
    17
    helpButton = new ButtonWithMnemonic(GlobalResourceLoader.getString("", "", "help"));
    Differences
    Expression1Expression2Difference
    okButtonhelpButtonVARIABLE_NAME_MISMATCH
    "close""help"LITERAL_VALUE_MISMATCH
    Preondition Violations
    Expression okButton is a field being modified, and thus it cannot be parameterized
    Expression helpButton is a field being modified, and thus it cannot be parameterized
    17
    helpButton = new ButtonWithMnemonic(GlobalResourceLoader.getString("", "", "help"));
    26
    okButton.setActionCommand("CLOSE");
    26
    okButton.setActionCommand("CLOSE");
    12
    okButton.setActionCommand("OK");
    Differences
    Expression1Expression2Difference
    "CLOSE""OK"LITERAL_VALUE_MISMATCH
    12
    okButton.setActionCommand("OK");
    27
    okButton.addActionListener(this);
    13
    okButton.addActionListener(this);
    28
    helpButton = new ButtonWithMnemonic(GlobalResourceLoader.getString("", "", "help"));
    28
    helpButton = new ButtonWithMnemonic(GlobalResourceLoader.getString("", "", "help"));
    14
    cancelButton = new ButtonWithMnemonic(GlobalResourceLoader.getString("", "", "cancel"));
    Differences
    Expression1Expression2Difference
    helpButtoncancelButtonVARIABLE_NAME_MISMATCH
    "help""cancel"LITERAL_VALUE_MISMATCH
    Preondition Violations
    Expression helpButton is a field being modified, and thus it cannot be parameterized
    Expression cancelButton is a field being modified, and thus it cannot be parameterized
    14
    cancelButton = new ButtonWithMnemonic(GlobalResourceLoader.getString("", "", "cancel"));
    29
    HelpManager.getInstance().enableHelpOnButton(helpButton, "extending_columba_2");
    18
    HelpManager.getInstance().enableHelpOnButton(helpButton, "extending_columba_2");
    30
    HelpManager.getInstance().enableHelpKey(getRootPane(), "extending_columba_2");
    19
    HelpManager.getInstance().enableHelpKey(getRootPane(), "extending_columba_2");
    31
    XmlElement profiles = ProfileManager.getInstance().getProfiles();
    20
    XmlElement profiles = ProfileManager.getInstance().getProfiles();
    32
    model = new DefaultListModel();
    21
    model = new DefaultListModel();
    33
    model.addElement("Default");
    22
    model.addElement("Default");
    34
    for (int i = 0; i < profiles.count(); i++)
    23
    for (int i = 0; i < profiles.count(); i++)
    35
    XmlElement p = profiles.getElement(i);
    24
    XmlElement p = profiles.getElement(i);
    36
    String name = p.getAttribute("name");
    25
    String name = p.getAttribute("name");
    37
    model.addElement(name);
    26
    model.addElement(name);
    38
    list = new JList(model);
    27
    list = new JList(model);
    Precondition Violations (6)
    Row Violation
    1Expression cancelButton cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression cancelButton cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression okButton is a field being modified, and thus it cannot be parameterized
    4Expression helpButton is a field being modified, and thus it cannot be parameterized
    5Expression helpButton is a field being modified, and thus it cannot be parameterized
    6Expression cancelButton is a field being modified, and thus it cannot be parameterized