1367-1-3

double v = base + (i * increment); Paint p = this.scale.getPaint(v); double vv = this.axis.valueToJava2D(v, target, RectangleEdge.BOTTOM); r.setRect(vv, target.getMaxY() - this.stripWidth, ww, this.stripWidth); g2.setPaint(p); g2.fill(r);
double v = base + (i * increment); Paint p = this.scale.getPaint(v); double vv = this.axis.valueToJava2D(v, target, RectangleEdge.LEFT); r.setRect(target.getMaxX() - this.stripWidth, vv - hh, this.stripWidth, hh); g2.setPaint(p); g2.fill(r);

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/title/PaintScaleLegend.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/title/PaintScaleLegend.java
Method name: `Object draw(Graphics2D, Rectangle2D, Object)` |  | Method name: `Object draw(Graphics2D, Rectangle2D, Object)`
Number of AST nodes: 6 |  | Number of AST nodes: 6

1

    double v = base + (i * increment);↵

1

    double v = base + (i * increment);↵

2

                        Paint p = this.scale.getPaint(v);↵

2

                        Paint p = this.scale.getPaint(v);↵

3

                        double vv = this.axis.valueToJava2D(v, target, ↵

3

                        double vv = this.axis.valueToJava2D(v, target, ↵

4

                                RectangleEdge.BOTTOM);↵

4

                                RectangleEdge.LEFT);↵

5

                        r.setRect(vv, target.getMaxY() - this.stripWidth, ww, ↵

5

                        r.setRect(target.getMaxX() - this.stripWidth, vv - hh, ↵

6

                                this.stripWidth);↵

6

                                this.stripWidth, hh);↵

7

                        g2.setPaint(p);↵

7

                        g2.setPaint(p);↵

8

                        g2.fill(r);

8

                        g2.fill(r);

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.0
Clones location | Clones are in the same method
Number of node comparisons | 37

1. {Non-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) | 0.0
   Clone type | Type 2

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

   17

       double v = base + (i * increment);

   43

       double v = base + (i * increment);

   18

       Paint p = this.scale.getPaint(v);

   44

       Paint p = this.scale.getPaint(v);

   19

       double vv = this.axis.valueToJava2D(v, target, RectangleEdge.BOTTOM);

   19 | double vv = this.axis.valueToJava2D(v, target, RectangleEdge.BOTTOM);
   45 | double vv = this.axis.valueToJava2D(v, target, RectangleEdge.LEFT);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   BOTTOM | LEFT | VARIABLE_NAME_MISMATCH

   45

       double vv = this.axis.valueToJava2D(v, target, RectangleEdge.LEFT);

   20

       r.setRect(vv, target.getMaxY() - this.stripWidth, ww, this.stripWidth);

   20 | r.setRect(vv, target.getMaxY() - this.stripWidth, ww, this.stripWidth);
   46 | r.setRect(target.getMaxX() - this.stripWidth, vv - hh, this.stripWidth, hh);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   vv | target.getMaxX() - this.stripWidth | TYPE_COMPATIBLE_REPLACEMENT
   target.getMaxY() | vv | TYPE_COMPATIBLE_REPLACEMENT
   this.stripWidth | hh | TYPE_COMPATIBLE_REPLACEMENT
   ww | this.stripWidth | TYPE_COMPATIBLE_REPLACEMENT
   this.stripWidth | hh | TYPE_COMPATIBLE_REPLACEMENT

   Preondition Violations
   Expression vv cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression vv cannot be parameterized, because it has dependencies to/from statements that will be extracted

   46

       r.setRect(target.getMaxX() - this.stripWidth, vv - hh, this.stripWidth, hh);

   21

       g2.setPaint(p);

   47

       g2.setPaint(p);

   22

       g2.fill(r);

   48

       g2.fill(r);

   Precondition Violations (2)
   Row | Violation
   --- | ---
   1 | Expression vv cannot be parameterized, because it has dependencies to/from statements that will be extracted
   2 | Expression vv cannot be parameterized, because it has dependencies to/from statements that will be extracted