if ((meanValue.doubleValue() + valueDelta) > rangeAxis.getRange().getUpperBound()) { highVal = rangeAxis.valueToJava2D( rangeAxis.getRange().getUpperBound(), dataArea, yAxisLocation); } else { highVal = rangeAxis.valueToJava2D(meanValue.doubleValue() + valueDelta, dataArea, yAxisLocation); }
if ((meanValue.doubleValue() + valueDelta) < rangeAxis.getRange().getLowerBound()) { lowVal = rangeAxis.valueToJava2D( rangeAxis.getRange().getLowerBound(), dataArea, yAxisLocation); } else { lowVal = rangeAxis.valueToJava2D(meanValue.doubleValue() - valueDelta, dataArea, yAxisLocation); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/StatisticalLineAndShapeRenderer.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/StatisticalLineAndShapeRenderer.java
Method name: void drawItem(Graphics2D, CategoryItemRendererState, Rectangle2D, CategoryPlot, CategoryAxis, ValueAxis, CategoryDataset, int, int, int) Method name: void drawItem(Graphics2D, CategoryItemRendererState, Rectangle2D, CategoryPlot, CategoryAxis, ValueAxis, CategoryDataset, int, int, int)
Number of AST nodes: 3 Number of AST nodes: 3
1
if ((meanValue.doubleValue() + valueDelta)
1
if ((meanValue.doubleValue() + valueDelta)
2
                &gt; rangeAxis.getRange().getUpperBound()) {
2
                &lt; rangeAxis.getRange().getLowerBound()) {
3
            highVal = rangeAxis.valueToJava2D(
3
            lowVal = rangeAxis.valueToJava2D(
4
                    rangeAxis.getRange().getUpperBound(), dataArea,
4
                    rangeAxis.getRange().getLowerBound(), dataArea,
5
                    yAxisLocation);
5
                    yAxisLocation);
6
        }
6
        }
7
        else {
7
        else {
8
            highVal = rangeAxis.valueToJava2D(meanValue.doubleValue()
8
            lowVal = rangeAxis.valueToJava2D(meanValue.doubleValue()
9
                    + valueDelta, dataArea, yAxisLocation);
9
                    - valueDelta, dataArea, yAxisLocation);
10
        }
10
        }
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.4
Clones locationClones are in the same method
Number of node comparisons9
  1. {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)102.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    53
    if ((meanValue.doubleValue() + valueDelta) > rangeAxis.getRange().getUpperBound())
    53
    if ((meanValue.doubleValue() + valueDelta) > rangeAxis.getRange().getUpperBound())
    56
    if ((meanValue.doubleValue() + valueDelta) < rangeAxis.getRange().getLowerBound())
    Differences
    Expression1Expression2Difference
    getUpperBoundgetLowerBoundMETHOD_INVOCATION_NAME_MISMATCH
    ><OPERATOR_MISMATCH
    56
    if ((meanValue.doubleValue() + valueDelta) < rangeAxis.getRange().getLowerBound())
    54
    highVal = rangeAxis.valueToJava2D(rangeAxis.getRange().getUpperBound(), dataArea, yAxisLocation);
    54
    highVal = rangeAxis.valueToJava2D(rangeAxis.getRange().getUpperBound(), dataArea, yAxisLocation);
    57
    lowVal = rangeAxis.valueToJava2D(rangeAxis.getRange().getLowerBound(), dataArea, yAxisLocation);
    Differences
    Expression1Expression2Difference
    highVallowValVARIABLE_NAME_MISMATCH
    getUpperBoundgetLowerBoundMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression rangeAxis.getRange().getUpperBound() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression rangeAxis.getRange().getLowerBound() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    57
    lowVal = rangeAxis.valueToJava2D(rangeAxis.getRange().getLowerBound(), dataArea, yAxisLocation);
    else
    else
    55
    highVal = rangeAxis.valueToJava2D(meanValue.doubleValue() + valueDelta, dataArea, yAxisLocation);
    55
    highVal = rangeAxis.valueToJava2D(meanValue.doubleValue() + valueDelta, dataArea, yAxisLocation);
    58
    lowVal = rangeAxis.valueToJava2D(meanValue.doubleValue() - valueDelta, dataArea, yAxisLocation);
    Differences
    Expression1Expression2Difference
    highVallowValVARIABLE_NAME_MISMATCH
    +-OPERATOR_MISMATCH
    Preondition Violations
    Expression meanValue.doubleValue() + valueDelta cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression meanValue.doubleValue() - valueDelta cannot be parameterized, because it has dependencies to/from statements that will be extracted
    58
    lowVal = rangeAxis.valueToJava2D(meanValue.doubleValue() - valueDelta, dataArea, yAxisLocation);
    Precondition Violations (4)
    Row Violation
    1Expression rangeAxis.getRange().getUpperBound() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression rangeAxis.getRange().getLowerBound() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression meanValue.doubleValue() + valueDelta cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression meanValue.doubleValue() - valueDelta cannot be parameterized, because it has dependencies to/from statements that will be extracted