LogAxis axis = new LogAxis(); axis.setRange(50.0, 100.0); Rectangle2D dataArea = new Rectangle2D.Double(10.0, 50.0, 400.0, 300.0); double y1 = axis.java2DToValue(75.0, dataArea, RectangleEdge.LEFT); assertEquals(94.3874312681693, y1, EPSILON); double y2 = axis.java2DToValue(75.0, dataArea, RectangleEdge.RIGHT); assertEquals(94.3874312681693, y2, EPSILON); double x1 = axis.java2DToValue(75.0, dataArea, RectangleEdge.TOP); assertEquals(55.961246381405, x1, EPSILON); double x2 = axis.java2DToValue(75.0, dataArea, RectangleEdge.BOTTOM); assertEquals(55.961246381405, x2, EPSILON); axis.setInverted(true); double y3 = axis.java2DToValue(75.0, dataArea, RectangleEdge.LEFT); assertEquals(52.9731547179647, y3, EPSILON); double y4 = axis.java2DToValue(75.0, dataArea, RectangleEdge.RIGHT); assertEquals(52.9731547179647, y4, EPSILON); double x3 = axis.java2DToValue(75.0, dataArea, RectangleEdge.TOP); assertEquals(89.3475453695651, x3, EPSILON); double x4 = axis.java2DToValue(75.0, dataArea, RectangleEdge.BOTTOM); assertEquals(89.3475453695651, x4, EPSILON);
NumberAxis axis = new NumberAxis(); axis.setRange(50.0, 100.0); Rectangle2D dataArea = new Rectangle2D.Double(10.0, 50.0, 400.0, 300.0); double y1 = axis.java2DToValue(75.0, dataArea, RectangleEdge.LEFT); assertEquals(y1, 95.8333333, EPSILON); double y2 = axis.java2DToValue(75.0, dataArea, RectangleEdge.RIGHT); assertEquals(y2, 95.8333333, EPSILON); double x1 = axis.java2DToValue(75.0, dataArea, RectangleEdge.TOP); assertEquals(x1, 58.125, EPSILON); double x2 = axis.java2DToValue(75.0, dataArea, RectangleEdge.BOTTOM); assertEquals(x2, 58.125, EPSILON); axis.setInverted(true); double y3 = axis.java2DToValue(75.0, dataArea, RectangleEdge.LEFT); assertEquals(y3, 54.1666667, EPSILON); double y4 = axis.java2DToValue(75.0, dataArea, RectangleEdge.RIGHT); assertEquals(y4, 54.1666667, EPSILON); double x3 = axis.java2DToValue(75.0, dataArea, RectangleEdge.TOP); assertEquals(x3, 91.875, EPSILON); double x4 = axis.java2DToValue(75.0, dataArea, RectangleEdge.BOTTOM); assertEquals(x4, 91.875, EPSILON);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/chart/axis/junit/LogAxisTests.java File path: /jfreechart-1.0.10/tests/org/jfree/chart/axis/junit/NumberAxisTests.java
Method name: void testTranslateJava2DToValue() Method name: void testTranslateJava2DToValue()
Number of AST nodes: 20 Number of AST nodes: 20
1
LogAxis axis = new LogAxis();
1
NumberAxis axis = new NumberAxis();
2
        axis.setRange(50.0, 100.0);
2
        axis.setRange(50.0, 100.0); 
3
        Rectangle2D dataArea = new Rectangle2D.Double(10.0, 50.0, 400.0, 300.0);
3
        Rectangle2D dataArea = new Rectangle2D.Double(10.0, 50.0, 400.0, 300.0);
4
        double y1 = axis.java2DToValue(75.0, dataArea, RectangleEdge.LEFT);
4
        double y1 = axis.java2DToValue(75.0, dataArea, RectangleEdge.LEFT);  
5
        assertEquals(94.3874312681693, y1, EPSILON);
5
        assertEquals(y1, 95.8333333, EPSILON); 
6
        double y2 = axis.java2DToValue(75.0, dataArea, RectangleEdge.RIGHT);
