if (userId == null) throw new IllegalArgumentException("userId == null"); if (type < 0 || type >= NAMES.length) throw new IllegalArgumentException("unsupported type= " + type); this.userId = userId; this.type = type;
if (address == null) throw new IllegalArgumentException("address == null"); if (type < 0 || type >=NAMES.length) throw new IllegalArgumentException("type is not supported= " + type); this.address = address; this.type = type;
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/model/InstantMessagingModel.java File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/model/EmailModel.java
Method name: void InstantMessagingModel(String, int) Method name: void EmailModel(String, int)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (userId == null)
1
if (address == null)
2
			throw new IllegalArgumentException("userId == null");
2
			throw new IllegalArgumentException("address == null");
3
		if (type < 0 || type >= NAMES.length)
3
		if (type < 0 || type >=NAMES.length)
4
			throw new IllegalArgumentException("unsupported type= " + type);
4
			throw new IllegalArgumentException("type is not supported= " + type);
5
		this.userId = userId;
5
		this.address = address;
6
		this.type = type;
6
		this.type = type;
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 comparisons16
  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
    1
    if (userId == null)
    1
    if (userId == null)
    1
    if (address == null)
    Differences
    Expression1Expression2Difference
    userIdaddressVARIABLE_NAME_MISMATCH
    1
    if (address == null)
    2
    throw new IllegalArgumentException("userId == null");
    2
    throw new IllegalArgumentException("userId == null");
    2
    throw new IllegalArgumentException("address == null");
    Differences
    Expression1Expression2Difference
    "userId == null""address == null"LITERAL_VALUE_MISMATCH
    2
    throw new IllegalArgumentException("address == null");
    3
    if (type < 0 || type >= NAMES.length)
    3
    if (type < 0 || type >= NAMES.length)
    4
    throw new IllegalArgumentException("unsupported type= " + type);
    4
    throw new IllegalArgumentException("unsupported type= " + type);
    4
    throw new IllegalArgumentException("type is not supported= " + type);
    Differences
    Expression1Expression2Difference
    "unsupported type= ""type is not supported= "LITERAL_VALUE_MISMATCH
    4
    throw new IllegalArgumentException("type is not supported= " + type);
    5
    this.userId = userId;
    5
    this.userId = userId;
    5
    this.address = address;
    Differences
    Expression1Expression2Difference
    userIdaddressVARIABLE_NAME_MISMATCH
    userIdaddressVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.userId is a field being modified, and thus it cannot be parameterized
    Expression this.address is a field being modified, and thus it cannot be parameterized
    5
    this.address = address;
    6
    this.type = type;
    6
    this.type = type;
    Precondition Violations (2)
    Row Violation
    1Expression this.userId is a field being modified, and thus it cannot be parameterized
    2Expression this.address is a field being modified, and thus it cannot be parameterized