RectangleInsets insets = getTickLabelInsets();
Size2D size = block.calculateDimensions(g2);
Rectangle2D box = new Rectangle2D.Double(0.0, 0.0, size.getWidth(),
size.getHeight());
Shape rotatedBox = ShapeUtilities.rotateShape(box, position.getAngle(),
0.0f, 0.0f);
double w = rotatedBox.getBounds2D().getWidth() + insets.getLeft()
+ insets.getRight();
return w;
RectangleInsets insets = getTickLabelInsets();
Size2D size = block.calculateDimensions(g2);
Rectangle2D box = new Rectangle2D.Double(0.0, 0.0, size.getWidth(),
size.getHeight());
Shape rotatedBox = ShapeUtilities.rotateShape(box, position.getAngle(),
0.0f, 0.0f);
double h = rotatedBox.getBounds2D().getHeight()
+ insets.getTop() + insets.getBottom();
return h;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CategoryAxis.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CategoryAxis.java
|
Method name: double calculateTextBlockWidth(TextBlock, CategoryLabelPosition, Graphics2D)
|
|
Method name: double calculateTextBlockHeight(TextBlock, CategoryLabelPosition, Graphics2D)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | RectangleInsets insets = getTickLabelInsets();↵ | | 1 | RectangleInsets insets = getTickLabelInsets();↵
|
2 | Size2D size = block.calculateDimensions(g2);↵ | | 2 | Size2D size = block.calculateDimensions(g2);↵
|
3 | Rectangle2D box = new Rectangle2D.Double(0.0, 0.0, size.getWidth(),↵ | | 3 | Rectangle2D box = new Rectangle2D.Double(0.0, 0.0, size.getWidth(),↵
|
4 | size.getHeight());↵ | | 4 | size.getHeight());↵
|
5 | Shape rotatedBox = ShapeUtilities.rotateShape(box, position.getAngle(),↵ | | 5 | Shape rotatedBox = ShapeUtilities.rotateShape(box, position.getAngle(),↵
|
6 | 0.0f, 0.0f);↵ | | 6 | 0.0f, 0.0f);↵
|
7 | double w = rotatedBox.getBounds2D().getWidth() + insets.getLeft()↵ | | 7 | double h = rotatedBox.getBounds2D().getHeight()↵
|
8 | + insets.getRight();↵ | | 8 | + insets.getTop() + insets.getBottom();↵
|
9 | return w; | | 9 | return h;
|
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 | 14 |
-
{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 |
1 | RectangleInsets insets = getTickLabelInsets(); | | 1 | RectangleInsets insets = getTickLabelInsets(); |
2 | Size2D size = block.calculateDimensions(g2); | | 2 | Size2D size = block.calculateDimensions(g2); |
3 | Rectangle2D box = new Rectangle2D.Double(0.0, 0.0, size.getWidth(), size.getHeight()); | | 3 | Rectangle2D box = new Rectangle2D.Double(0.0, 0.0, size.getWidth(), size.getHeight()); |
4 | Shape rotatedBox = ShapeUtilities.rotateShape(box, position.getAngle(), 0.0f, 0.0f); | | 4 | Shape rotatedBox = ShapeUtilities.rotateShape(box, position.getAngle(), 0.0f, 0.0f); |
5 | double w = rotatedBox.getBounds2D().getWidth() + insets.getLeft() + insets.getRight(); | | 5 | double h = rotatedBox.getBounds2D().getHeight() + insets.getTop() + insets.getBottom(); |
6 | return w; | | 6 | return h; |
Precondition Violations (6)
Row |
Violation |
1 | Expression insets.getRight() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression insets.getBottom() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression rotatedBox.getBounds2D().getWidth() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression rotatedBox.getBounds2D().getHeight() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression insets.getLeft() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression insets.getTop() cannot be parameterized, because it has dependencies to/from statements that will be extracted |