FILTER.setPackges(JOrphanUtils.split(filterpkg.getText(),",")); //$NON-NLS-1$ classnameCombo.removeAllItems(); // change the classname drop down Object[] clist = FILTER.filterArray(CLASSLIST); for (int idx=0; idx < clist.length; idx++) { classnameCombo.addItem(clist[idx]); }
for (int i = 0; i < rh.length; i++) { String key = rh[i].getName(); headerBuf.append(key); headerBuf.append(": "); // $NON-NLS-1$ headerBuf.append(rh[i].getValue()); headerBuf.append("\n"); // $NON-NLS-1$ }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/junit/org/apache/jmeter/protocol/java/control/gui/JUnitTestSamplerGui.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/sampler/HTTPSampler2.java
Method name: void stateChanged(ChangeEvent) Method name: String getResponseHeaders(HttpMethod)
Number of AST nodes: 5 Number of AST nodes: 6
1
FILTER.setPackges(JOrphanUtils.split(filterpkg.getText(),",")
1
for (int i = 0; i < rh.length; i++) {
2
			String key = rh[i].getName();
3
			headerBuf.append(key);
2
); //$NON-NLS-1$
4
			headerBuf.append(": "); // $NON-NLS-1$
3
            classnameCombo.removeAllItems();
4
            // change the classname drop down
5
            Object[] clist = FILTER.filterArray(CLASSLIST);
6
            for (int idx=0; idx < clist.length; idx++) {
7
                classnameCombo.addItem(clist[idx]);
8
            
5
			headerBuf.append(rh[i].getValue());
6
			headerBuf.append("\n"); // $NON-NLS-1$
9
}
7
		}
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.2
Clones locationClones are in different classes
Number of node comparisons12
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment5
    Time elapsed for statement mapping (ms)1.4
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    2
    FILTER.setPackges(JOrphanUtils.split(filterpkg.getText(), ","));
                                                                                                                                        
    3
    classnameCombo.removeAllItems();
                                                                          
    4
    Object[] clist = FILTER.filterArray(CLASSLIST);
                                                                                                    
    5
    for (int idx = 0; idx < clist.length; idx++)
    5
    for (int idx = 0; idx < clist.length; idx++)
    5
    for (int i = 0; i < rh.length; i++)
    Differences
    Expression1Expression2Difference
    idxiVARIABLE_NAME_MISMATCH
    idxiVARIABLE_NAME_MISMATCH
    clistrhVARIABLE_NAME_MISMATCH
    java.lang.Object[]org.apache.commons.httpclient.Header[]VARIABLE_TYPE_MISMATCH
    idxiVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type java.lang.Object[] of variable clist does not match with type org.apache.commons.httpclient.Header[] of variable rh
    • Make classes java.lang.Object[] and org.apache.commons.httpclient.Header[] extend a common superclass
    5
    for (int i = 0; i < rh.length; i++)
                                                                
    6
    String key = rh[i].getName();
    Preondition Violations
    Unmatched statement String key=rh[i].getName(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6
    String key = rh[i].getName();
    6
    classnameCombo.addItem(clist[idx]);
    6
    classnameCombo.addItem(clist[idx]);
    Preondition Violations
    Unmatched statement classnameCombo.addItem(clist[idx]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                
                                                      
    7
    headerBuf.append(key);
                                                        
    8
    headerBuf.append(": ");
                                                                                
    9
    headerBuf.append(rh[i].getValue());
    Preondition Violations
    Unmatched statement headerBuf.append(rh[i].getValue()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    9
    headerBuf.append(rh[i].getValue());
                                                          
    10
    headerBuf.append("\n");
    Precondition Violations (4)
    Row Violation
    1Type java.lang.Object[] of variable clist does not match with type org.apache.commons.httpclient.Header[] of variable rh
    2Unmatched statement String key=rh[i].getName(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement classnameCombo.addItem(clist[idx]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement headerBuf.append(rh[i].getValue()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted