if (type == null) throw new IllegalArgumentException("type == null"); if (calendarId == null) throw new IllegalArgumentException("calendarId == null"); if (component == null) throw new IllegalArgumentException("component == null");
if (icon == null) throw new IllegalArgumentException("icon == null"); if (action == null) throw new IllegalArgumentException("action == null"); if (border == null) throw new IllegalArgumentException("border == null");
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/model/ComponentInfo.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/docking/TitleBar.java
Method name: void ComponentInfo(String, TYPE, String, IComponent) Method name: JButton addButton(ImageIcon, Action, String)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (type == null)
1
if (icon == null)
2
			throw new IllegalArgumentException("type == null");
2
			throw new IllegalArgumentException("icon == null");
3
		if (calendarId == null)
3
		if (action == null)
4
			throw new IllegalArgumentException("calendarId == null");
4
			throw new IllegalArgumentException("action == null");
5
		if (component == null)
5
		if (border == null)
6
			throw new IllegalArgumentException("component == null");
6
			throw new IllegalArgumentException("border == 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.3
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.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    if (type == null)
    3
    if (type == null)
    3
    if (action == null)
    Differences
    Expression1Expression2Difference
    typeactionVARIABLE_NAME_MISMATCH
    org.columba.calendar.model.api.IComponent.TYPEjavax.swing.ActionVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.calendar.model.api.IComponent.TYPE of variable type does not match with type javax.swing.Action of variable action
    • Make classes org.columba.calendar.model.api.IComponent.TYPE and javax.swing.Action extend a common superclass
    3
    if (action == null)
    4
    throw new IllegalArgumentException("type == null");
    4
    throw new IllegalArgumentException("type == null");
    4
    throw new IllegalArgumentException("action == null");
    Differences
    Expression1Expression2Difference
    "type == null""action == null"LITERAL_VALUE_MISMATCH
    4
    throw new IllegalArgumentException("action == null");
    5
    if (calendarId == null)
    5
    if (calendarId == null)
    5
    if (border == null)
    Differences
    Expression1Expression2Difference
    calendarIdborderVARIABLE_NAME_MISMATCH
    5
    if (border == null)
    6
    throw new IllegalArgumentException("calendarId == null");
    6
    throw new IllegalArgumentException("calendarId == null");
    6
    throw new IllegalArgumentException("border == null");
    Differences
    Expression1Expression2Difference
    "calendarId == null""border == null"LITERAL_VALUE_MISMATCH
    6
    throw new IllegalArgumentException("border == null");
    7
    if (component == null)
    7
    if (component == null)
    1
    if (icon == null)
    Differences
    Expression1Expression2Difference
    componenticonVARIABLE_NAME_MISMATCH
    org.columba.calendar.model.api.IComponentjavax.swing.ImageIconVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.calendar.model.api.IComponent of variable component does not match with type javax.swing.ImageIcon of variable icon
    • Make classes org.columba.calendar.model.api.IComponent and javax.swing.ImageIcon extend a common superclass
    1
    if (icon == null)
    8
    throw new IllegalArgumentException("component == null");
    8
    throw new IllegalArgumentException("component == null");
    2
    throw new IllegalArgumentException("icon == null");
    Differences
    Expression1Expression2Difference
    "component == null""icon == null"LITERAL_VALUE_MISMATCH
    2
    throw new IllegalArgumentException("icon == null");
    Precondition Violations (2)
    Row Violation
    1Type org.columba.calendar.model.api.IComponent.TYPE of variable type does not match with type javax.swing.Action of variable action
    2Type org.columba.calendar.model.api.IComponent of variable component does not match with type javax.swing.ImageIcon of variable icon