if (icon == null) throw new IllegalArgumentException("icon == null"); if (action == null) throw new IllegalArgumentException("action == null"); if (border == null) throw new IllegalArgumentException("border == null");
if (id == null) throw new IllegalArgumentException("id == null"); if (name == null) throw new IllegalArgumentException("name == null"); if (comp == null) throw new IllegalArgumentException("comp == null");
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/docking/TitleBar.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/frame/FrameMediatorDockable.java
Method name: JButton addButton(ImageIcon, Action, String) Method name: void FrameMediatorDockable(String, String, JComponent, JPopupMenu)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (icon == null)
1
if (id == null)
2
			throw new IllegalArgumentException("icon == null");
2
			throw new IllegalArgumentException("id == null");
3
		if (action == null)
3
		if (name == null)
4
			throw new IllegalArgumentException("action == null");
4
			throw new IllegalArgumentException("name == null");
5
		if (border == null)
5
		if (comp == null)
6
			throw new IllegalArgumentException("border == null");
6
			throw new IllegalArgumentException("comp == null");
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)0.4
Clones locationClones are in different classes
Number of node comparisons27
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (icon == null)
    1
    if (icon == null)
    1
    if (id == null)
    Differences
    Expression1Expression2Difference
    iconidVARIABLE_NAME_MISMATCH
    javax.swing.ImageIconjava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type javax.swing.ImageIcon of variable icon does not match with type java.lang.String of variable id
    • Make classes javax.swing.ImageIcon and java.lang.String extend a common superclass
    1
    if (id == null)
    2
    throw new IllegalArgumentException("icon == null");
    2
    throw new IllegalArgumentException("icon == null");
    2
    throw new IllegalArgumentException("id == null");
    Differences
    Expression1Expression2Difference
    "icon == null""id == null"LITERAL_VALUE_MISMATCH
    2
    throw new IllegalArgumentException("id == null");
    3
    if (action == null)
    3
    if (action == null)
    3
    if (name == null)
    Differences
    Expression1Expression2Difference
    actionnameVARIABLE_NAME_MISMATCH
    javax.swing.Actionjava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type javax.swing.Action of variable action does not match with type java.lang.String of variable name
    • Make classes javax.swing.Action and java.lang.String extend a common superclass
    3
    if (name == null)
    4
    throw new IllegalArgumentException("action == null");
    4
    throw new IllegalArgumentException("action == null");
    4
    throw new IllegalArgumentException("name == null");
    Differences
    Expression1Expression2Difference
    "action == null""name == null"LITERAL_VALUE_MISMATCH
    4
    throw new IllegalArgumentException("name == null");
    5
    if (border == null)
    5
    if (border == null)
    5
    if (comp == null)
    Differences
    Expression1Expression2Difference
    bordercompVARIABLE_NAME_MISMATCH
    java.lang.Stringjavax.swing.JComponentVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable border does not match with type javax.swing.JComponent of variable comp
    • Make classes java.lang.String and javax.swing.JComponent extend a common superclass
    5
    if (comp == null)
    6
    throw new IllegalArgumentException("border == null");
    6
    throw new IllegalArgumentException("border == null");
    6
    throw new IllegalArgumentException("comp == null");
    Differences
    Expression1Expression2Difference
    "border == null""comp == null"LITERAL_VALUE_MISMATCH
    6
    throw new IllegalArgumentException("comp == null");
    Precondition Violations (3)
    Row Violation
    1Type javax.swing.ImageIcon of variable icon does not match with type java.lang.String of variable id
    2Type javax.swing.Action of variable action does not match with type java.lang.String of variable name
    3Type java.lang.String of variable border does not match with type javax.swing.JComponent of variable comp