for(int i = 0; i < NUMBER_OF_MENU_ITEMS; i++) { String fileName = (String)newRecentFiles.get(i); if(fileName != null) { setRecentFile(i, fileName); } }
if(auth != null) { String authHeader = auth.getAuthHeaderForURL(url); if(authHeader != null) { ++hsz; } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/action/LoadRecentProject.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/sampler/AjpSampler.java
Method name: void updateRecentFileMenuItems(List, String) Method name: int getHeaderSize(String, URL)
Number of AST nodes: 4 Number of AST nodes: 4
1
for(int i = 0; i < NUMBER_OF_MENU_ITEMS; i++) {
1
if(auth != null) {
2
            String fileName = (String)newRecentFiles.get(i);
2
                String authHeader = auth.getAuthHeaderForURL(url);
3
            if(fileName != null) {
3
            if(authHeader != null) {
4
                setRecentFile(i, fileName);
4
            ++hsz;
5
            }
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 comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)15.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    12
    String fileName = (String)newRecentFiles.get(i);
    12
    String fileName = (String)newRecentFiles.get(i);
    15
    String authHeader = auth.getAuthHeaderForURL(url);
    Differences
    Expression1Expression2Difference
    fileNameauthHeaderVARIABLE_NAME_MISMATCH
    (String)newRecentFiles.get(i)auth.getAuthHeaderForURL(url)TYPE_COMPATIBLE_REPLACEMENT
    15
    String authHeader = auth.getAuthHeaderForURL(url);
    13
    if (fileName != null)
    13
    if (fileName != null)
    16
    if (authHeader != null)
    Differences
    Expression1Expression2Difference
    fileNameauthHeaderVARIABLE_NAME_MISMATCH
    16
    if (authHeader != null)
    14
    setRecentFile(i, fileName);
    14
    setRecentFile(i, fileName);
    Preondition Violations
    Unmatched statement setRecentFile(i,fileName); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                
                        
    17
    ++hsz;
    Precondition Violations (2)
    Row Violation
    1Unmatched statement setRecentFile(i,fileName); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Clone fragment #1 returns variables fileName , while Clone fragment #2 returns variables