Graphics g = getGraphics(); if (g != null) { drawSample(xPos, oneSample, g); }
if (cookieManager != null) { cookieHeader = cookieManager.getCookieHeaderForURL(u); if (cookieHeader != null) { conn.setRequestProperty(HEADER_COOKIE, cookieHeader); } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/visualizers/Graph.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java
Method name: void run() Method name: String setConnectionCookie(HttpURLConnection, URL, CookieManager)
Number of AST nodes: 3 Number of AST nodes: 4
1
Graphics g = getGraphics(
1
if (cookieManager != null) {
2
);
2
			cookieHeader = cookieManager.getCookieHeaderForURL(u);
3
				if (g != null) {
3
			if (cookieHeader != null) {
4
					drawSample(xPos, oneSample, g);
4
				conn.setRequestProperty(HEADER_COOKIE, cookieHeader);
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 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)1.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Graphics g = getGraphics();
                                                            
                                                                                                                  
    3
    cookieHeader = cookieManager.getCookieHeaderForURL(u);
    2
    if (g != null)
    2
    if (g != null)
    4
    if (cookieHeader != null)
    Differences
    Expression1Expression2Difference
    gcookieHeaderVARIABLE_NAME_MISMATCH
    java.awt.Graphicsjava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.awt.Graphics of variable g does not match with type java.lang.String of variable cookieHeader
    • Make classes java.awt.Graphics and java.lang.String extend a common superclass
    4
    if (cookieHeader != null)
    3
    drawSample(xPos, oneSample, g);
    3
    drawSample(xPos, oneSample, g);
    5
    conn.setRequestProperty(HEADER_COOKIE, cookieHeader);
    Differences
    Expression1Expression2Difference
    drawSamplesetRequestPropertyMETHOD_INVOCATION_NAME_MISMATCH
    drawSample(xPos,oneSample,g)conn.setRequestProperty(HEADER_COOKIE,cookieHeader)ARGUMENT_NUMBER_MISMATCH
    connMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression drawSample(xPos,oneSample,g) is a void method call, and thus it cannot be parameterized
    Expression conn.setRequestProperty(HEADER_COOKIE,cookieHeader) 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 conn.setRequestProperty(HEADER_COOKIE,cookieHeader) is a void method call, and thus it cannot be parameterized
    5
    conn.setRequestProperty(HEADER_COOKIE, cookieHeader);
    Precondition Violations (5)
    Row Violation
    1Type java.awt.Graphics of variable g does not match with type java.lang.String of variable cookieHeader
    2Expression drawSample(xPos,oneSample,g) is a void method call, and thus it cannot be parameterized
    3Expression conn.setRequestProperty(HEADER_COOKIE,cookieHeader) is a void method call, and thus it cannot be parameterized
    4Expression drawSample(xPos,oneSample,g) is a void method call, and thus it cannot be parameterized
    5Expression conn.setRequestProperty(HEADER_COOKIE,cookieHeader) is a void method call, and thus it cannot be parameterized