JMeterProperty prop = createProperty(items[i], testClass); if (prop!=null) { coll.add(prop); }
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/jmeter/save/OldSaveService.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/action/LoadRecentProject.java
Method name: Collection createCollection(Configuration, String) Method name: void updateRecentFileMenuItems(List, String)
Number of AST nodes: 3 Number of AST nodes: 4
1
JMeterProperty prop = createProperty(items[i], testClass);
2
				if (prop
1
for(int i = 0; i < NUMBER_OF_MENU_ITEMS; i++) {
2
            String fileName = (String)newRecentFiles.get(i);
3
!=null) {
3
            if(fileName != null) {
4
				    coll.add(prop);
5
				
4
                setRecentFile(i, fileName);
5
            }
6
}
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 comparisons7
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                        
    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);
    13
    JMeterProperty prop = createProperty(items[i], testClass);
    13
    JMeterProperty prop = createProperty(items[i], testClass);
    Preondition Violations
    Unmatched statement JMeterProperty prop=createProperty(items[i],testClass); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                          
    14
    if (prop != null)
    14
    if (prop != null)
    13
    if (fileName != null)
    Differences
    Expression1Expression2Difference
    propfileNameVARIABLE_NAME_MISMATCH
    org.apache.jmeter.testelement.property.JMeterPropertyjava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.jmeter.testelement.property.JMeterProperty of variable prop does not match with type java.lang.String of variable fileName
    • Make classes org.apache.jmeter.testelement.property.JMeterProperty and java.lang.String extend a common superclass
    13
    if (fileName != null)
                                                                
    14
    setRecentFile(i, fileName);
    15
    coll.add(prop);
                                          
    Precondition Violations (3)
    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
    2Unmatched statement JMeterProperty prop=createProperty(items[i],testClass); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Type org.apache.jmeter.testelement.property.JMeterProperty of variable prop does not match with type java.lang.String of variable fileName