1479-2-3

if (range.contains(value)) { double x = midX + getColumnRadius() + 2; double y = this.rangeAxis.valueToJava2D(value, dataArea, RectangleEdge.LEFT); Line2D line = new Line2D.Double(x, y, x + 10, y); g2.setPaint(this.subrangePaint[WARNING]); g2.draw(line); }
if (range.contains(value)) { double x = midX + getColumnRadius() + 2; double y = this.rangeAxis.valueToJava2D(value, dataArea, RectangleEdge.LEFT); Line2D line = new Line2D.Double(x, y, x + 10, y); g2.setPaint(this.subrangePaint[CRITICAL]); g2.draw(line); }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/ThermometerPlot.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/ThermometerPlot.java
Method name: `void draw(Graphics2D, Rectangle2D, Point2D, PlotState, PlotRenderingInfo)` |  | Method name: `void draw(Graphics2D, Rectangle2D, Point2D, PlotState, PlotRenderingInfo)`
Number of AST nodes: 6 |  | Number of AST nodes: 6

1

    if (range.contains(value)) {↵

1

    if (range.contains(value)) {↵

2

                        double x = midX + getColumnRadius() + 2;↵

2

                        double x = midX + getColumnRadius() + 2;↵

3

                        double y = this.rangeAxis.valueToJava2D(value, dataArea, ↵

3

                        double y = this.rangeAxis.valueToJava2D(value, dataArea, ↵

4

                                RectangleEdge.LEFT);↵

4

                                RectangleEdge.LEFT);↵

5

                        Line2D line = new Line2D.Double(x, y, x + 10, y);↵

5

                        Line2D line = new Line2D.Double(x, y, x + 10, y);↵

6

                        g2.setPaint(this.subrangePaint[WARNING]);↵

6

                        g2.setPaint(this.subrangePaint[CRITICAL]);↵

7

                        g2.draw(line);↵

7

                        g2.draw(line);↵

8

                    }

8

                    }

See real code fragment |  | See real code fragment

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

1. {Refactorable}

   Mapping Summary
   Number of mapped statements | 6
   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) | 24.0
   Clone type | Type 2

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

   58

       if (range.contains(value))

   65

       if (range.contains(value))

   59

       double x = midX + getColumnRadius() + 2;

   66

       double x = midX + getColumnRadius() + 2;

   60

       double y = this.rangeAxis.valueToJava2D(value, dataArea, RectangleEdge.LEFT);

   67

       double y = this.rangeAxis.valueToJava2D(value, dataArea, RectangleEdge.LEFT);

   61

       Line2D line = new Line2D.Double(x, y, x + 10, y);

   68

       Line2D line = new Line2D.Double(x, y, x + 10, y);

   62

       g2.setPaint(this.subrangePaint[WARNING]);

   62 | g2.setPaint(this.subrangePaint[WARNING]);
   69 | g2.setPaint(this.subrangePaint[CRITICAL]);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   WARNING | CRITICAL | VARIABLE_NAME_MISMATCH

   69

       g2.setPaint(this.subrangePaint[CRITICAL]);

   63

       g2.draw(line);

   70

       g2.draw(line);

   Precondition Violations (0)
   Row | Violation
   --- | ---