if(RIGHT.equals(cons)) right = comp; else if(TOP_BUTTONS.equals(cons)) topButtons = comp; else if(LEFT_BUTTONS.equals(cons)) leftButtons = comp; else if(BOTTOM_BUTTONS.equals(cons)) bottomButtons = comp; else if(RIGHT_BUTTONS.equals(cons)) rightButtons = comp;
if(name.equals(CENTER)) center = comp; else if(name.equals(RIGHT)) right = comp; else if(name.equals(LEFT)) left = comp; else if(name.equals(BOTTOM)) bottom = comp; else if(name.equals(TOP)) top = comp;
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/DockableWindowManager.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/textarea/JEditTextArea.java
Method name: void addLayoutComponent(Component, Object) Method name: void addLayoutComponent(String, Component)
Number of AST nodes: 10 Number of AST nodes: 10
1
if(RIGHT.equals(cons))
1
if(name.equals(CENTER))
2
				right = comp;
2
				center = comp;
3
			else if(TOP_BUTTONS.equals(cons))
3
			else if(name.equals(RIGHT))
4
				topButtons = comp;
4
				right = comp;
5
			else if(LEFT_BUTTONS.equals(cons))
5
			else if(name.equals(LEFT))
6
				leftButtons = comp;
6
				left = comp;
7
			else if(BOTTOM_BUTTONS.equals(cons))
7
			else if(name.equals(BOTTOM))
8
				bottomButtons = comp;
8
				bottom = comp;
9
			else if(RIGHT_BUTTONS.equals(cons))
9
			else if(name.equals(TOP))
10
				rightButtons = comp;
10
				top = comp;
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)2.3
Clones locationClones are in different classes
Number of node comparisons70
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements10
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    13
    else if (RIGHT.equals(cons))
    13
    else if (RIGHT.equals(cons))
    3
    else if (name.equals(RIGHT))
    Differences
    Expression1Expression2Difference
    consRIGHTVARIABLE_NAME_MISMATCH
    java.lang.Objectjava.lang.StringVARIABLE_TYPE_MISMATCH
    RIGHTnameVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type java.lang.Object of variable cons does not match with type java.lang.String of variable RIGHT
    • Make classes java.lang.Object and java.lang.String extend a common superclass
    3
    else if (name.equals(RIGHT))
    14
    right = comp;
    4
    right = comp;
    15
    else if (TOP_BUTTONS.equals(cons))
    15
    else if (TOP_BUTTONS.equals(cons))
    9
    else if (name.equals(TOP))
    Differences
    Expression1Expression2Difference
    consTOPVARIABLE_NAME_MISMATCH
    java.lang.Objectjava.lang.StringVARIABLE_TYPE_MISMATCH
    TOP_BUTTONSnameVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type java.lang.Object of variable cons does not match with type java.lang.String of variable TOP
    • Make classes java.lang.Object and java.lang.String extend a common superclass
    9
    else if (name.equals(TOP))
    16
    topButtons = comp;
    16
    topButtons = comp;
    10
    top = comp;
    Differences
    Expression1Expression2Difference
    topButtonstopVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression topButtons is a field being modified, and thus it cannot be parameterized
    Expression top is a field being modified, and thus it cannot be parameterized
    10
    top = comp;
    17
    else if (LEFT_BUTTONS.equals(cons))
    17
    else if (LEFT_BUTTONS.equals(cons))
    7
    else if (name.equals(BOTTOM))
    Differences
    Expression1Expression2Difference
    consBOTTOMVARIABLE_NAME_MISMATCH
    java.lang.Objectjava.lang.StringVARIABLE_TYPE_MISMATCH
    LEFT_BUTTONSnameVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type java.lang.Object of variable cons does not match with type java.lang.String of variable BOTTOM
    • Make classes java.lang.Object and java.lang.String extend a common superclass
    7
    else if (name.equals(BOTTOM))
    18
    leftButtons = comp;
    18
    leftButtons = comp;
    8
    bottom = comp;
    Differences
    Expression1Expression2Difference
    leftButtonsbottomVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression leftButtons is a field being modified, and thus it cannot be parameterized
    Expression bottom is a field being modified, and thus it cannot be parameterized
    8
    bottom = comp;
    19
    else if (BOTTOM_BUTTONS.equals(cons))
    19
    else if (BOTTOM_BUTTONS.equals(cons))
    5
    else if (name.equals(LEFT))
    Differences
    Expression1Expression2Difference
    consLEFTVARIABLE_NAME_MISMATCH
    java.lang.Objectjava.lang.StringVARIABLE_TYPE_MISMATCH
    BOTTOM_BUTTONSnameVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type java.lang.Object of variable cons does not match with type java.lang.String of variable LEFT
    • Make classes java.lang.Object and java.lang.String extend a common superclass
    5
    else if (name.equals(LEFT))
    20
    bottomButtons = comp;
    20
    bottomButtons = comp;
    6
    left = comp;
    Differences
    Expression1Expression2Difference
    bottomButtonsleftVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression bottomButtons is a field being modified, and thus it cannot be parameterized
    Expression left is a field being modified, and thus it cannot be parameterized
    6
    left = comp;
    21
    if (RIGHT_BUTTONS.equals(cons))
    21
    if (RIGHT_BUTTONS.equals(cons))
    1
    if (name.equals(CENTER))
    Differences
    Expression1Expression2Difference
    consCENTERVARIABLE_NAME_MISMATCH
    java.lang.Objectjava.lang.StringVARIABLE_TYPE_MISMATCH
    RIGHT_BUTTONSnameVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type java.lang.Object of variable cons does not match with type java.lang.String of variable CENTER
    • Make classes java.lang.Object and java.lang.String extend a common superclass
    1
    if (name.equals(CENTER))
    22
    rightButtons = comp;
    22
    rightButtons = comp;
    2
    center = comp;
    Differences
    Expression1Expression2Difference
    rightButtonscenterVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression rightButtons is a field being modified, and thus it cannot be parameterized
    Expression center is a field being modified, and thus it cannot be parameterized
    2
    center = comp;
    Precondition Violations (13)
    Row Violation
    1Type java.lang.Object of variable cons does not match with type java.lang.String of variable RIGHT
    2Type java.lang.Object of variable cons does not match with type java.lang.String of variable TOP
    3Expression topButtons is a field being modified, and thus it cannot be parameterized
    4Expression top is a field being modified, and thus it cannot be parameterized
    5Type java.lang.Object of variable cons does not match with type java.lang.String of variable BOTTOM
    6Expression leftButtons is a field being modified, and thus it cannot be parameterized
    7Expression bottom is a field being modified, and thus it cannot be parameterized
    8Type java.lang.Object of variable cons does not match with type java.lang.String of variable LEFT
    9Expression bottomButtons is a field being modified, and thus it cannot be parameterized
    10Expression left is a field being modified, and thus it cannot be parameterized
    11Type java.lang.Object of variable cons does not match with type java.lang.String of variable CENTER
    12Expression rightButtons is a field being modified, and thus it cannot be parameterized
    13Expression center is a field being modified, and thus it cannot be parameterized