215-1-2

Block block = (Block) blocks.get(i); Size2D size = block.arrange(g2, RectangleConstraint.NONE); 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);
Block block = (Block) blocks.get(i); Size2D size = block.arrange(g2, RectangleConstraint.NONE); 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

    Block block = (Block) blocks.get(i);↵

1

    Block block = (Block) blocks.get(i);↵

2

                Size2D size = block.arrange(g2, RectangleConstraint.NONE);↵

2

                Size2D size = block.arrange(g2, RectangleConstraint.NONE);↵

3

                if (y + size.height <= height) {↵

3

                if (x + size.width <= width) {↵

4

                    itemsInColumn.add(block);↵

4

                    itemsInRow.add(block);↵

5

                    block.setBounds(↵

5

                    block.setBounds(↵

6

                        new Rectangle2D.Double(x, y, size.width, size.height)↵

6

                        new Rectangle2D.Double(x, y, size.width, size.height)↵

7

                    );↵

7

                    );↵

8

                    y = y + size.height + this.verticalGap;↵

8

                    x = x + size.width + this.horizontalGap;↵

9

                    maxWidth = Math.max(maxWidth, size.width);↵

9

                    maxHeight = Math.max(maxHeight, size.height);↵

10

                }↵

10

                }↵

11

                else {↵

11

                else {↵

12

                    if (itemsInColumn.isEmpty()) {↵

12

                    if (itemsInRow.isEmpty()) {↵

13

                        // place in this column (truncated) anyway↵

13

                        // place in this row (truncated) anyway↵

14

                        block.setBounds(↵

14

                        block.setBounds(↵

15

                            new Rectangle2D.Double(↵

15

                            new Rectangle2D.Double(↵

16

                                x, y, size.width, Math.min(size.height, height - y)↵

16

                                x, y, Math.min(size.width, width - x), size.height↵

17

                            )↵

17

                            )↵

18

                        );↵

18

                        );↵

19

                        y = 0.0;↵

19

                        x = 0.0;↵

20

                        x = x + size.width + this.horizontalGap;↵

20

                        y = y + size.height + this.verticalGap;↵

21

                    }↵

21

                    }↵

22

                    else {↵

22

                    else {↵

23

                        // start new column↵

23

                        // start new row↵

24

                        itemsInColumn.clear();↵

24

                        itemsInRow.clear();↵

25

                        x = x + maxWidth + this.horizontalGap;↵

25

                        x = ↵

26

                        y = 0.0↵

26

    0.0;↵

27

    ;↵

27

                        y = y + maxHeight + this.verticalGap;↵

28

                        maxWidth = size.width;↵

28

                        maxHeight = size.height;↵

29

                        block.setBounds(↵

29

                        block.setBounds(↵

30

                            new Rectangle2D.Double(↵

30

                            new Rectangle2D.Double(↵

31

                                x, y, size.width, Math.min(size.height, height)↵

31

                                x, y, Math.min(size.width, width), size.height↵

32

                            )↵

32

                            )↵

33

                        );↵

33

                        );↵

34

                        y = size.height + this.verticalGap;↵

34

                        x = size.width + this.horizontalGap;↵

35

                        itemsInColumn.add(block);↵

35

                        itemsInRow.add(block);↵

36

36

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 0
Number of refactorable cases | 0
Number of non-refactorable cases | 0
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0
Clones location |
Number of node comparisons | 0