1379-1-2

if (plot.getOrientation() == PlotOrientation.VERTICAL) { completeBar = new Rectangle2D.Double(rectStart + start * rectBreadth, translatedValue0 + rectLength * (1 - p), rectBreadth * (end - start), rectLength * p); incompleteBar = new Rectangle2D.Double(rectStart + start * rectBreadth, translatedValue0, rectBreadth * (end - start), rectLength * (1 - p)); }
if (plot.getOrientation() == PlotOrientation.VERTICAL) { completeBar = new Rectangle2D.Double(rectStart + start * rectBreadth, java2dValue1 + rectLength * (1 - p), rectBreadth * (end - start), rectLength * p); incompleteBar = new Rectangle2D.Double(rectStart + start * rectBreadth, java2dValue1, rectBreadth * (end - start), rectLength * (1 - p)); }

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/category/GanttRenderer.java
Method name: `void drawTasks(Graphics2D, CategoryItemRendererState, Rectangle2D, CategoryPlot, CategoryAxis, ValueAxis, GanttCategoryDataset, int, int)` |  | Method name: `void drawTask(Graphics2D, CategoryItemRendererState, Rectangle2D, CategoryPlot, CategoryAxis, ValueAxis, GanttCategoryDataset, int, int)`
Number of AST nodes: 3 |  | Number of AST nodes: 3

1

    if (plot.getOrientation() == PlotOrientation.VERTICAL) {↵

1

    if (plot.getOrientation() == PlotOrientation.VERTICAL) {↵

2

                        completeBar = new Rectangle2D.Double(rectStart + start↵

2

                    completeBar = new Rectangle2D.Double(rectStart + start↵

3

                                * rectBreadth, translatedValue0 + rectLength↵

3

                            * rectBreadth, java2dValue1 + rectLength↵

4

         ↵

4

     * (1 - p),↵

5

                           * (1 - p), rectBreadth * (end - start),↵

5

                            rectBreadth * (end - start),↵

6

                                rectLength * p);↵

6

     rectLength * p);↵

7

                        incompleteBar = new Rectangle2D.Double(rectStart + start↵

7

                    incompleteBar = new Rectangle2D.Double(rectStart + start↵

8

                                * rectBreadth, translatedValue0, rectBreadth↵

8

                            * rectBreadth, java2dValue1, rectBreadth↵

9

         ↵

9

     * (end↵

10

                           * (end - start), rectLength * (1 - p));↵

10

                            - start), rectLength * (1 - p));↵

11

                    }

11

                }

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 0
Number of non-refactorable cases | 1
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2
Clones location | Clones are declared in the same class
Number of node comparisons | 10

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 3
   Number of unmapped statements in the first code fragment | 0
   Number of unmapped statements in the second code fragment | 0
   Time elapsed for statement mapping (ms) | 2.0
   Clone type | Type 2

   Mapped Statements
   ID | Statement |  | ID | Statement
   --- | --- | --- | --- | ---

   36

       else if (plot.getOrientation() == PlotOrientation.VERTICAL)

   36

       else if (plot.getOrientation() == PlotOrientation.VERTICAL)

   37

       completeBar = new Rectangle2D.Double(rectStart + start * rectBreadth, translatedValue0 + rectLength * (1 - p), rectBreadth * (end - start), rectLength * p);

   37 | completeBar = new Rectangle2D.Double(rectStart + start * rectBreadth, translatedValue0 + rectLength * (1 - p), rectBreadth * (end - start), rectLength * p);
   37 | completeBar = new Rectangle2D.Double(rectStart + start * rectBreadth, java2dValue1 + rectLength * (1 - p), rectBreadth * (end - start), rectLength * p);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   translatedValue0 | java2dValue1 | VARIABLE_NAME_MISMATCH

   37

       completeBar = new Rectangle2D.Double(rectStart + start * rectBreadth, java2dValue1 + rectLength * (1 - p), rectBreadth * (end - start), rectLength * p);

   38

       incompleteBar = new Rectangle2D.Double(rectStart + start * rectBreadth, translatedValue0, rectBreadth * (end - start), rectLength * (1 - p));

   38 | incompleteBar = new Rectangle2D.Double(rectStart + start * rectBreadth, translatedValue0, rectBreadth * (end - start), rectLength * (1 - p));
   38 | incompleteBar = new Rectangle2D.Double(rectStart + start * rectBreadth, java2dValue1, rectBreadth * (end - start), rectLength * (1 - p));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   translatedValue0 | java2dValue1 | VARIABLE_NAME_MISMATCH

   38

       incompleteBar = new Rectangle2D.Double(rectStart + start * rectBreadth, java2dValue1, rectBreadth * (end - start), rectLength * (1 - p));

   Precondition Violations (1)
   Row | Violation
   --- | ---
   1 | Clone fragment #1 returns variables completeBar, incompleteBar , while Clone fragment #2 returns variables completeBar, incompleteBar