Graphics g = getGraphics(); if (g != null) { drawSample(xPos * PLOT_X_WIDTH, oneSample, g); }
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/visualizers/GraphAccum.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/visualizers/Graph.java
Method name: void run() Method name: void run()
Number of AST nodes: 3 Number of AST nodes: 3
1
Graphics g = getGraphics();
1
Graphics g = getGraphics();
2
				if (g != null) {
2
				if (g != null) {
3
					drawSample(xPos * PLOT_X_WIDTH, oneSample, g);
3
					drawSample(xPos, oneSample, g);
4
				}
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.3
Clones locationClones are in different classes
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Graphics g = getGraphics();
    1
    Graphics g = getGraphics();
    2
    if (g != null)
    2
    if (g != null)
    2
    if (g != null)
    Differences
    Expression1Expression2Difference
    xPos * PLOT_X_WIDTHxPosTYPE_COMPATIBLE_REPLACEMENT
    org.apache.jmeter.samplers.SampleResultorg.apache.jmeter.visualizers.SampleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.jmeter.samplers.SampleResult of variable oneSample does not match with type org.apache.jmeter.visualizers.Sample of variable oneSample
    • Make classes org.apache.jmeter.samplers.SampleResult and org.apache.jmeter.visualizers.Sample extend a common superclass
    2
    if (g != null)
    3
    drawSample(xPos * PLOT_X_WIDTH, oneSample, g);
    3
    drawSample(xPos * PLOT_X_WIDTH, oneSample, g);
    3
    drawSample(xPos, oneSample, g);
    Differences
    Expression1Expression2Difference
    xPos * PLOT_X_WIDTHxPosTYPE_COMPATIBLE_REPLACEMENT
    org.apache.jmeter.samplers.SampleResultorg.apache.jmeter.visualizers.SampleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.jmeter.samplers.SampleResult of variable oneSample does not match with type org.apache.jmeter.visualizers.Sample of variable oneSample
    • Make classes org.apache.jmeter.samplers.SampleResult and org.apache.jmeter.visualizers.Sample extend a common superclass
    3
    drawSample(xPos, oneSample, g);
    Precondition Violations (3)
    Row Violation
    1Type org.apache.jmeter.samplers.SampleResult of variable oneSample does not match with type org.apache.jmeter.visualizers.Sample of variable oneSample
    2Type org.apache.jmeter.samplers.SampleResult of variable oneSample does not match with type org.apache.jmeter.visualizers.Sample of variable oneSample
    3The refactoring of the clones is infeasible, because classes and do not have a common superclass