if (itemVisible && !Double.isNaN(transX1) && !Double.isNaN(transY1)) { float x = (float) transX1; float y = (float) transY1; if (orientation == PlotOrientation.HORIZONTAL) { x = (float) transY1; y = (float) transX1; } if (s.isLastPointGood()) { // TODO: check threshold s.seriesPath.lineTo(x, y); } else { s.seriesPath.moveTo(x, y); } s.setLastPointGood(true); } else { s.setLastPointGood(false); }
if (!Double.isNaN(transX1) && !Double.isNaN(transY1)) { float x = (float) transX1; float y = (float) transY1; PlotOrientation orientation = plot.getOrientation(); if (orientation == PlotOrientation.HORIZONTAL) { x = (float) transY1; y = (float) transX1; } if (s.isLastPointGood()) { s.seriesPath.lineTo(x, y); } else { s.seriesPath.moveTo(x, y); } s.setLastPointGood(true); } else { s.setLastPointGood(false); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/StandardXYItemRenderer.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java
Method name: void drawItem(Graphics2D, XYItemRendererState, Rectangle2D, PlotRenderingInfo, XYPlot, ValueAxis, ValueAxis, XYDataset, int, int, CrosshairState, int) Method name: void drawPrimaryLineAsPath(XYItemRendererState, Graphics2D, XYPlot, XYDataset, int, int, int, ValueAxis, ValueAxis, Rectangle2D)
Number of AST nodes: 11 Number of AST nodes: 12
1
if (itemVisible && !Double.isNaN(transX1)
1
if (!Double.isNaN(transX1)
2
                        && !Double.isNaN(transY1)) {
2
 && !Double.isNaN(transY1)) {
3
                    float x = (float) transX1;
3
            float x = (float) transX1;
4
                    float y = (float) transY1;
4
            float y = (float) transY1;
5
        
5
            PlotOrientation orientation = plot.getOrientation();
6
            if (orientation == PlotOrientation.HORIZONTAL) {
6
            if (orientation == PlotOrientation.HORIZONTAL) {
7
                        x = (float) transY1;
7
                x = (float) transY1;
8
                        y = (float) transX1;
8
                y = (float) transX1;
9
                    }
9
            }
10
                    if (s.isLastPointGood()) {
10
            if (s.isLastPointGood()) {
11
                        // TODO: check threshold
12
                        s.seriesPath.lineTo(x, y);
11
                s.seriesPath.lineTo(x, y);
13
                    }
12
            
14
    
13
}
15
                else {
14
            else {
16
                        s.seriesPath.moveTo(x, y);
15
                s.seriesPath.moveTo(x, y);
17
                    }
16
            
18
      
17
}
19
              s.setLastPointGood(true);
18
            s.setLastPointGood(true);
20
                }
19
        
21
       
20
}
22
         else {
21
        else {
23
                    s.setLastPointGood(false);
22
            s.setLastPointGood(false);
24
                }
23
        }
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)1.0
Clones locationClones are in different classes having the same super class
Number of node comparisons50
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements11
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)12.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    26
    if (itemVisible && !Double.isNaN(transX1) && !Double.isNaN(transY1))
    26
    if (itemVisible && !Double.isNaN(transX1) && !Double.isNaN(transY1))
    8
    if (!Double.isNaN(transX1) && !Double.isNaN(transY1))
    Differences
    Expression1Expression2Difference
    itemVisible!Double.isNaN(transX1)TYPE_COMPATIBLE_REPLACEMENT
    transX1transY1VARIABLE_NAME_MISMATCH
    itemVisible && !Double.isNaN(transX1) && !Double.isNaN(transY1)!Double.isNaN(transX1) && !Double.isNaN(transY1)INFIX_EXTENDED_OPERAND_NUMBER_MISMATCH
    8
    if (!Double.isNaN(transX1) && !Double.isNaN(transY1))
    27
    float x = (float)transX1;
    9
    float x = (float)transX1;
    28
    float y = (float)transY1;
    10
    float y = (float)transY1;
                                                                                                                
    11
    PlotOrientation orientation = plot.getOrientation();
    29
    if (orientation == PlotOrientation.HORIZONTAL)
    12
    if (orientation == PlotOrientation.HORIZONTAL)
    30
    x = (float)transY1;
    13
    x = (float)transY1;
    31
    y = (float)transX1;
    14
    y = (float)transX1;
    32
    if (s.isLastPointGood())
    32
    if (s.isLastPointGood())
    15
    if (s.isLastPointGood())
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.xy.StandardXYItemRenderer.Stateorg.jfree.chart.renderer.xy.XYLineAndShapeRenderer.StateSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression s cannot be unified with expression s , because common superclass org.jfree.chart.renderer.xy.XYItemRendererState does not declare member(s) public boolean isLastPointGood()
    15
    if (s.isLastPointGood())
    33
    s.seriesPath.lineTo(x, y);
    33
    s.seriesPath.lineTo(x, y);
    16
    s.seriesPath.lineTo(x, y);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.xy.StandardXYItemRenderer.Stateorg.jfree.chart.renderer.xy.XYLineAndShapeRenderer.StateSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression s.seriesPath cannot be unified with expression s.seriesPath , because common superclass org.jfree.chart.renderer.xy.XYItemRendererState does not declare member(s) public java.awt.geom.GeneralPath seriesPath
    16
    s.seriesPath.lineTo(x, y);
    else
    else
    34
    s.seriesPath.moveTo(x, y);
    34
    s.seriesPath.moveTo(x, y);
    17
    s.seriesPath.moveTo(x, y);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.xy.StandardXYItemRenderer.Stateorg.jfree.chart.renderer.xy.XYLineAndShapeRenderer.StateSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression s.seriesPath cannot be unified with expression s.seriesPath , because common superclass org.jfree.chart.renderer.xy.XYItemRendererState does not declare member(s) public java.awt.geom.GeneralPath seriesPath
    17
    s.seriesPath.moveTo(x, y);
    35
    s.setLastPointGood(true);
    35
    s.setLastPointGood(true);
    18
    s.setLastPointGood(true);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.xy.StandardXYItemRenderer.Stateorg.jfree.chart.renderer.xy.XYLineAndShapeRenderer.StateSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression s cannot be unified with expression s , because common superclass org.jfree.chart.renderer.xy.XYItemRendererState does not declare member(s) public void setLastPointGood(boolean)
    18
    s.setLastPointGood(true);
    else
    else
    36
    s.setLastPointGood(false);
    36
    s.setLastPointGood(false);
    19
    s.setLastPointGood(false);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.xy.StandardXYItemRenderer.Stateorg.jfree.chart.renderer.xy.XYLineAndShapeRenderer.StateSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression s cannot be unified with expression s , because common superclass org.jfree.chart.renderer.xy.XYItemRendererState does not declare member(s) public void setLastPointGood(boolean)
    19
    s.setLastPointGood(false);
    Precondition Violations (5)
    Row Violation
    1Expression s cannot be unified with expression s , because common superclass org.jfree.chart.renderer.xy.XYItemRendererState does not declare member(s) public boolean isLastPointGood()
    2Expression s.seriesPath cannot be unified with expression s.seriesPath , because common superclass org.jfree.chart.renderer.xy.XYItemRendererState does not declare member(s) public java.awt.geom.GeneralPath seriesPath
    3Expression s.seriesPath cannot be unified with expression s.seriesPath , because common superclass org.jfree.chart.renderer.xy.XYItemRendererState does not declare member(s) public java.awt.geom.GeneralPath seriesPath
    4Expression s cannot be unified with expression s , because common superclass org.jfree.chart.renderer.xy.XYItemRendererState does not declare member(s) public void setLastPointGood(boolean)
    5Expression s cannot be unified with expression s , because common superclass org.jfree.chart.renderer.xy.XYItemRendererState does not declare member(s) public void setLastPointGood(boolean)