Functor setMethod = (Functor) writeFunctors.get(col); if (setMethod != null) { setMethod.invoke(value, new Object[] { cellValue }); super.fireTableDataChanged(); }
for(int i = 0; i < NUMBER_OF_MENU_ITEMS; i++) { String fileName = (String)newRecentFiles.get(i); if(fileName != null) { setRecentFile(i, fileName); } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/gui/ObjectTableModel.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/action/LoadRecentProject.java
Method name: void setValueAt(Object, int, int) Method name: void updateRecentFileMenuItems(List, String)
Number of AST nodes: 4 Number of AST nodes: 4
1
Functor setMethod = (Functor) writeFunctor
1
for(int i = 0; i < NUMBER_OF_MENU_ITEMS; i++) {
2
s.get(col);
2
            String fileName = (String)newRecentFiles.get(i);
3
				if (setMethod != null) {
4
					setMethod.invoke(value, new Object[] { cellValue });
5
					super.fireTableDataChanged();
6
				
3
            if(fileName != null) {
4
                setRecentFile(i, fileName);
5
            }
7
}
6
        }
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
Number of node comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)24.8
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    4
    Functor setMethod = (Functor)writeFunctors.get(col);
                                                                                                              
                                                                                                        
    12
    String fileName = (String)newRecentFiles.get(i);
    Preondition Violations
    Unmatched statement String fileName=(String)newRecentFiles.get(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    12
    String fileName = (String)newRecentFiles.get(i);
    5
    if (setMethod != null)
    5
    if (setMethod != null)
    13
    if (fileName != null)
    Differences
    Expression1Expression2Difference
    setMethodfileNameVARIABLE_NAME_MISMATCH
    org.apache.jorphan.reflect.Functorjava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.jorphan.reflect.Functor of variable setMethod does not match with type java.lang.String of variable fileName
    • Make classes org.apache.jorphan.reflect.Functor and java.lang.String extend a common superclass
    13
    if (fileName != null)
    6
    setMethod.invoke(value, new Object[] {cellValue});
                                                                                                          
    7
    super.fireTableDataChanged();
    7
    super.fireTableDataChanged();
    14
    setRecentFile(i, fileName);
    Differences
    Expression1Expression2Difference
    super.fireTableDataChanged()setRecentFile(i,fileName)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression super.fireTableDataChanged() is a void method call, and thus it cannot be parameterized
    Expression setRecentFile(i,fileName) is a void method call, and thus it cannot be parameterized
    14
    setRecentFile(i, fileName);
    Precondition Violations (4)
    Row Violation
    1Unmatched statement String fileName=(String)newRecentFiles.get(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Type org.apache.jorphan.reflect.Functor of variable setMethod does not match with type java.lang.String of variable fileName
    3Expression super.fireTableDataChanged() is a void method call, and thus it cannot be parameterized
    4Expression setRecentFile(i,fileName) is a void method call, and thus it cannot be parameterized