if (plot.getOrientation() == PlotOrientation.HORIZONTAL) { bar = new Rectangle2D.Double(translatedValue0, rectStart, rectLength, rectBreadth); } else if (plot.getOrientation() == PlotOrientation.VERTICAL) { bar = new Rectangle2D.Double(rectStart, translatedValue0, rectBreadth, rectLength); }
if (orientation == PlotOrientation.HORIZONTAL) { g2.draw(new Line2D.Double(yy0, xx0, yy, xx)); } else if (orientation == PlotOrientation.VERTICAL) { g2.draw(new Line2D.Double(xx0, yy0, xx, yy)); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/GanttRenderer.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/HighLowRenderer.java
Method name: void drawTasks(Graphics2D, CategoryItemRendererState, Rectangle2D, CategoryPlot, CategoryAxis, ValueAxis, GanttCategoryDataset, int, int) Method name: void drawItem(Graphics2D, XYItemRendererState, Rectangle2D, PlotRenderingInfo, XYPlot, ValueAxis, ValueAxis, XYDataset, int, int, CrosshairState, int)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (plot.getOrientation() == PlotOrientation.HORIZONTAL) {
1
if (orientation == PlotOrientation.HORIZONTAL) {
2
                bar = new Rectangle2D.Double(translatedValue0, rectStart,
2
                
3
                        rectLength, rectBreadth);
4
            }
3
    g2.draw(new Line2D.Double(yy0, xx0, yy, xx));
4
                }
5
            else if (plot.getOrientation() == PlotOrientation.VERTICAL) {
5
                else if (orientation == PlotOrientation.VERTICAL) {
6
                bar = new Rectangle2D.Double(rectStart, translatedValue0,
6
                
7
                        rectBreadth, rectLength);
7
    g2.draw(new Line2D.Double(xx0, yy0, xx, yy));
8
            }
8
                }
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 comparisons14
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)78.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    22
    if (plot.getOrientation() == PlotOrientation.HORIZONTAL)
    22
    if (plot.getOrientation() == PlotOrientation.HORIZONTAL)
    62
    if (orientation == PlotOrientation.HORIZONTAL)
    Differences
    Expression1Expression2Difference
    plot.getOrientation()orientationTYPE_COMPATIBLE_REPLACEMENT
    62
    if (orientation == PlotOrientation.HORIZONTAL)
    23
    bar = new Rectangle2D.Double(translatedValue0, rectStart, rectLength, rectBreadth);
    23
    bar = new Rectangle2D.Double(translatedValue0, rectStart, rectLength, rectBreadth);
    Preondition Violations
    Unmatched statement bar=new Rectangle2D.Double(translatedValue0,rectStart,rectLength,rectBreadth); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                                                        
                                                                                                
    63
    g2.draw(new Line2D.Double(yy0, xx0, yy, xx));
    24
    else if (plot.getOrientation() == PlotOrientation.VERTICAL)
    24
    else if (plot.getOrientation() == PlotOrientation.VERTICAL)
    64
    else if (orientation == PlotOrientation.VERTICAL)
    Differences
    Expression1Expression2Difference
    plot.getOrientation()orientationTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression plot.getOrientation() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    64
    else if (orientation == PlotOrientation.VERTICAL)
    25
    bar = new Rectangle2D.Double(rectStart, translatedValue0, rectBreadth, rectLength);
    25
    bar = new Rectangle2D.Double(rectStart, translatedValue0, rectBreadth, rectLength);
    Preondition Violations
    Unmatched statement bar=new Rectangle2D.Double(rectStart,translatedValue0,rectBreadth,rectLength); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                                                        
                                                                                                
    65
    g2.draw(new Line2D.Double(xx0, yy0, xx, yy));
    Precondition Violations (3)
    Row Violation
    1Unmatched statement bar=new Rectangle2D.Double(translatedValue0,rectStart,rectLength,rectBreadth); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Expression plot.getOrientation() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Unmatched statement bar=new Rectangle2D.Double(rectStart,translatedValue0,rectBreadth,rectLength); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted