Block block = (Block) blocks.get(i); sizes[i] = block.arrange(g2, RectangleConstraint.NONE); height = height + sizes[i].getHeight(); maxWidth = Math.max(sizes[i].width, maxWidth); block.setBounds( new Rectangle2D.Double( 0.0, y, sizes[i].width, sizes[i].height ) ); y = y + sizes[i].height + this.verticalGap;
Block block = (Block) blocks.get(i); sizes[i] = block.arrange(g2, RectangleConstraint.NONE); width = width + sizes[i].getWidth(); maxHeight = Math.max(sizes[i].height, maxHeight); block.setBounds( new Rectangle2D.Double( x, 0.0, sizes[i].width, sizes[i].height ) ); x = x + sizes[i].width + this.horizontalGap;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/block/ColumnArrangement.java File path: /jfreechart-1.0.10/src/org/jfree/chart/block/FlowArrangement.java
Method name: Size2D arrangeNN(BlockContainer, Graphics2D) Method name: Size2D arrangeNN(BlockContainer, Graphics2D)
Number of AST nodes: 6 Number of AST nodes: 6
1
Block block = (Block) blocks.get(i);
1
Block block = (Block) blocks.get(i);
2
                sizes[i] = block.arrange(g2, RectangleConstraint.NONE);
2
                sizes[i] = block.arrange(g2, RectangleConstraint.NONE);
3
                height = height + sizes[i].getHeight();
3
                width = width + sizes[i].getWidth();
4
                maxWidth = Math.max(sizes[i].width, maxWidth);
4
                maxHeight = Math.max(sizes[i].height, maxHeight);
5
                block.setBounds(
5
                block.setBounds(
6
                    new Rectangle2D.Double(
6
                    new Rectangle2D.Double(
7
                        0.0, y, sizes[i].width, sizes[i].height
7
                        x, 0.0, sizes[i].width, sizes[i].height
8
                    )
8
                    )
9
                );
9
                );
10
                y = y + sizes[i].height + this.verticalGap;
10
                x = x + sizes[i].width + this.horizontalGap;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are in different classes
Number of node comparisons21
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    9
    Block block = (Block)blocks.get(i);
    9
    Block block = (Block)blocks.get(i);
    10
    sizes[i] = block.arrange(g2, RectangleConstraint.NONE);
    10
    sizes[i] = block.arrange(g2, RectangleConstraint.NONE);
    11
    height = height + sizes[i].getHeight();
    11
    height = height + sizes[i].getHeight();
    11
    width = width + sizes[i].getWidth();
    Differences
    Expression1Expression2Difference
    heightwidthVARIABLE_NAME_MISMATCH
    heightwidthVARIABLE_NAME_MISMATCH
    getHeightgetWidthMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression sizes[i].getHeight() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression sizes[i].getWidth() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11
    width = width + sizes[i].getWidth();
    12
    maxWidth = Math.max(sizes[i].width, maxWidth);
    12
    maxWidth = Math.max(sizes[i].width, maxWidth);
    14
    x = x + sizes[i].width + this.horizontalGap;
    Differences
    Expression1Expression2Difference
    maxWidthxVARIABLE_NAME_MISMATCH
    Math.max(sizes[i].width,maxWidth)x + sizes[i].width + this.horizontalGapTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression Math.max(sizes[i].width,maxWidth) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression x + sizes[i].width + this.horizontalGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14
    x = x + sizes[i].width + this.horizontalGap;
    13
    block.setBounds(new Rectangle2D.Double(0.0, y, sizes[i].width, sizes[i].height));
    13
    block.setBounds(new Rectangle2D.Double(0.0, y, sizes[i].width, sizes[i].height));
    13
    block.setBounds(new Rectangle2D.Double(x, 0.0, sizes[i].width, sizes[i].height));
    Differences
    Expression1Expression2Difference
    0.0xTYPE_COMPATIBLE_REPLACEMENT
    y0.0TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression x cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression y cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13
    block.setBounds(new Rectangle2D.Double(x, 0.0, sizes[i].width, sizes[i].height));
    14
    y = y + sizes[i].height + this.verticalGap;
    14
    y = y + sizes[i].height + this.verticalGap;
    12
    maxHeight = Math.max(sizes[i].height, maxHeight);
    Differences
    Expression1Expression2Difference
    ymaxHeightVARIABLE_NAME_MISMATCH
    y + sizes[i].height + this.verticalGapMath.max(sizes[i].height,maxHeight)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression y + sizes[i].height + this.verticalGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression Math.max(sizes[i].height,maxHeight) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12
    maxHeight = Math.max(sizes[i].height, maxHeight);
    Precondition Violations (9)
    Row Violation
    1Expression sizes[i].getHeight() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression sizes[i].getWidth() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression Math.max(sizes[i].width,maxWidth) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression x + sizes[i].width + this.horizontalGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression x cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression y cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression y + sizes[i].height + this.verticalGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression Math.max(sizes[i].height,maxHeight) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Clone fragment #1 returns variables height, maxWidth, y , while Clone fragment #2 returns variables width, maxHeight, x