HTTPFileArg file = files.length > 0? files[0] : null; if(file != null && file.getMimeType() != null && file.getMimeType().length() > 0) { put.setRequestHeader(HEADER_CONTENT_TYPE, file.getMimeType()); }
HTTPFileArg file = files.length > 0? files[0] : null; if(file != null && file.getMimeType() != null && file.getMimeType().length() > 0) { connection.setRequestProperty(HTTPConstants.HEADER_CONTENT_TYPE, file.getMimeType());
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/sampler/HTTPSampler2.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/sampler/PostWriter.java
Method name: String sendPutData(PutMethod) Method name: void setHeaders(URLConnection, HTTPSampler)
Number of AST nodes: 3 Number of AST nodes: 2
1
HTTPFileArg file = files.length > 0? files[0] : null;
1
HTTPFileArg file = files.length > 0? files[0] : null;
2
                if(file != null && file.getMimeType() != null && file.getMimeType().length() > 0) {
2
                        if(file != null && file.getMimeType() != null && file.getMimeType().length() > 0) {
3
                    put.setRequestHeader(HEADER_CONTENT_TYPE, file.getMimeType());
3
                            connection.setRequestProperty(HTTPConstants.HEADER_CONTENT_TYPE, file.getMimeType());
4
                }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are in different classes
Number of node comparisons1
  1. {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.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    41
    HTTPFileArg file = files.length > 0 ? files[0] : null;
    59
    HTTPFileArg file = files.length > 0 ? files[0] : null;
    42
    if (file != null && file.getMimeType() != null && file.getMimeType().length() > 0)
    42
    if (file != null && file.getMimeType() != null && file.getMimeType().length() > 0)
    Preondition Violations
    Unmatched statement if(file != null && file.getMimeType() != null && file.getMimeType().length() > 0) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                                              
    43
    put.setRequestHeader(HEADER_CONTENT_TYPE, file.getMimeType());
    43
    put.setRequestHeader(HEADER_CONTENT_TYPE, file.getMimeType());
    Preondition Violations
    Unmatched statement put.setRequestHeader(HEADER_CONTENT_TYPE,file.getMimeType()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                      
                                                                                                                                                                              
    60
    if (file != null && file.getMimeType() != null && file.getMimeType().length() > 0)
    Preondition Violations
    Unmatched statement if(file != null && file.getMimeType() != null && file.getMimeType().length() > 0) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    60
    if (file != null && file.getMimeType() != null && file.getMimeType().length() > 0)
                                                                                                                                                                                    
    61
    connection.setRequestProperty(HTTPConstants.HEADER_CONTENT_TYPE, file.getMimeType());
    Preondition Violations
    Unmatched statement connection.setRequestProperty(HTTPConstants.HEADER_CONTENT_TYPE,file.getMimeType()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    61
    connection.setRequestProperty(HTTPConstants.HEADER_CONTENT_TYPE, file.getMimeType());
    Precondition Violations (4)
    Row Violation
    1Unmatched statement if(file != null && file.getMimeType() != null && file.getMimeType().length() > 0) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement put.setRequestHeader(HEADER_CONTENT_TYPE,file.getMimeType()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement if(file != null && file.getMimeType() != null && file.getMimeType().length() > 0) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement connection.setRequestProperty(HTTPConstants.HEADER_CONTENT_TYPE,file.getMimeType()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted