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(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: 8 Number of AST nodes: 8
1
if(TOP_BUTTONS.equals(cons))
1
if(name.equals(RIGHT))
2
				topButtons = comp;
2
				right = comp;
3
			else if(LEFT_BUTTONS.equals(cons))
3
			else if(name.equals(LEFT))
4
				leftButtons = comp;
4
				left = comp;
5
			else if(BOTTOM_BUTTONS.equals(cons))
5
			else if(name.equals(BOTTOM))
6
				bottomButtons = comp;
6
				bottom = comp;
7
			else if(RIGHT_BUTTONS.equals(cons))
7
			else if(name.equals(TOP))
8
				rightButtons = comp;
8
				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)1.5
Clones locationClones are in different classes
Number of node comparisons46
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    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
    else if (RIGHT_BUTTONS.equals(cons))
    21
    else if (RIGHT_BUTTONS.equals(cons))
    3
    else if (name.equals(RIGHT))
    Differences
    Expression1Expression2Difference
    consRIGHTVARIABLE_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 RIGHT
    • Make classes java.lang.Object and java.lang.String extend a common superclass
    3
    else if (name.equals(RIGHT))
    22
    rightButtons = comp;
    22
    rightButtons = comp;
    4
    right = comp;
    Differences
    Expression1Expression2Difference
    rightButtonsrightVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression rightButtons is a field being modified, and thus it cannot be parameterized
    Expression right is a field being modified, and thus it cannot be parameterized
    4
    right = comp;
    Precondition Violations (12)
    Row Violation
    1Type java.lang.Object of variable cons does not match with type java.lang.String of variable TOP
    2Expression topButtons is a field being modified, and thus it cannot be parameterized
    3Expression top is a field being modified, and thus it cannot be parameterized
    4Type java.lang.Object of variable cons does not match with type java.lang.String of variable BOTTOM
    5Expression leftButtons is a field being modified, and thus it cannot be parameterized
    6Expression bottom is a field being modified, and thus it cannot be parameterized
    7Type java.lang.Object of variable cons does not match with type java.lang.String of variable LEFT
    8Expression bottomButtons is a field being modified, and thus it cannot be parameterized
    9Expression left is a field being modified, and thus it cannot be parameterized
    10Type java.lang.Object of variable cons does not match with type java.lang.String of variable RIGHT
    11Expression rightButtons is a field being modified, and thus it cannot be parameterized
    12Expression right is a field being modified, and thus it cannot be parameterized