Tick tick = (Tick) iterator.next(); Rectangle2D labelBounds = TextUtilities.getTextBounds( tick.getText(), g2, fm); if (labelBounds.getWidth() + insets.getTop() + insets.getBottom() > maxHeight) { maxHeight = labelBounds.getWidth() + insets.getTop() + insets.getBottom(); }
Tick tick = (Tick) iterator.next(); Rectangle2D labelBounds = TextUtilities.getTextBounds( tick.getText(), g2, fm); if (labelBounds.getWidth() + insets.getLeft() + insets.getRight() > maxWidth) { maxWidth = labelBounds.getWidth() + insets.getLeft() + insets.getRight(); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/ValueAxis.java File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/ValueAxis.java
Method name: double findMaximumTickLabelHeight(List, Graphics2D, Rectangle2D, boolean) Method name: double findMaximumTickLabelWidth(List, Graphics2D, Rectangle2D, boolean)
Number of AST nodes: 4 Number of AST nodes: 4
1
Tick tick = (Tick) iterator.next();
1
Tick tick = (Tick) iterator.next();
2
                Rectangle2D labelBounds = TextUtilities.getTextBounds(
2
                Rectangle2D labelBounds = TextUtilities.getTextBounds(
3
                        tick.getText(), g2, fm);
3
                        tick.getText(), g2, fm);
4
                if (labelBounds.getWidth() + insets.getTop()
4
                if (labelBounds.getWidth() + insets.getLeft()
5
                        + insets.getBottom() > maxHeight) {
5
                        + insets.getRight() > maxWidth) {
6
                    maxHeight = labelBounds.getWidth()
6
                    maxWidth = labelBounds.getWidth()
7
                                + insets.getTop() + insets.getBottom();
7
                               + insets.getLeft() + insets.getRight();
8
                }
8
                }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.4
Clones locationClones are declared in the same class
Number of node comparisons9
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)4.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    8
    Tick tick = (Tick)iterator.next();
    8
    Tick tick = (Tick)iterator.next();
    9
    Rectangle2D labelBounds = TextUtilities.getTextBounds(tick.getText(), g2, fm);
    9
    Rectangle2D labelBounds = TextUtilities.getTextBounds(tick.getText(), g2, fm);
    10
    if (labelBounds.getWidth() + insets.getTop() + insets.getBottom() > maxHeight)
    10
    if (labelBounds.getWidth() + insets.getTop() + insets.getBottom() > maxHeight)
    10
    if (labelBounds.getWidth() + insets.getLeft() + insets.getRight() > maxWidth)
    Differences
    Expression1Expression2Difference
    getBottomgetRightMETHOD_INVOCATION_NAME_MISMATCH
    getTopgetLeftMETHOD_INVOCATION_NAME_MISMATCH
    maxHeightmaxWidthVARIABLE_NAME_MISMATCH
    10
    if (labelBounds.getWidth() + insets.getLeft() + insets.getRight() > maxWidth)
    11
    maxHeight = labelBounds.getWidth() + insets.getTop() + insets.getBottom();
    11
    maxHeight = labelBounds.getWidth() + insets.getTop() + insets.getBottom();
    11
    maxWidth = labelBounds.getWidth() + insets.getLeft() + insets.getRight();
    Differences
    Expression1Expression2Difference
    maxHeightmaxWidthVARIABLE_NAME_MISMATCH
    getBottomgetRightMETHOD_INVOCATION_NAME_MISMATCH
    getTopgetLeftMETHOD_INVOCATION_NAME_MISMATCH
    11
    maxWidth = labelBounds.getWidth() + insets.getLeft() + insets.getRight();
    Precondition Violations (0)
    Row Violation