if (edge == RectangleEdge.TOP) { result = this.positionForAxisAtTop; } else if (edge == RectangleEdge.BOTTOM) { result = this.positionForAxisAtBottom; } else if (edge == RectangleEdge.LEFT) { result = this.positionForAxisAtLeft; } else if (edge == RectangleEdge.RIGHT) { result = this.positionForAxisAtRight; }
if (edge == RectangleEdge.TOP) { this.topBlock = block; } else if (edge == RectangleEdge.BOTTOM) { this.bottomBlock = block; } else if (edge == RectangleEdge.LEFT) { this.leftBlock = block; } else if (edge == RectangleEdge.RIGHT) { this.rightBlock = block; }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CategoryLabelPositions.java File path: /jfreechart-1.0.10/src/org/jfree/chart/block/BorderArrangement.java
Method name: CategoryLabelPosition getLabelPosition(RectangleEdge) Method name: void add(Block, Object)
Number of AST nodes: 8 Number of AST nodes: 8
1
if (edge == RectangleEdge.TOP) {
1
if (edge == RectangleEdge.TOP) {
2
            result = this.positionForAxisAtTop;
2
            
3
    this.topBlock = block;
3
        }
4
            }
4
        else if (edge == RectangleEdge.BOTTOM) {
5
            else if (edge == RectangleEdge.BOTTOM) {
5
            result = this.positionForAxisAtBottom;
6
            
7
    this.bottomBlock = block;
6
        }
8
            }
7
        else if (edge == RectangleEdge.LEFT) {
9
            else if (edge == RectangleEdge.LEFT) {
8
            result = this.positionForAxisAtLeft;
10
                this.leftBlock = block;
9
        }
11
            }
10
        else if (edge == RectangleEdge.RIGHT) {
12
            else if (edge == RectangleEdge.RIGHT) {
11
            result = this.positionForAxisAtRight;
13
            
14
    this.rightBlock = block;
12
        }
15
            }
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)1.0
Clones locationClones are in different classes
Number of node comparisons46
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment4
    Time elapsed for statement mapping (ms)1.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    if (edge == RectangleEdge.TOP)
    4
    if (edge == RectangleEdge.TOP)
    3
    result = this.positionForAxisAtTop;
    3
    result = this.positionForAxisAtTop;
    Preondition Violations
    Unmatched statement result=this.positionForAxisAtTop; cannot be moved, because it updates a variable modified in other unmapped statements
                                                                            
                                                  
    5
    this.topBlock = block;
    Preondition Violations
    Unmatched statement this.topBlock=block; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5
    this.topBlock = block;
    4
    else if (edge == RectangleEdge.BOTTOM)
    6
    else if (edge == RectangleEdge.BOTTOM)
    5
    result = this.positionForAxisAtBottom;
    5
    result = this.positionForAxisAtBottom;
    Preondition Violations
    Unmatched statement result=this.positionForAxisAtBottom; cannot be moved, because it updates a variable modified in other unmapped statements
                                                                                  
                                                        
    7
    this.bottomBlock = block;
    Preondition Violations
    Unmatched statement this.bottomBlock=block; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    7
    this.bottomBlock = block;
    6
    else if (edge == RectangleEdge.LEFT)
    8
    else if (edge == RectangleEdge.LEFT)
    7
    result = this.positionForAxisAtLeft;
    7
    result = this.positionForAxisAtLeft;
    Preondition Violations
    Unmatched statement result=this.positionForAxisAtLeft; cannot be moved, because it updates a variable modified in other unmapped statements
                                                                              
                                                    
    9
    this.leftBlock = block;
    Preondition Violations
    Unmatched statement this.leftBlock=block; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    9
    this.leftBlock = block;
    8
    else if (edge == RectangleEdge.RIGHT)
    10
    else if (edge == RectangleEdge.RIGHT)
    9
    result = this.positionForAxisAtRight;
    9
    result = this.positionForAxisAtRight;
    Preondition Violations
    Unmatched statement result=this.positionForAxisAtRight; cannot be moved, because it updates a variable modified in other unmapped statements
                                                                                
                                                        
    11
    this.rightBlock = block;
    Preondition Violations
    Unmatched statement this.rightBlock=block; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    11
    this.rightBlock = block;
    Precondition Violations (8)
    Row Violation
    1Unmatched statement this.topBlock=block; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement this.bottomBlock=block; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement this.leftBlock=block; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement this.rightBlock=block; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched statement result=this.positionForAxisAtTop; cannot be moved, because it updates a variable modified in other unmapped statements
    6Unmatched statement result=this.positionForAxisAtBottom; cannot be moved, because it updates a variable modified in other unmapped statements
    7Unmatched statement result=this.positionForAxisAtLeft; cannot be moved, because it updates a variable modified in other unmapped statements
    8Unmatched statement result=this.positionForAxisAtRight; cannot be moved, because it updates a variable modified in other unmapped statements