if (blockCount > 0) { Size2D[] sizes = new Size2D[blocks.size()]; for (int i = 0; i < blocks.size(); i++) { 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; } if (blockCount > 1) { height = height + this.verticalGap * (blockCount - 1); } if (this.horizontalAlignment != HorizontalAlignment.LEFT) { for (int i = 0; i < blocks.size(); i++) { //Block b = (Block) blocks.get(i); if (this.horizontalAlignment == HorizontalAlignment.CENTER) { //TODO: shift block right by half } else if (this.horizontalAlignment == HorizontalAlignment.RIGHT) {
if (blockCount > 0) { Size2D[] sizes = new Size2D[blocks.size()]; for (int i = 0; i < blocks.size(); i++) { 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; } if (blockCount > 1) { width = width + this.horizontalGap * (blockCount - 1); } if (this.verticalAlignment != VerticalAlignment.TOP) { for (int i = 0; i < blocks.size(); i++) { //Block b = (Block) blocks.get(i); if (this.verticalAlignment == VerticalAlignment.CENTER) { //TODO: shift block down by half } else if (this.verticalAlignment == VerticalAlignment.BOTTOM) {
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 (blockCount > 0) {
1
if (blockCount > 0) {
2
            Size2D[] sizes = new Size2D[blocks.size()];
2
            Size2D[] sizes = new Size2D[blocks.size()];
3
            for (int i = 0; i < blocks.size(); i++) {
3
            for (int i = 0; i < blocks.size(); i++) {
4
                Block block = (Block) blocks.get(i);
4
                Block block = (Block) blocks.get(i);
5
                sizes[i] = block.arrange(g2, RectangleConstraint.NONE);
5
                sizes[i] = block.arrange(g2, RectangleConstraint.NONE);
6
                height = height + sizes[i].getHeight();
6
                width = width + sizes[i].getWidth();
7
                maxWidth = Math.max(sizes[i].width, maxWidth);
7
                maxHeight = Math.max(sizes[i].height, maxHeight);
8
                block.setBounds(
8
                block.setBounds(
9
                    new Rectangle2D.Double(
9
                    new Rectangle2D.Double(
10
                        0.0, y, sizes[i].width, sizes[i].height
10
                        x, 0.0, sizes[i].width, sizes[i].height
11
                    )
11
                    )
12
                );
12
                );
13
                y = y + sizes[i].height + this.verticalGap;
13
                x = x + sizes[i].width + this.horizontalGap;
14
            }
14
            }
15
            if (blockCount > 1) {
15
            if (blockCount > 1) {
16
                height = height + this.verticalGap * (blockCount - 1);   
16
                width = width + this.horizontalGap * (blockCount - 1);   
17
            }
17
            }
18
            if (this.horizontalAlignment != HorizontalAlignment.LEFT) {
18
            if (this.verticalAlignment != VerticalAlignment.TOP) {
19
                for (int i = 0; i < blocks.size(); i++) {
19
                for (int i = 0; i < blocks.size(); i++) {
20
                    //Block b = (Block) blocks.get(i);
20
                    //Block b = (Block) blocks.get(i);
21
                    if (this.horizontalAlignment 
21
                    if (this.verticalAlignment 
22
                            == HorizontalAlignment.CENTER) {
22
== VerticalAlignment.CENTER) {
23
                        //TODO: shift block right by half
23
                        //TODO: shift block down by half
24
                    }
24
                    }
25
                    else if (this.horizontalAlignment 
25
                    else if (this.verticalAlignment 
26
                            == HorizontalAlignment.RIGHT) {
26
                            == VerticalAlignment.BOTTOM) {
27
                        
27
                        
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