318-1-2

anchor = TextAnchor.BOTTOM_CENTER; if ((lastTick != null) && (lastY == y) && (currentTickValue != cycleBound)) { anchor = isInverted() ? TextAnchor.BOTTOM_LEFT : TextAnchor.BOTTOM_RIGHT; result.remove(result.size() - 1); result.add(new CycleBoundTick( this.boundMappedToLastCycle, lastTick.getNumber(), lastTick.getText(), anchor, anchor, lastTick.getAngle()) ); this.internalMarkerWhenTicksOverlap = true; anchor = isInverted() ? TextAnchor.BOTTOM_RIGHT : TextAnchor.BOTTOM_LEFT; } rotationAnchor = anchor; angle = -Math.PI / 2.0;
anchor = TextAnchor.BOTTOM_CENTER; if ((lastTick != null) && (lastY == y) && (currentTickValue != cycleBound)) { anchor = isInverted() ? TextAnchor.BOTTOM_RIGHT : TextAnchor.BOTTOM_LEFT; result.remove(result.size() - 1); result.add(new CycleBoundTick( this.boundMappedToLastCycle, lastTick.getNumber(), lastTick.getText(), anchor, anchor, lastTick.getAngle()) ); this.internalMarkerWhenTicksOverlap = true; anchor = isInverted() ? TextAnchor.BOTTOM_LEFT : TextAnchor.BOTTOM_RIGHT; } rotationAnchor = anchor; angle = Math.PI / 2.0;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CyclicNumberAxis.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CyclicNumberAxis.java
Method name: `List refreshVerticalTicks(Graphics2D, Rectangle2D, RectangleEdge)` |  | Method name: `List refreshVerticalTicks(Graphics2D, Rectangle2D, RectangleEdge)`
Number of AST nodes: 9 |  | Number of AST nodes: 9

1

    anchor = TextAnchor.BOTTOM_CENTER; ↵

1

    anchor = TextAnchor.BOTTOM_CENTER; ↵

2

                        if ((lastTick != null) && (lastY == y) ↵

2

                        if ((lastTick != null) && (lastY == y) ↵

3

                                && (currentTickValue != cycleBound)) {↵

3

                                && (currentTickValue != cycleBound)) {↵

4

                            anchor = isInverted() ↵

4

                            anchor = isInverted() ↵

5

                                ? TextAnchor.BOTTOM_LEFT : TextAnchor.BOTTOM_RIGHT;↵

5

                                ? TextAnchor.BOTTOM_RIGHT : TextAnchor.BOTTOM_LEFT;↵

6

                            result.remove(result.size() - 1);↵

6

                            result.remove(result.size() - 1);↵

7

                            result.add(new CycleBoundTick(↵

7

                            result.add(new CycleBoundTick(↵

8

                                this.boundMappedToLastCycle, lastTick.getNumber(),↵

8

                                this.boundMappedToLastCycle, lastTick.getNumber(),↵

9

                                lastTick.getText(), anchor, anchor, ↵

9

                                lastTick.getText(), anchor, anchor, ↵

10

                                lastTick.getAngle())↵

10

                                lastTick.getAngle())↵

11

                            );↵

11

                            );↵

12

                            this.internalMarkerWhenTicksOverlap = true;↵

12

                            this.internalMarkerWhenTicksOverlap = true;↵

13

                            anchor = isInverted() ↵

13

                            anchor = isInverted() ↵

14

                                ? TextAnchor.BOTTOM_RIGHT : TextAnchor.BOTTOM_LEFT;↵

14

                                ? TextAnchor.BOTTOM_LEFT : TextAnchor.BOTTOM_RIGHT;↵

15

                        }↵

15

                        }↵

16

                        rotationAnchor = anchor;↵

16

                        rotationAnchor = anchor;↵

17

                        angle = -Math.PI / 2.0;

17

                        angle = Math.PI / 2.0;

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

1. {Non-refactorable}

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

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

   36

       anchor = TextAnchor.BOTTOM_CENTER;

   45

       anchor = TextAnchor.BOTTOM_CENTER;

   37

       if ((lastTick != null) && (lastY == y) && (currentTickValue != cycleBound))

   46

       if ((lastTick != null) && (lastY == y) && (currentTickValue != cycleBound))

   38

       anchor = isInverted() ? TextAnchor.BOTTOM_LEFT : TextAnchor.BOTTOM_RIGHT;

   38 | anchor = isInverted() ? TextAnchor.BOTTOM_LEFT : TextAnchor.BOTTOM_RIGHT;
   47 | anchor = isInverted() ? TextAnchor.BOTTOM_RIGHT : TextAnchor.BOTTOM_LEFT;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   BOTTOM_LEFT | BOTTOM_RIGHT | VARIABLE_NAME_MISMATCH
   BOTTOM_RIGHT | BOTTOM_LEFT | VARIABLE_NAME_MISMATCH

   47

       anchor = isInverted() ? TextAnchor.BOTTOM_RIGHT : TextAnchor.BOTTOM_LEFT;

   39

       result.remove(result.size() - 1);

   48

       result.remove(result.size() - 1);

   40

       result.add(new CycleBoundTick(this.boundMappedToLastCycle, lastTick.getNumber(), lastTick.getText(), anchor, anchor, lastTick.getAngle()));

   49

       result.add(new CycleBoundTick(this.boundMappedToLastCycle, lastTick.getNumber(), lastTick.getText(), anchor, anchor, lastTick.getAngle()));

   41

       this.internalMarkerWhenTicksOverlap = true;

   50

       this.internalMarkerWhenTicksOverlap = true;

   42

       anchor = isInverted() ? TextAnchor.BOTTOM_RIGHT : TextAnchor.BOTTOM_LEFT;

   42 | anchor = isInverted() ? TextAnchor.BOTTOM_RIGHT : TextAnchor.BOTTOM_LEFT;
   51 | anchor = isInverted() ? TextAnchor.BOTTOM_LEFT : TextAnchor.BOTTOM_RIGHT;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   BOTTOM_RIGHT | BOTTOM_LEFT | VARIABLE_NAME_MISMATCH
   BOTTOM_LEFT | BOTTOM_RIGHT | VARIABLE_NAME_MISMATCH

   51

       anchor = isInverted() ? TextAnchor.BOTTOM_LEFT : TextAnchor.BOTTOM_RIGHT;

   43

       rotationAnchor = anchor;

   52

       rotationAnchor = anchor;

   44

       angle = -Math.PI / 2.0;

   44 | angle = -Math.PI / 2.0;
   53 | angle = Math.PI / 2.0;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   -Math.PI | Math.PI | TYPE_COMPATIBLE_REPLACEMENT

   53

       angle = Math.PI / 2.0;

   Precondition Violations (1)
   Row | Violation
   --- | ---
   1 | Clone fragment #1 returns variables anchor, rotationAnchor, angle , while Clone fragment #2 returns variables anchor, rotationAnchor, angle