if(HEADER_SET_COOKIE.equalsIgnoreCase(name)) { CookieManager cookies = getCookieManager(); if(cookies != null) { cookies.addCookieFromHeader(value, res.getURL()); } }
Graphics g = getGraphics(); if (g != null) { drawSample(xPos, oneSample, g); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/sampler/AjpSampler.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/visualizers/Graph.java
Method name: void parseHeaders(HTTPSampleResult) Method name: void run()
Number of AST nodes: 4 Number of AST nodes: 3
1
if(HEADER_SET_COOKIE.equalsIgnoreCase(name)) {
2
                CookieManager cookies = getCookieManager();
3
                if(cookies != null) {
4
                    cookies.addCookieFromHeader(value, res.getURL());
5
                }
6
            
1
Graphics g = getGraphics();
2
				if (g != null) {
3
					drawSample(xPos, oneSample, g);
7
}
4
				}
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 comparisons5
  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)52.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                            
    1
    Graphics g = getGraphics();
    20
    CookieManager cookies = getCookieManager();
    20
    CookieManager cookies = getCookieManager();
    Preondition Violations
    Unmatched statement CookieManager cookies=getCookieManager(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                              
    21
    if (cookies != null)
    21
    if (cookies != null)
    2
    if (g != null)
    Differences
    Expression1Expression2Difference
    cookiesgVARIABLE_NAME_MISMATCH
    org.apache.jmeter.protocol.http.control.CookieManagerjava.awt.GraphicsVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.jmeter.protocol.http.control.CookieManager of variable cookies does not match with type java.awt.Graphics of variable g
    • Make classes org.apache.jmeter.protocol.http.control.CookieManager and java.awt.Graphics extend a common superclass
    2
    if (g != null)
    22
    cookies.addCookieFromHeader(value, res.getURL());
    22
    cookies.addCookieFromHeader(value, res.getURL());
    3
    drawSample(xPos, oneSample, g);
    Differences
    Expression1Expression2Difference
    addCookieFromHeaderdrawSampleMETHOD_INVOCATION_NAME_MISMATCH
    cookies.addCookieFromHeader(value,res.getURL())drawSample(xPos,oneSample,g)ARGUMENT_NUMBER_MISMATCH
    cookiesMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression cookies.addCookieFromHeader(value,res.getURL()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression drawSample(xPos,oneSample,g) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method drawSample
    Expression cookies.addCookieFromHeader(value,res.getURL()) is a void method call, and thus it cannot be parameterized
    Expression drawSample(xPos,oneSample,g) is a void method call, and thus it cannot be parameterized
    Expression cookies.addCookieFromHeader(value,res.getURL()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression drawSample(xPos,oneSample,g) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method drawSample
    Expression cookies.addCookieFromHeader(value,res.getURL()) is a void method call, and thus it cannot be parameterized
    Expression drawSample(xPos,oneSample,g) is a void method call, and thus it cannot be parameterized
    3
    drawSample(xPos, oneSample, g);
    Precondition Violations (11)
    Row Violation
    1Unmatched statement CookieManager cookies=getCookieManager(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Type org.apache.jmeter.protocol.http.control.CookieManager of variable cookies does not match with type java.awt.Graphics of variable g
    3Expression cookies.addCookieFromHeader(value,res.getURL()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression drawSample(xPos,oneSample,g) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression cookies.addCookieFromHeader(value,res.getURL()) is a void method call, and thus it cannot be parameterized
    6Expression drawSample(xPos,oneSample,g) is a void method call, and thus it cannot be parameterized
    7Expression cookies.addCookieFromHeader(value,res.getURL()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression drawSample(xPos,oneSample,g) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression cookies.addCookieFromHeader(value,res.getURL()) is a void method call, and thus it cannot be parameterized
    10Expression drawSample(xPos,oneSample,g) is a void method call, and thus it cannot be parameterized
    11The refactoring of the clones is infeasible, because classes org.apache.jmeter.protocol.http.sampler.AjpSampler and do not have a common superclass