LabelWithMnemonic accountNameLabel = new LabelWithMnemonic(MailResourceLoader.getString( "dialog", "accountwizard", "accountname")); middlePanel.addLabel(accountNameLabel); accountNameTextField = new JTextField(); Method method = null; try { method = accountNameTextField.getClass().getMethod("getText", null); } catch (NoSuchMethodException nsme) {} data.registerDataLookup("Identity.accountName", new DefaultDataLookup(accountNameTextField, method, null));
LabelWithMnemonic nameLabel = new LabelWithMnemonic(MailResourceLoader.getString( "dialog", "accountwizard", "login")); middlePanel.addLabel(nameLabel); loginTextField = new JTextField(); Method method = null; try { method = loginTextField.getClass().getMethod("getText", null); } catch (NoSuchMethodException nsme) { } data.registerDataLookup("IncomingServer.login", new DefaultDataLookup(loginTextField, method, null));
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/accountwizard/IdentityStep.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/accountwizard/IncomingServerStep.java
Method name: JComponent createComponent() Method name: JComponent createComponent()
Number of AST nodes: 7 Number of AST nodes: 7
1
LabelWithMnemonic accountNameLabel = new LabelWithMnemonic(MailResourceLoader.getString(
1
LabelWithMnemonic nameLabel = new LabelWithMnemonic(MailResourceLoader.getString(
2
                    "dialog", "accountwizard", "accountname"));
2
                    "dialog", "accountwizard", "login"));
3
        middlePanel.addLabel(accountNameLabel);
3
        middlePanel.addLabel(nameLabel);
4
        accountNameTextField = new JTextField();
4
        loginTextField = new JTextField();
5
        Method method = null;
5
        Method method = null;
6
        try {
6
        try {
7
            method = accountNameTextField.getClass().getMethod("getText", null);
7
            method = loginTextField.getClass().getMethod("getText", null);
8
        } catch (NoSuchMethodException nsme) {}
8
        } catch (NoSuchMethodException nsme) {
9
        }
9
        data.registerDataLookup("Identity.accountName",
10
        data.registerDataLookup("IncomingServer.login",
10
            new DefaultDataLookup(accountNameTextField, method, null));
11
            new DefaultDataLookup(loginTextField, method, null));
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.1
Clones locationClones are in different classes having the same super class
Number of node comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    22
    LabelWithMnemonic accountNameLabel = new LabelWithMnemonic(MailResourceLoader.getString("dialog", "accountwizard", "accountname"));
    22
    LabelWithMnemonic accountNameLabel = new LabelWithMnemonic(MailResourceLoader.getString("dialog", "accountwizard", "accountname"));
    6
    LabelWithMnemonic nameLabel = new LabelWithMnemonic(MailResourceLoader.getString("dialog", "accountwizard", "login"));
    Differences
    Expression1Expression2Difference
    accountNameLabelnameLabelVARIABLE_NAME_MISMATCH
    "accountname""login"LITERAL_VALUE_MISMATCH
    6
    LabelWithMnemonic nameLabel = new LabelWithMnemonic(MailResourceLoader.getString("dialog", "accountwizard", "login"));
    23
    middlePanel.addLabel(accountNameLabel);
    23
    middlePanel.addLabel(accountNameLabel);
    7
    middlePanel.addLabel(nameLabel);
    Differences
    Expression1Expression2Difference
    accountNameLabelnameLabelVARIABLE_NAME_MISMATCH
    7
    middlePanel.addLabel(nameLabel);
    24
    accountNameTextField = new JTextField();
    24
    accountNameTextField = new JTextField();
    8
    loginTextField = new JTextField();
    Differences
    Expression1Expression2Difference
    accountNameTextFieldloginTextFieldVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression accountNameTextField is a field being modified, and thus it cannot be parameterized
    Expression loginTextField is a field being modified, and thus it cannot be parameterized
    8
    loginTextField = new JTextField();
    25
    Method method = null;
    9
    Method method = null;
    26
    try
    10
    try
    27
    method = accountNameTextField.getClass().getMethod("getText", null);
    27
    method = accountNameTextField.getClass().getMethod("getText", null);
    11
    method = loginTextField.getClass().getMethod("getText", null);
    Differences
    Expression1Expression2Difference
    accountNameTextFieldloginTextFieldVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression accountNameTextField cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression loginTextField cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11
    method = loginTextField.getClass().getMethod("getText", null);
    28
    data.registerDataLookup("Identity.accountName", new DefaultDataLookup(accountNameTextField, method, null));
    28
    data.registerDataLookup("Identity.accountName", new DefaultDataLookup(accountNameTextField, method, null));
    12
    data.registerDataLookup("IncomingServer.login", new DefaultDataLookup(loginTextField, method, null));
    Differences
    Expression1Expression2Difference
    "Identity.accountName""IncomingServer.login"LITERAL_VALUE_MISMATCH
    accountNameTextFieldloginTextFieldVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression accountNameTextField cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression loginTextField cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12
    data.registerDataLookup("IncomingServer.login", new DefaultDataLookup(loginTextField, method, null));
    Precondition Violations (7)
    Row Violation
    1Expression accountNameTextField is a field being modified, and thus it cannot be parameterized
    2Expression loginTextField is a field being modified, and thus it cannot be parameterized
    3Expression accountNameTextField cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression loginTextField cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression accountNameTextField cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression loginTextField cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Clone fragment #1 returns variables accountNameLabel , while Clone fragment #2 returns variables nameLabel, method