boolean foundMatch = false; for (int i = 0; i < NAMES.length; i++) { if (type.equals(NAMES[i])) { foundMatch = true; this.type = i; } } if (!foundMatch) throw new IllegalArgumentException("unsupported type: " + type);
boolean foundMatch = false; for (int i = 0; i < NAMES.length; i++) { if (type.equals(NAMES[i])) { foundMatch = true; this.type = i; } } if (!foundMatch) throw new IllegalArgumentException("unsupported type= " + type);
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/model/PhoneModel.java File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/model/InstantMessagingModel.java
Method name: void PhoneModel(String, String) Method name: void InstantMessagingModel(String, String)
Number of AST nodes: 7 Number of AST nodes: 7
1
boolean foundMatch = false;
1
boolean foundMatch = false;
2
		for (int i = 0; i < NAMES.length; i++) {
2
		for (int i = 0; i < NAMES.length; i++) {
3
			if (type.equals(NAMES[i])) {
3
			if (type.equals(NAMES[i])) {
4
				foundMatch = true;
4
				foundMatch = true;
5
				this.type = i;
5
				this.type = i;
6
			}
6
			}
7
		}
7
		}
8
		if (!foundMatch)
8
		if (!foundMatch)
9
			throw new IllegalArgumentException("unsupported type: " + type);
9
			throw new IllegalArgumentException("unsupported type= " + type);
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.3
Clones locationClones are in different classes
Number of node comparisons15
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    boolean foundMatch = false;
    6
    boolean foundMatch = false;
    3
    for (int i = 0; i < NAMES.length; i++)
    7
    for (int i = 0; i < NAMES.length; i++)
    4
    if (type.equals(NAMES[i]))
    8
    if (type.equals(NAMES[i]))
    5
    foundMatch = true;
    9
    foundMatch = true;
    6
    this.type = i;
    10
    this.type = i;
    7
    if (!foundMatch)
    11
    if (!foundMatch)
    8
    throw new IllegalArgumentException("unsupported type: " + type);
    8
    throw new IllegalArgumentException("unsupported type: " + type);
    12
    throw new IllegalArgumentException("unsupported type= " + type);
    Differences
    Expression1Expression2Difference
    "unsupported type: ""unsupported type= "LITERAL_VALUE_MISMATCH
    12
    throw new IllegalArgumentException("unsupported type= " + type);
    Precondition Violations (0)
    Row Violation