Method method = null; try { method = accountNameTextField.getClass().getMethod("getText", null); } catch (NoSuchMethodException nsme) {} data.registerDataLookup("Identity.accountName", new DefaultDataLookup(accountNameTextField, method, null));
Method method = null; try { method = list.getClass().getMethod("getSelectedValue", null); } catch (NoSuchMethodException nsme) { } data.registerDataLookup("Plugin.ID", new DefaultDataLookup(list, 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/mailboximport/PluginStep.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 = accountNameTextField
2
		try {
4
.getClass().getMethod("getText", null);
3
			method = list.getClass().getMethod("getSelectedValue", null);
5
        } catch (NoSuchMethodException nsme) {}
4
		} catch (NoSuchMethodException nsme) {
6
        
5
		}
7
data.registerDataLookup("Identity.accountName",
6
		data.registerDataLookup("
8
            new DefaultDataLookup(accountNameTextField, 
7
Plugin.ID", new DefaultDataLookup(list,
9
method, null));
8
				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 comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    25
    Method method = null;
    10
    Method method = null;
    26
    try
    11
    try
                                                                                                                                
    12
    method = list.getClass().getMethod("getSelectedValue", null);
    Preondition Violations
    Unmatched statement method=list.getClass().getMethod("getSelectedValue",null); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    12
    method = list.getClass().getMethod("getSelectedValue", null);
    27
    method = accountNameTextField.getClass().getMethod("getText", null);
    27
    method = accountNameTextField.getClass().getMethod("getText", null);
    Preondition Violations
    Unmatched statement method=accountNameTextField.getClass().getMethod("getText",null); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                              
    28
    data.registerDataLookup("Identity.accountName", new DefaultDataLookup(accountNameTextField, method, null));
    28
    data.registerDataLookup("Identity.accountName", new DefaultDataLookup(accountNameTextField, method, null));
    13
    data.registerDataLookup("Plugin.ID", new DefaultDataLookup(list, method, null));
    Differences
    Expression1Expression2Difference
    "Identity.accountName""Plugin.ID"LITERAL_VALUE_MISMATCH
    accountNameTextFieldlistVARIABLE_NAME_MISMATCH
    javax.swing.JTextFieldjavax.swing.JListSUBCLASS_TYPE_MISMATCH
    13
    data.registerDataLookup("Plugin.ID", new DefaultDataLookup(list, method, null));
    Precondition Violations (2)
    Row Violation
    1Unmatched statement method=list.getClass().getMethod("getSelectedValue",null); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement method=accountNameTextField.getClass().getMethod("getText",null); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted