if (plot.getOrientation() == PlotOrientation.HORIZONTAL) { hotspot = new Polygon(); hotspot.addPoint((int) transZero, (int) ((transX0 + transX1) / 2.0)); hotspot.addPoint((int) ((transY0 + transY1) / 2.0), (int) ((transX0 + transX1) / 2.0)); hotspot.addPoint((int) transY1, (int) transX1); hotspot.addPoint((int) ((transY1 + transY2) / 2.0), (int) ((transX1 + transX2) / 2.0)); hotspot.addPoint((int) transZero, (int) ((transX1 + transX2) / 2.0)); } else { // vertical orientation hotspot = new Polygon(); hotspot.addPoint((int) ((transX0 + transX1) / 2.0), (int) transZero); hotspot.addPoint((int) ((transX0 + transX1) / 2.0), (int) ((transY0 + transY1) / 2.0)); hotspot.addPoint((int) transX1, (int) transY1); hotspot.addPoint((int) ((transX1 + transX2) / 2.0), (int) ((transY1 + transY2) / 2.0)); hotspot.addPoint((int) ((transX1 + transX2) / 2.0), (int) transZero); }
if (plot.getOrientation() == PlotOrientation.HORIZONTAL) { hotspot = new Polygon(); hotspot.addPoint((int) transZero, (int) ((transX0 + transX1) / 2.0)); hotspot.addPoint((int) ((transY0 + transY1) / 2.0), (int) ((transX0 + transX1) / 2.0)); hotspot.addPoint((int) transY1, (int) transX1); hotspot.addPoint((int) ((transY1 + transY2) / 2.0), (int) ((transX1 + transX2) / 2.0)); hotspot.addPoint((int) transZero, (int) ((transX1 + transX2) / 2.0)); } else { // vertical orientation hotspot = new Polygon(); hotspot.addPoint((int) ((transX0 + transX1) / 2.0), (int) transZero); hotspot.addPoint((int) ((transX0 + transX1) / 2.0), (int) ((transY0 + transY1) / 2.0)); hotspot.addPoint((int) transX1, (int) transY1); hotspot.addPoint((int) ((transX1 + transX2) / 2.0), (int) ((transY1 + transY2) / 2.0)); hotspot.addPoint((int) ((transX1 + transX2) / 2.0), (int) transZero); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYAreaRenderer.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYAreaRenderer2.java
Method name: void drawItem(Graphics2D, XYItemRendererState, Rectangle2D, PlotRenderingInfo, XYPlot, ValueAxis, ValueAxis, XYDataset, int, int, CrosshairState, int) Method name: void drawItem(Graphics2D, XYItemRendererState, Rectangle2D, PlotRenderingInfo, XYPlot, ValueAxis, ValueAxis, XYDataset, int, int, CrosshairState, int)
Number of AST nodes: 13 Number of AST nodes: 13
1
if (plot.getOrientation() == PlotOrientation.HORIZONTAL) {
1
if (plot.getOrientation() == PlotOrientation.HORIZONTAL) {
2
            hotspot = new Polygon();
2
            hotspot = new Polygon();
3
            hotspot.addPoint((int) transZero, 
3
            hotspot.addPoint((int) transZero, 
4
                    (int) ((transX0 + transX1) / 2.0));
4
                    (int) ((transX0 + transX1) / 2.0));
5
            hotspot.addPoint((int) ((transY0 + transY1) / 2.0), 
5
            hotspot.addPoint((int) ((transY0 + transY1) / 2.0), 
6
                    (int) ((transX0 + transX1) / 2.0));
6
                    (int) ((transX0 + transX1) / 2.0));
7
            hotspot.addPoint((int) transY1, (int) transX1);
7
            hotspot.addPoint((int) transY1, (int) transX1);
8
            hotspot.addPoint((int) ((transY1 + transY2) / 2.0), 
8
            hotspot.addPoint((int) ((transY1 + transY2) / 2.0), 
9
                    (int) ((transX1 + transX2) / 2.0));
9
                    (int) ((transX1 + transX2) / 2.0));
10
            hotspot.addPoint((int) transZero, 
10
            hotspot.addPoint((int) transZero, 
11
                    (int) ((transX1 + transX2) / 2.0));
11
                    (int) ((transX1 + transX2) / 2.0));
12
        }
12
        }
13
        else {  // vertical orientation
13
        else {  // vertical orientation
14
            hotspot = new Polygon();
14
            hotspot = new Polygon();
15
            hotspot.addPoint((int) ((transX0 + transX1) / 2.0), 
15
            hotspot.addPoint((int) ((transX0 + transX1) / 2.0), 
16
                    (int) transZero);
16
                    (int) transZero);
17
            hotspot.addPoint((int) ((transX0 + transX1) / 2.0), 
17
            hotspot.addPoint((int) ((transX0 + transX1) / 2.0), 
18
                    (int) ((transY0 + transY1) / 2.0));
18
                    (int) ((transY0 + transY1) / 2.0));
19
            hotspot.addPoint((int) transX1, (int) transY1);
19
            hotspot.addPoint((int) transX1, (int) transY1);
20
            hotspot.addPoint((int) ((transX1 + transX2) / 2.0), 
20
            hotspot.addPoint((int) ((transX1 + transX2) / 2.0), 
21
                    (int) ((transY1 + transY2) / 2.0));
21
                    (int) ((transY1 + transY2) / 2.0));
22
            hotspot.addPoint((int) ((transX1 + transX2) / 2.0), 
22
            hotspot.addPoint((int) ((transX1 + transX2) / 2.0), 
23
                    (int) transZero);
23
                    (int) transZero);
24
        }
24
        }
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 different classes having the same super class
Number of node comparisons169
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements13
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)92.2
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    25
    if (plot.getOrientation() == PlotOrientation.HORIZONTAL)
    24
    if (plot.getOrientation() == PlotOrientation.HORIZONTAL)
    26
    hotspot = new Polygon();
    25
    hotspot = new Polygon();
    27
    hotspot.addPoint((int)transZero, (int)((transX0 + transX1) / 2.0));
    26
    hotspot.addPoint((int)transZero, (int)((transX0 + transX1) / 2.0));
    28
    hotspot.addPoint((int)((transY0 + transY1) / 2.0), (int)((transX0 + transX1) / 2.0));
    27
    hotspot.addPoint((int)((transY0 + transY1) / 2.0), (int)((transX0 + transX1) / 2.0));
    29
    hotspot.addPoint((int)transY1, (int)transX1);
    28
    hotspot.addPoint((int)transY1, (int)transX1);
    30
    hotspot.addPoint((int)((transY1 + transY2) / 2.0), (int)((transX1 + transX2) / 2.0));
    29
    hotspot.addPoint((int)((transY1 + transY2) / 2.0), (int)((transX1 + transX2) / 2.0));
    31
    hotspot.addPoint((int)transZero, (int)((transX1 + transX2) / 2.0));
    30
    hotspot.addPoint((int)transZero, (int)((transX1 + transX2) / 2.0));
    else
    else
    32
    hotspot = new Polygon();
    31
    hotspot = new Polygon();
    33
    hotspot.addPoint((int)((transX0 + transX1) / 2.0), (int)transZero);
    32
    hotspot.addPoint((int)((transX0 + transX1) / 2.0), (int)transZero);
    34
    hotspot.addPoint((int)((transX0 + transX1) / 2.0), (int)((transY0 + transY1) / 2.0));
    33
    hotspot.addPoint((int)((transX0 + transX1) / 2.0), (int)((transY0 + transY1) / 2.0));
    35
    hotspot.addPoint((int)transX1, (int)transY1);
    34
    hotspot.addPoint((int)transX1, (int)transY1);
    36
    hotspot.addPoint((int)((transX1 + transX2) / 2.0), (int)((transY1 + transY2) / 2.0));
    35
    hotspot.addPoint((int)((transX1 + transX2) / 2.0), (int)((transY1 + transY2) / 2.0));
    37
    hotspot.addPoint((int)((transX1 + transX2) / 2.0), (int)transZero);
    36
    hotspot.addPoint((int)((transX1 + transX2) / 2.0), (int)transZero);
    Precondition Violations (0)
    Row Violation