boolean haveContentEncoding = false; if(contentEncoding != null && contentEncoding.trim().length() > 0) { put.getParams().setContentCharset(contentEncoding); haveContentEncoding = true; }
boolean haveContentEncoding = false; if(contentEncoding != null && contentEncoding.trim().length() > 0) { post.getParams().setContentCharset(contentEncoding); haveContentEncoding = true; }
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/HTTPSampler2.java
Method name: String sendPutData(PutMethod) Method name: String sendPostData(PostMethod)
Number of AST nodes: 4 Number of AST nodes: 4
1
boolean haveContentEncoding = false;
1
boolean haveContentEncoding = false;
2
            if(contentEncoding != null && contentEncoding.trim().length() > 0) {
2
                if(contentEncoding != null && contentEncoding.trim().length() > 0) {
3
                put.getParams().setContentCharset(contentEncoding);
3
                    post.getParams().setContentCharset(contentEncoding);
4
                haveContentEncoding = true;
4
                    haveContentEncoding = true;
5
            }
5
                }
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.3
Clones locationClones are declared in the same class
Number of node comparisons10
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    14
    boolean haveContentEncoding = false;
    53
    boolean haveContentEncoding = false;
    15
    if (contentEncoding != null && contentEncoding.trim().length() > 0)
    54
    if (contentEncoding != null && contentEncoding.trim().length() > 0)
    16
    put.getParams().setContentCharset(contentEncoding);
    16
    put.getParams().setContentCharset(contentEncoding);
    55
    post.getParams().setContentCharset(contentEncoding);
    Differences
    Expression1Expression2Difference
    putpostVARIABLE_NAME_MISMATCH
    org.apache.commons.httpclient.methods.PutMethodorg.apache.commons.httpclient.methods.PostMethodSUBCLASS_TYPE_MISMATCH
    55
    post.getParams().setContentCharset(contentEncoding);
    17
    haveContentEncoding = true;
    56
    haveContentEncoding = true;
    Precondition Violations (0)
    Row Violation