if (y + size.height <= height) { itemsInColumn.add(block); block.setBounds( new Rectangle2D.Double(x, y, size.width, size.height) ); y = y + size.height + this.verticalGap; maxWidth = Math.max(maxWidth, size.width); } else { if (itemsInColumn.isEmpty()) { // place in this column (truncated) anyway block.setBounds( new Rectangle2D.Double( x, y, size.width, Math.min(size.height, height - y) ) ); y = 0.0; x = x + size.width + this.horizontalGap; } else { // start new column 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);
if (x + size.width <= width) { itemsInRow.add(block); block.setBounds( new Rectangle2D.Double(x, y, size.width, size.height) ); x = x + size.width + this.horizontalGap; maxHeight = Math.max(maxHeight, size.height); } else { if (itemsInRow.isEmpty()) { // place in this row (truncated) anyway block.setBounds( new Rectangle2D.Double( x, y, Math.min(size.width, width - x), size.height ) ); x = 0.0; y = y + size.height + this.verticalGap; } else { // start new row 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: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
if (y + size.height <= height) {
1
if (x + size.width <= width) {
2
                itemsInColumn.add(block);
2
                itemsInRow.add(block);
3
                block.setBounds(
3
                block.setBounds(
4
                    new Rectangle2D.Double(x, y, size.width, size.height)
4
                    new Rectangle2D.Double(x, y, size.width, size.height)
5
                );
5
                );
6
                y = y + size.height + this.verticalGap;
6
                x = x + size.width + this.horizontalGap;
7
                maxWidth = Math.max(maxWidth, size.width);
7
                maxHeight = Math.max(maxHeight, size.height);
8
            }
8
            }
9
            else {
9
            else {
10
                if (itemsInColumn.isEmpty()) {
10
                if (itemsInRow.isEmpty()) {
11
                    // place in this column (truncated) anyway
11
                    // place in this row (truncated) anyway
12
                    block.setBounds(
12
                    block.setBounds(
13
                        new Rectangle2D.Double(
13
                        new Rectangle2D.Double(
14
                            x, y, size.width, Math.min(size.height, height - y)
14
                            x, y, Math.min(size.width, width - x), size.height
15
                        )
15
                        )
16
                    );
16
                    );
17
                    y = 0.0;
17
                    x = 0.0;
18
                    x = x + size.width + this.horizontalGap;
18
                    y = y + size.height + this.verticalGap;
19
                }
19
                }
20
                else {
20
                else {
21
                    // start new column
21
                    // start new row
22
                    itemsInColumn.clear();
22
                    itemsInRow.clear();
23
                    x = x + maxWidth + this.horizontalGap;
23
                    x = 
24
                    y = 0.0
24
0.0;
25
;
25
                    y = y + maxHeight + this.verticalGap;
26
                    maxWidth = size.width;
26
                    maxHeight = size.height;
27
                    block.setBounds(
27
                    block.setBounds(
28
                        new Rectangle2D.Double(
28
                        new Rectangle2D.Double(
29
                            x, y, size.width, Math.min(size.height, height)
29
                            x, y, Math.min(size.width, width), size.height
30
                        )
30
                        )
31
                    );
31
                    );
32
                    y = size.height + this.verticalGap;
32
                    x = size.width + this.horizontalGap;
33
                    itemsInColumn.add(block);
33
                    itemsInRow.add(block);
34
                
34
                
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0