Method method = null; try { method = list.getClass().getMethod("getSelectedValue", null); } catch (NoSuchMethodException nsme) { } data.registerDataLookup("Plugin.ID", new DefaultDataLookup(list, method, null));
Method method = null; try { method = accountNameTextField.getClass().getMethod("getText", null); } catch (NoSuchMethodException nsme) {} data.registerDataLookup("Identity.accountName", new DefaultDataLookup(accountNameTextField, method, null));
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/mailboximport/PluginStep.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/accountwizard/IdentityStep.java
Method name: JComponent createComponent() Method name: JComponent createComponent()
Number of AST nodes: 4 Number of AST nodes: 4
1
Method method = null;
1
Method method = null;
2
		try {
3
			method = list
2
        try {
4
.getClass().getMethod("getSelectedValue", null);
3
            method = accountNameTextField.getClass().getMethod("getText", null);
5
		} catch (NoSuchMethodException nsme) {
4
        } catch (NoSuchMethodException nsme) {
6
		}
7
		
5
}
8
data.registerDataLookup("Plugin.ID",
6
        data.registerDataLookup("Identity.accountName",
9
 new DefaultDataLookup(list,
7
            new DefaultDataLookup(
10
				method, null));
8
accountNameTextField, method, null));
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
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 comparisons8
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    10
    Method method = null;
    25
    Method method = null;
    11
    try
    26
    try
    12
    method = list.getClass().getMethod("getSelectedValue", null);
    12
    method = list.getClass().getMethod("getSelectedValue", null);
    27
    method = accountNameTextField.getClass().getMethod("getText", null);
    Differences
    Expression1Expression2Difference
    "getSelectedValue""getText"LITERAL_VALUE_MISMATCH
    listaccountNameTextFieldVARIABLE_NAME_MISMATCH
    javax.swing.JListjavax.swing.JTextFieldSUBCLASS_TYPE_MISMATCH
    27
    method = accountNameTextField.getClass().getMethod("getText", null);
    13
    data.registerDataLookup("Plugin.ID", new DefaultDataLookup(list, method, null));
    13
    data.registerDataLookup("Plugin.ID", new DefaultDataLookup(list, method, null));
    28
    data.registerDataLookup("Identity.accountName", new DefaultDataLookup(accountNameTextField, method, null));
    Differences
    Expression1Expression2Difference
    "Plugin.ID""Identity.accountName"LITERAL_VALUE_MISMATCH
    listaccountNameTextFieldVARIABLE_NAME_MISMATCH
    javax.swing.JListjavax.swing.JTextFieldSUBCLASS_TYPE_MISMATCH
    28
    data.registerDataLookup("Identity.accountName", new DefaultDataLookup(accountNameTextField, method, null));
    Precondition Violations (0)
    Row Violation