6
        double y2 = axis.java2DToValue(75.0, dataArea, RectangleEdge.RIGHT);   
7
        assertEquals(94.3874312681693, y2, EPSILON);
7
        assertEquals(y2, 95.8333333, EPSILON); 
8
        double x1 = axis.java2DToValue(75.0, dataArea, RectangleEdge.TOP);
8
        double x1 = axis.java2DToValue(75.0, dataArea, RectangleEdge.TOP);   
9
        assertEquals(55.961246381405, x1, EPSILON);
9
        assertEquals(x1, 58.125, EPSILON); 
10
        double x2 = axis.java2DToValue(75.0, dataArea, RectangleEdge.BOTTOM);
10
        double x2 = axis.java2DToValue(75.0, dataArea, RectangleEdge.BOTTOM);   
11
        assertEquals(55.961246381405, x2, EPSILON);
11
        assertEquals(x2, 58.125, EPSILON); 
12
        axis.setInverted(true);
12
        axis.setInverted(true);
13
        double y3 = axis.java2DToValue(75.0, dataArea, RectangleEdge.LEFT);
13
        double y3 = axis.java2DToValue(75.0, dataArea, RectangleEdge.LEFT);  
14
        assertEquals(52.9731547179647, y3, EPSILON);
14
        assertEquals(y3, 54.1666667, EPSILON); 
15
        double y4 = axis.java2DToValue(75.0, dataArea, RectangleEdge.RIGHT);
15
        double y4 = axis.java2DToValue(75.0, dataArea, RectangleEdge.RIGHT);   
16
        assertEquals(52.9731547179647, y4, EPSILON);
16
        assertEquals(y4, 54.1666667, EPSILON); 
17
        double x3 = axis.java2DToValue(75.0, dataArea, RectangleEdge.TOP);
17
        double x3 = axis.java2DToValue(75.0, dataArea, RectangleEdge.TOP);   
18
        assertEquals(89.3475453695651, x3, EPSILON);
18
        assertEquals(x3, 91.875, EPSILON); 
19
        double x4 = axis.java2DToValue(75.0, dataArea, RectangleEdge.BOTTOM);
19
        double x4 = axis.java2DToValue(75.0, dataArea, RectangleEdge.BOTTOM);   
20
        assertEquals(89.3475453695651, x4, EPSILON);
