itemsInColumn.clear(); x = x + maxWidth + this.horizontalGap; y = 0.0; maxWidth = size.width; block.setBounds( new Rectangle2D.Double( x, y, size.width, Math.min(size.height, height) ) ); y = size.height + this.verticalGap; itemsInColumn.add(block);
itemsInRow.clear(); x = 0.0; y = y + maxHeight + this.verticalGap; maxHeight = size.height; block.setBounds( new Rectangle2D.Double( x, y, Math.min(size.width, width), size.height ) ); x = size.width + this.horizontalGap; itemsInRow.add(block);
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 arrangeNF(BlockContainer, Graphics2D, RectangleConstraint) Method name: Size2D arrangeFN(BlockContainer, Graphics2D, RectangleConstraint)
Number of AST nodes: 7 Number of AST nodes: 7
1
itemsInColumn.clear();
1
itemsInRow.clear();
2
                    x = x + maxWidth + this.horizontalGap;
2
                    x = 
3
                    y = 0.0
3
0.0;
4
;
4
                    y = y + maxHeight + this.verticalGap;
5
                    maxWidth = size.width;
5
                    maxHeight = size.height;
6
                    block.setBounds(
6
                    block.setBounds(
7
                        new Rectangle2D.Double(
7
                        new Rectangle2D.Double(
8
                            x, y, size.width, Math.min(size.height, height)
8
                            x, y, Math.min(size.width, width), size.height
9
                        )
9
                        )
10
                    );
10
                    );
11
                    y = size.height + this.verticalGap;
11
                    x = size.width + this.horizontalGap;
12
                    itemsInColumn.add(block);
12
                    itemsInRow.add(block);
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 comparisons50
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    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
    21
    itemsInColumn.clear();
    21
    itemsInColumn.clear();
    19
    itemsInRow.clear();
    Differences
    Expression1Expression2Difference
    itemsInColumnitemsInRowVARIABLE_NAME_MISMATCH
    19
    itemsInRow.clear();
    22
    x = x + maxWidth + this.horizontalGap;
    22
    x = x + maxWidth + this.horizontalGap;
    20
    x = 0.0;
    Differences
    Expression1Expression2Difference
    x + maxWidth + this.horizontalGap0.0TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression x + maxWidth + this.horizontalGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20
    x = 0.0;
    23
    y = 0.0;
    23
    y = 0.0;
    21
    y = y + maxHeight + this.verticalGap;
    Differences
    Expression1Expression2Difference
    0.0y + maxHeight + this.verticalGapTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression y + maxHeight + this.verticalGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21
    y = y + maxHeight + this.verticalGap;
    24
    maxWidth = size.width;
    24
    maxWidth = size.width;
    24
    x = size.width + this.horizontalGap;
    Differences
    Expression1Expression2Difference
    maxWidthxVARIABLE_NAME_MISMATCH
    size.widthsize.width + this.horizontalGapTYPE_COMPATIBLE_REPLACEMENT
    24
    x = size.width + this.horizontalGap;
    25
    block.setBounds(new Rectangle2D.Double(x, y, size.width, Math.min(size.height, height)));
    25
    block.setBounds(new Rectangle2D.Double(x, y, size.width, Math.min(size.height, height)));
    23
    block.setBounds(new Rectangle2D.Double(x, y, Math.min(size.width, width), size.height));
    Differences
    Expression1Expression2Difference
    size.widthMath.min(size.width,width)TYPE_COMPATIBLE_REPLACEMENT
    Math.min(size.height,height)size.heightTYPE_COMPATIBLE_REPLACEMENT
    23
    block.setBounds(new Rectangle2D.Double(x, y, Math.min(size.width, width), size.height));
    26
    y = size.height + this.verticalGap;
    26
    y = size.height + this.verticalGap;
    22
    maxHeight = size.height;
    Differences
    Expression1Expression2Difference
    ymaxHeightVARIABLE_NAME_MISMATCH
    size.height + this.verticalGapsize.heightTYPE_COMPATIBLE_REPLACEMENT
    22
    maxHeight = size.height;
    27
    itemsInColumn.add(block);
    27
    itemsInColumn.add(block);
    25
    itemsInRow.add(block);
    Differences
    Expression1Expression2Difference
    itemsInColumnitemsInRowVARIABLE_NAME_MISMATCH
    25
    itemsInRow.add(block);
    Precondition Violations (3)
    Row Violation
    1Expression x + maxWidth + this.horizontalGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression y + maxHeight + this.verticalGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Clone fragment #1 returns variables y, x, maxWidth , while Clone fragment #2 returns variables x, y, maxHeight