if (w == LengthConstraintType.NONE) { if (h == LengthConstraintType.NONE) { contentSize = arrangeNN(g2); } else if (h == LengthConstraintType.RANGE) { throw new RuntimeException("Not yet implemented."); } else if (h == LengthConstraintType.FIXED) { throw new RuntimeException("Not yet implemented."); } } else if (w == LengthConstraintType.RANGE) { if (h == LengthConstraintType.NONE) { throw new RuntimeException("Not yet implemented."); } else if (h == LengthConstraintType.RANGE) { throw new RuntimeException("Not yet implemented."); } else if (h == LengthConstraintType.FIXED) { throw new RuntimeException("Not yet implemented."); } } else if (w == LengthConstraintType.FIXED) { if (h == LengthConstraintType.NONE) { throw new RuntimeException("Not yet implemented."); } else if (h == LengthConstraintType.RANGE) { throw new RuntimeException("Not yet implemented."); } else if (h == LengthConstraintType.FIXED) { contentSize = new Size2D( contentConstraint.getWidth(), contentConstraint.getHeight() ); } }
if (w == LengthConstraintType.NONE) { if (h == LengthConstraintType.NONE) { contentSize = new Size2D(getWidth(), getHeight()); } else if (h == LengthConstraintType.RANGE) { throw new RuntimeException("Not yet implemented."); } else if (h == LengthConstraintType.FIXED) { throw new RuntimeException("Not yet implemented."); } } else if (w == LengthConstraintType.RANGE) { if (h == LengthConstraintType.NONE) { throw new RuntimeException("Not yet implemented."); } else if (h == LengthConstraintType.RANGE) { contentSize = arrangeRR(g2, cc.getWidthRange(), cc.getHeightRange()); } else if (h == LengthConstraintType.FIXED) { throw new RuntimeException("Not yet implemented."); } } else if (w == LengthConstraintType.FIXED) { if (h == LengthConstraintType.NONE) { throw new RuntimeException("Not yet implemented."); } else if (h == LengthConstraintType.RANGE) { throw new RuntimeException("Not yet implemented."); } else if (h == LengthConstraintType.FIXED) { throw new RuntimeException("Not yet implemented."); } }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/title/LegendGraphic.java File path: /jfreechart-1.0.10/src/org/jfree/chart/title/PaintScaleLegend.java
Method name: Size2D arrange(Graphics2D, RectangleConstraint) Method name: Size2D arrange(Graphics2D, RectangleConstraint)
Number of AST nodes: 21 Number of AST nodes: 21
1
if (w == LengthConstraintType.NONE) {
1
if (w == LengthConstraintType.NONE) {
2
            if (h == LengthConstraintType.NONE) {
2
            if (h == LengthConstraintType.NONE) {
3
                contentSize = arrangeNN(g2);
3
                contentSize = new Size2D(getWidth(), getHeight()); 
4
            }
4
            }
5
            else if (h == LengthConstraintType.RANGE) {
5
            else if (h == LengthConstraintType.RANGE) {
6
                throw new RuntimeException("Not yet implemented.");
6
                throw new RuntimeException("Not yet implemented."); 
7
            }
7
            }
8
            else if (h == LengthConstraintType.FIXED) {
8
            else if (h == LengthConstraintType.FIXED) {
9
                throw new RuntimeException("Not yet implemented.");
9
                throw new RuntimeException("Not yet implemented.");
10
            }
10
            }            
11
        }
11
        }
12
        else if (w == LengthConstraintType.RANGE) {
12
        else if (w == LengthConstraintType.RANGE) {
13
            if (h == LengthConstraintType.NONE) {
13
            if (h == LengthConstraintType.NONE) {
14
                throw new RuntimeException("Not yet implemented.");
14
                throw new RuntimeException("Not yet implemented."); 
15
            }
15
            }
16
            else if (h == LengthConstraintType.RANGE) {
16
            else if (h == LengthConstraintType.RANGE) {
17
                throw new RuntimeException("Not yet implemented."
17
                contentSize = arrangeRR(g2, cc.getWidthRange(), 
18
);
18
                        cc.getHeightRange()); 
19
            }
19
            }
20
            else if (h == LengthConstraintType.FIXED) {
20
            else if (h == LengthConstraintType.FIXED) {
21
                throw new RuntimeException("Not yet implemented.");
21
                throw new RuntimeException("Not yet implemented.");
22
            }
22
            }
23
        }
23
        }
