443-1-2

return new CategoryLabelPositions( new CategoryLabelPosition( RectangleAnchor.BOTTOM, TextBlockAnchor.BOTTOM_LEFT, TextAnchor.BOTTOM_LEFT, -angle, CategoryLabelWidthType.RANGE, 0.50f ), // TOP new CategoryLabelPosition( RectangleAnchor.TOP, TextBlockAnchor.TOP_RIGHT, TextAnchor.TOP_RIGHT, -angle, CategoryLabelWidthType.RANGE, 0.50f ), // BOTTOM new CategoryLabelPosition( RectangleAnchor.RIGHT, TextBlockAnchor.BOTTOM_RIGHT, TextAnchor.BOTTOM_RIGHT, -angle, CategoryLabelWidthType.RANGE, 0.50f ), // LEFT new CategoryLabelPosition( RectangleAnchor.LEFT, TextBlockAnchor.TOP_LEFT, TextAnchor.TOP_LEFT, -angle, CategoryLabelWidthType.RANGE, 0.50f ) // RIGHT );
return new CategoryLabelPositions( new CategoryLabelPosition( RectangleAnchor.BOTTOM, TextBlockAnchor.BOTTOM_RIGHT, TextAnchor.BOTTOM_RIGHT, angle, CategoryLabelWidthType.RANGE, 0.50f ), // TOP new CategoryLabelPosition( RectangleAnchor.TOP, TextBlockAnchor.TOP_LEFT, TextAnchor.TOP_LEFT, angle, CategoryLabelWidthType.RANGE, 0.50f ), // BOTTOM new CategoryLabelPosition( RectangleAnchor.RIGHT, TextBlockAnchor.TOP_RIGHT, TextAnchor.TOP_RIGHT, angle, CategoryLabelWidthType.RANGE, 0.50f ), // LEFT new CategoryLabelPosition( RectangleAnchor.LEFT, TextBlockAnchor.BOTTOM_LEFT, TextAnchor.BOTTOM_LEFT, angle, CategoryLabelWidthType.RANGE, 0.50f ) // RIGHT );

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CategoryLabelPositions.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CategoryLabelPositions.java
Method name: `CategoryLabelPositions createUpRotationLabelPositions(double)` |  | Method name: `CategoryLabelPositions createDownRotationLabelPositions(double)`
Number of AST nodes: 1 |  | Number of AST nodes: 1

1

    return new CategoryLabelPositions(↵

1

    return new CategoryLabelPositions(↵

2

                new CategoryLabelPosition(↵

2

                new CategoryLabelPosition(↵

3

                    RectangleAnchor.BOTTOM, TextBlockAnchor.BOTTOM_LEFT, ↵

3

                    RectangleAnchor.BOTTOM, TextBlockAnchor.BOTTOM_RIGHT, ↵

4

                    TextAnchor.BOTTOM_LEFT, -angle,↵

4

                    TextAnchor.BOTTOM_RIGHT, angle,↵

5

                    CategoryLabelWidthType.RANGE, 0.50f↵

5

                    CategoryLabelWidthType.RANGE, 0.50f↵

6

                ), // TOP↵

6

                ), // TOP↵

7

                new CategoryLabelPosition(↵

7

                new CategoryLabelPosition(↵

8

                    RectangleAnchor.TOP, TextBlockAnchor.TOP_RIGHT, ↵

8

                    RectangleAnchor.TOP, TextBlockAnchor.TOP_LEFT, ↵

9

                    TextAnchor.TOP_RIGHT, -angle,↵

9

                    TextAnchor.TOP_LEFT, angle,↵

10

                    CategoryLabelWidthType.RANGE, 0.50f↵

10

                    CategoryLabelWidthType.RANGE, 0.50f↵

11

                ), // BOTTOM↵

11

                ), // BOTTOM↵

12

                new CategoryLabelPosition(↵

12

                new CategoryLabelPosition(↵

13

                    RectangleAnchor.RIGHT, TextBlockAnchor.BOTTOM_RIGHT, ↵

13

                    RectangleAnchor.RIGHT, TextBlockAnchor.TOP_RIGHT, ↵

14

                    TextAnchor.BOTTOM_RIGHT, -angle,↵

14

                    TextAnchor.TOP_RIGHT, angle,↵

15

                    CategoryLabelWidthType.RANGE, 0.50f↵

15

                    CategoryLabelWidthType.RANGE, 0.50f↵

16

                ), // LEFT↵

16

                ), // LEFT↵

17

                new CategoryLabelPosition(↵

17

                new CategoryLabelPosition(↵

18

                    RectangleAnchor.LEFT, TextBlockAnchor.TOP_LEFT, ↵

18

                    RectangleAnchor.LEFT, TextBlockAnchor.BOTTOM_LEFT, ↵

19

                    TextAnchor.TOP_LEFT, -angle,↵

19

                    TextAnchor.BOTTOM_LEFT, angle,↵

20

                    CategoryLabelWidthType.RANGE, 0.50f↵

20

                    CategoryLabelWidthType.RANGE, 0.50f↵

21

                ) // RIGHT↵

21

                ) // RIGHT↵

22

            );

22

            );

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

1. {Refactorable}

   Mapping Summary
   Number of mapped statements | 1
   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
   --- | --- | --- | --- | ---

   1

       return new CategoryLabelPositions(new CategoryLabelPosition(RectangleAnchor.BOTTOM, TextBlockAnchor.BOTTOM_LEFT, TextAnchor.BOTTOM_LEFT, -angle, CategoryLabelWidthType.RANGE, 0.50f), new CategoryLabelPosition(RectangleAnchor.TOP, TextBlockAnchor.TOP_RIGHT, TextAnchor.TOP_RIGHT, -angle, CategoryLabelWidthType.RANGE, 0.50f), new CategoryLabelPosition(RectangleAnchor.RIGHT, TextBlockAnchor.BOTTOM_RIGHT, TextAnchor.BOTTOM_RIGHT, -angle, CategoryLabelWidthType.RANGE, 0.50f), new CategoryLabelPosition(RectangleAnchor.LEFT, TextBlockAnchor.TOP_LEFT, TextAnchor.TOP_LEFT, -angle, CategoryLabelWidthType.RANGE, 0.50f));

   1 | return new CategoryLabelPositions(new CategoryLabelPosition(RectangleAnchor.BOTTOM, TextBlockAnchor.BOTTOM_LEFT, TextAnchor.BOTTOM_LEFT, -angle, CategoryLabelWidthType.RANGE, 0.50f), new CategoryLabelPosition(RectangleAnchor.TOP, TextBlockAnchor.TOP_RIGHT, TextAnchor.TOP_RIGHT, -angle, CategoryLabelWidthType.RANGE, 0.50f), new CategoryLabelPosition(RectangleAnchor.RIGHT, TextBlockAnchor.BOTTOM_RIGHT, TextAnchor.BOTTOM_RIGHT, -angle, CategoryLabelWidthType.RANGE, 0.50f), new CategoryLabelPosition(RectangleAnchor.LEFT, TextBlockAnchor.TOP_LEFT, TextAnchor.TOP_LEFT, -angle, CategoryLabelWidthType.RANGE, 0.50f));
   1 | return new CategoryLabelPositions(new CategoryLabelPosition(RectangleAnchor.BOTTOM, TextBlockAnchor.BOTTOM_RIGHT, TextAnchor.BOTTOM_RIGHT, angle, CategoryLabelWidthType.RANGE, 0.50f), new CategoryLabelPosition(RectangleAnchor.TOP, TextBlockAnchor.TOP_LEFT, TextAnchor.TOP_LEFT, angle, CategoryLabelWidthType.RANGE, 0.50f), new CategoryLabelPosition(RectangleAnchor.RIGHT, TextBlockAnchor.TOP_RIGHT, TextAnchor.TOP_RIGHT, angle, CategoryLabelWidthType.RANGE, 0.50f), new CategoryLabelPosition(RectangleAnchor.LEFT, TextBlockAnchor.BOTTOM_LEFT, TextAnchor.BOTTOM_LEFT, angle, CategoryLabelWidthType.RANGE, 0.50f));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   BOTTOM_LEFT | BOTTOM_RIGHT | VARIABLE_NAME_MISMATCH
   BOTTOM_LEFT | BOTTOM_RIGHT | VARIABLE_NAME_MISMATCH
   -angle | angle | TYPE_COMPATIBLE_REPLACEMENT
   TOP_RIGHT | TOP_LEFT | VARIABLE_NAME_MISMATCH
   TOP_RIGHT | TOP_LEFT | VARIABLE_NAME_MISMATCH
   -angle | angle | TYPE_COMPATIBLE_REPLACEMENT
   BOTTOM_RIGHT | TOP_RIGHT | VARIABLE_NAME_MISMATCH
   BOTTOM_RIGHT | TOP_RIGHT | VARIABLE_NAME_MISMATCH
   -angle | angle | TYPE_COMPATIBLE_REPLACEMENT
   TOP_LEFT | BOTTOM_LEFT | VARIABLE_NAME_MISMATCH
   TOP_LEFT | BOTTOM_LEFT | VARIABLE_NAME_MISMATCH
   -angle | angle | TYPE_COMPATIBLE_REPLACEMENT

   1

       return new CategoryLabelPositions(new CategoryLabelPosition(RectangleAnchor.BOTTOM, TextBlockAnchor.BOTTOM_RIGHT, TextAnchor.BOTTOM_RIGHT, angle, CategoryLabelWidthType.RANGE, 0.50f), new CategoryLabelPosition(RectangleAnchor.TOP, TextBlockAnchor.TOP_LEFT, TextAnchor.TOP_LEFT, angle, CategoryLabelWidthType.RANGE, 0.50f), new CategoryLabelPosition(RectangleAnchor.RIGHT, TextBlockAnchor.TOP_RIGHT, TextAnchor.TOP_RIGHT, angle, CategoryLabelWidthType.RANGE, 0.50f), new CategoryLabelPosition(RectangleAnchor.LEFT, TextBlockAnchor.BOTTOM_LEFT, TextAnchor.BOTTOM_LEFT, angle, CategoryLabelWidthType.RANGE, 0.50f));

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