20
        assertEquals(x4, 91.875, EPSILON);
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.0
Clones locationClones are in different classes having the same super class
Number of node comparisons269
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements20
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    LogAxis axis = new LogAxis();
    1
    LogAxis axis = new LogAxis();
    1
    NumberAxis axis = new NumberAxis();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.LogAxisorg.jfree.chart.axis.NumberAxisSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.LogAxisorg.jfree.chart.axis.NumberAxisSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.LogAxisorg.jfree.chart.axis.NumberAxisSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new LogAxis() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new NumberAxis() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    1
    NumberAxis axis = new NumberAxis();
    2
    axis.setRange(50.0, 100.0);
    2
    axis.setRange(50.0, 100.0);
    2
    axis.setRange(50.0, 100.0);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.LogAxisorg.jfree.chart.axis.NumberAxisSUBCLASS_TYPE_MISMATCH
    2
    axis.setRange(50.0, 100.0);
    3
    Rectangle2D dataArea = new Rectangle2D.Double(10.0, 50.0, 400.0, 300.0);
    3
    Rectangle2D dataArea = new Rectangle2D.Double(10.0, 50.0, 400.0, 300.0);
    4
    double y1 = axis.java2DToValue(75.0, dataArea, RectangleEdge.LEFT);
    4
    double y1 = axis.java2DToValue(75.0, dataArea, RectangleEdge.LEFT);
    4
    double y1 = axis.java2DToValue(75.0, dataArea, RectangleEdge.LEFT);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.LogAxisorg.jfree.chart.axis.NumberAxisSUBCLASS_TYPE_MISMATCH
    4
    double y1 = axis.java2DToValue(75.0, dataArea, RectangleEdge.LEFT);
    5
    assertEquals(94.3874312681693, y1, EPSILON);
    5
    assertEquals(94.3874312681693, y1, EPSILON);
    5
    assertEquals(y1, 95.8333333, EPSILON);
    Differences
    Expression1Expression2Difference
    94.3874312681693y1TYPE_COMPATIBLE_REPLACEMENT
    y195.8333333TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression y1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression y1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    assertEquals(y1, 95.8333333, EPSILON);
    6
    double y2 = axis.java2DToValue(75.0, dataArea, RectangleEdge.RIGHT);
    6
    double y2 = axis.java2DToValue(75.0, dataArea, RectangleEdge.RIGHT);
    6
    double y2 = axis.java2DToValue(75.0, dataArea, RectangleEdge.RIGHT);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.LogAxisorg.jfree.chart.axis.NumberAxisSUBCLASS_TYPE_MISMATCH
    6
    double y2 = axis.java2DToValue(75.0, dataArea, RectangleEdge.RIGHT);
    7
    assertEquals(94.3874312681693, y2, EPSILON);
    7
    assertEquals(94.3874312681693, y2, EPSILON);
    7
    assertEquals(y2, 95.8333333, EPSILON);
    Differences
    Expression1Expression2Difference
    94.3874312681693y2TYPE_COMPATIBLE_REPLACEMENT
    y295.8333333TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression y2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression y2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7
    assertEquals(y2, 95.8333333, EPSILON);
    8
    double x1 = axis.java2DToValue(75.0, dataArea, RectangleEdge.TOP);
    8
    double x1 = axis.java2DToValue(75.0, dataArea, RectangleEdge.TOP);
    8
    double x1 = axis.java2DToValue(75.0, dataArea, RectangleEdge.TOP);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.LogAxisorg.jfree.chart.axis.NumberAxisSUBCLASS_TYPE_MISMATCH
    8
    double x1 = axis.java2DToValue(75.0, dataArea, RectangleEdge.TOP);
    9
    assertEquals(55.961246381405, x1, EPSILON);
    9
    assertEquals(55.961246381405, x1, EPSILON);
    9
    assertEquals(x1, 58.125, EPSILON);
    Differences
    Expression1Expression2Difference
    55.961246381405x1TYPE_COMPATIBLE_REPLACEMENT
    x158.125TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression x1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression x1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9
    assertEquals(x1, 58.125, EPSILON);
    10
    double x2 = axis.java2DToValue(75.0, dataArea, RectangleEdge.BOTTOM);
    10
    double x2 = axis.java2DToValue(75.0, dataArea, RectangleEdge.BOTTOM);
    10
    double x2 = axis.java2DToValue(75.0, dataArea, RectangleEdge.BOTTOM);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.LogAxisorg.jfree.chart.axis.NumberAxisSUBCLASS_TYPE_MISMATCH
    10
    double x2 = axis.java2DToValue(75.0, dataArea, RectangleEdge.BOTTOM);
    11
    assertEquals(55.961246381405, x2, EPSILON);
    11
    assertEquals(55.961246381405, x2, EPSILON);
    11
    assertEquals(x2, 58.125, EPSILON);
    Differences
    Expression1Expression2Difference
    55.961246381405x2TYPE_COMPATIBLE_REPLACEMENT
    x258.125TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression x2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression x2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11
    assertEquals(x2, 58.125, EPSILON);
    12
    axis.setInverted(true);
    12
    axis.setInverted(true);
    12
    axis.setInverted(true);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.LogAxisorg.jfree.chart.axis.NumberAxisSUBCLASS_TYPE_MISMATCH
    12
    axis.setInverted(true);
    13
    double y3 = axis.java2DToValue(75.0, dataArea, RectangleEdge.LEFT);
    13
    double y3 = axis.java2DToValue(75.0, dataArea, RectangleEdge.LEFT);
    13
    double y3 = axis.java2DToValue(75.0, dataArea, RectangleEdge.LEFT);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.LogAxisorg.jfree.chart.axis.NumberAxisSUBCLASS_TYPE_MISMATCH
    13
    double y3 = axis.java2DToValue(75.0, dataArea, RectangleEdge.LEFT);
    14
    assertEquals(52.9731547179647, y3, EPSILON);
    14
    assertEquals(52.9731547179647, y3, EPSILON);
    14
    assertEquals(y3, 54.1666667, EPSILON);
    Differences
    Expression1Expression2Difference
    52.9731547179647y3TYPE_COMPATIBLE_REPLACEMENT
    y354.1666667TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression y3 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression y3 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14
    assertEquals(y3, 54.1666667, EPSILON);
    15
    double y4 = axis.java2DToValue(75.0, dataArea, RectangleEdge.RIGHT);
    15
    double y4 = axis.java2DToValue(75.0, dataArea, RectangleEdge.RIGHT);
    15
    double y4 = axis.java2DToValue(75.0, dataArea, RectangleEdge.RIGHT);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.LogAxisorg.jfree.chart.axis.NumberAxisSUBCLASS_TYPE_MISMATCH
    15
    double y4 = axis.java2DToValue(75.0, dataArea, RectangleEdge.RIGHT);
    16
    assertEquals(52.9731547179647, y4, EPSILON);
    16
    assertEquals(52.9731547179647, y4, EPSILON);
    16
    assertEquals(y4, 54.1666667, EPSILON);
    Differences
    Expression1Expression2Difference
    52.9731547179647y4TYPE_COMPATIBLE_REPLACEMENT
    y454.1666667TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression y4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression y4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16
    assertEquals(y4, 54.1666667, EPSILON);
    17
    double x3 = axis.java2DToValue(75.0, dataArea, RectangleEdge.TOP);
    17
    double x3 = axis.java2DToValue(75.0, dataArea, RectangleEdge.TOP);
    17
    double x3 = axis.java2DToValue(75.0, dataArea, RectangleEdge.TOP);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.LogAxisorg.jfree.chart.axis.NumberAxisSUBCLASS_TYPE_MISMATCH
    17
    double x3 = axis.java2DToValue(75.0, dataArea, RectangleEdge.TOP);
    18
    assertEquals(89.3475453695651, x3, EPSILON);
    18
    assertEquals(89.3475453695651, x3, EPSILON);
    18
    assertEquals(x3, 91.875, EPSILON);
    Differences
    Expression1Expression2Difference
    89.3475453695651x3TYPE_COMPATIBLE_REPLACEMENT
    x391.875TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression x3 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression x3 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18
    assertEquals(x3, 91.875, EPSILON);
    19
    double x4 = axis.java2DToValue(75.0, dataArea, RectangleEdge.BOTTOM);
    19
    double x4 = axis.java2DToValue(75.0, dataArea, RectangleEdge.BOTTOM);
    19
    double x4 = axis.java2DToValue(75.0, dataArea, RectangleEdge.BOTTOM);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.LogAxisorg.jfree.chart.axis.NumberAxisSUBCLASS_TYPE_MISMATCH
    19
    double x4 = axis.java2DToValue(75.0, dataArea, RectangleEdge.BOTTOM);
    20
    assertEquals(89.3475453695651, x4, EPSILON);
    20
    assertEquals(89.3475453695651, x4, EPSILON);
    20
    assertEquals(x4, 91.875, EPSILON);
    Differences
    Expression1Expression2Difference
    89.3475453695651x4TYPE_COMPATIBLE_REPLACEMENT
    x491.875TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression x4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression x4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20
    assertEquals(x4, 91.875, EPSILON);
    Precondition Violations (18)
    Row Violation
    1Expression new LogAxis() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new NumberAxis() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression y1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression y1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression y2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression y2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression x1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression x1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression x2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression x2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression y3 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression y3 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression y4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression y4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression x3 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Expression x3 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Expression x4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Expression x4 cannot be parameterized, because it has dependencies to/from statements that will be extracted