24
        else if (w == LengthConstraintType.FIXED) {
24
        else if (w == LengthConstraintType.FIXED) {
25
            if (h == LengthConstraintType.NONE) {
25
            if (h == LengthConstraintType.NONE) {
26
                throw new RuntimeException("Not yet implemented.");
26
                throw new RuntimeException("Not yet implemented."); 
27
            }
27
            }
28
            else if (h == LengthConstraintType.RANGE) {
28
            else if (h == LengthConstraintType.RANGE) {
29
                throw new RuntimeException("Not yet implemented.");
29
                throw new RuntimeException("Not yet implemented."); 
30
            }
30
            }
31
            else if (h == LengthConstraintType.FIXED) {   
31
            else if (h == LengthConstraintType.FIXED) {
32
                contentSize = new Size2D(
32
                
33
                    contentConstraint.getWidth(),
34
                    contentConstraint.getHeight()
35
                );
33
throw new RuntimeException("Not yet implemented.");
36
            }            
34
            }
37
        }
35
        }
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)5.9
Clones locationClones are in different classes having the same super class
Number of node comparisons171
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements19
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)14.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    if (w == LengthConstraintType.NONE)
    5
    if (w == LengthConstraintType.NONE)
    6
    if (h == LengthConstraintType.NONE)
    6
    if (h == LengthConstraintType.NONE)
    7
    contentSize = arrangeNN(g2);
    7
    contentSize = arrangeNN(g2);
    7
    contentSize = new Size2D(getWidth(), getHeight());
    Differences
    Expression1Expression2Difference
    arrangeNN(g2)new Size2D(getWidth(),getHeight())TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression arrangeNN(g2) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new Size2D(getWidth(),getHeight()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7
    contentSize = new Size2D(getWidth(), getHeight());
    8
    else if (h == LengthConstraintType.RANGE)
    8
    else if (h == LengthConstraintType.RANGE)
    9
    throw new RuntimeException("Not yet implemented.");
    9
    throw new RuntimeException("Not yet implemented.");
    10
    else if (h == LengthConstraintType.FIXED)
    10
    else if (h == LengthConstraintType.FIXED)
    11
    throw new RuntimeException("Not yet implemented.");
    11
    throw new RuntimeException("Not yet implemented.");
    12
    else if (w == LengthConstraintType.RANGE)
    12
    else if (w == LengthConstraintType.RANGE)
    13
    if (h == LengthConstraintType.NONE)
    13
    if (h == LengthConstraintType.NONE)
    14
    throw new RuntimeException("Not yet implemented.");
    14
    throw new RuntimeException("Not yet implemented.");
    15
    else if (h == LengthConstraintType.RANGE)
    15
    else if (h == LengthConstraintType.RANGE)
    17
    else if (h == LengthConstraintType.FIXED)
    Differences
    Expression1Expression2Difference
    RANGEFIXEDVARIABLE_NAME_MISMATCH
    17
    else if (h == LengthConstraintType.FIXED)
    16
    throw new RuntimeException("Not yet implemented.");
    18
    throw new RuntimeException("Not yet implemented.");
    17
    else if (h == LengthConstraintType.FIXED)
    17
    else if (h == LengthConstraintType.FIXED)
    15
    else if (h == LengthConstraintType.RANGE)
    Differences
    Expression1Expression2Difference
    FIXEDRANGEVARIABLE_NAME_MISMATCH
    15
    else if (h == LengthConstraintType.RANGE)
                                                                                                                                              
    16
    contentSize = arrangeRR(g2, cc.getWidthRange(), cc.getHeightRange());
    Preondition Violations
    Unmatched statement contentSize=arrangeRR(g2,cc.getWidthRange(),cc.getHeightRange()); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    16
    contentSize = arrangeRR(g2, cc.getWidthRange(), cc.getHeightRange());
    18
    throw new RuntimeException("Not yet implemented.");
    18
    throw new RuntimeException("Not yet implemented.");
    Preondition Violations
    Unmatched statement throw new RuntimeException("Not yet implemented."); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    Unmatched throw new RuntimeException("Not yet implemented.");
                                                                                                                  
    19
    else if (w == LengthConstraintType.FIXED)
    19
    else if (w == LengthConstraintType.FIXED)
    20
    if (h == LengthConstraintType.NONE)
    20
    if (h == LengthConstraintType.NONE)
    21
    throw new RuntimeException("Not yet implemented.");
    21
    throw new RuntimeException("Not yet implemented.");
    22
    else if (h == LengthConstraintType.RANGE)
    22
    else if (h == LengthConstraintType.RANGE)
    23
    throw new RuntimeException("Not yet implemented.");
    23
    throw new RuntimeException("Not yet implemented.");
    24
    else if (h == LengthConstraintType.FIXED)
    24
    else if (h == LengthConstraintType.FIXED)
                                                                                                                  
    25
    throw new RuntimeException("Not yet implemented.");
    Preondition Violations
    Unmatched statement throw new RuntimeException("Not yet implemented."); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    Unmatched throw new RuntimeException("Not yet implemented.");
    25
    throw new RuntimeException("Not yet implemented.");
    25
    contentSize = new Size2D(contentConstraint.getWidth(), contentConstraint.getHeight());
    25
    contentSize = new Size2D(contentConstraint.getWidth(), contentConstraint.getHeight());
    Preondition Violations
    Unmatched statement contentSize=new Size2D(contentConstraint.getWidth(),contentConstraint.getHeight()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                                                                  
    Precondition Violations (8)
    Row Violation
    1Expression arrangeNN(g2) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new Size2D(getWidth(),getHeight()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Unmatched statement contentSize=arrangeRR(g2,cc.getWidthRange(),cc.getHeightRange()); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    4Unmatched statement throw new RuntimeException("Not yet implemented."); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    5Unmatched throw new RuntimeException("Not yet implemented.");
    6Unmatched statement throw new RuntimeException("Not yet implemented."); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    7Unmatched throw new RuntimeException("Not yet implemented.");
    8Unmatched statement contentSize=new Size2D(contentConstraint.getWidth(),contentConstraint.getHeight()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted