final IAttributeType t = getType().getAttribute(theName, theNamespace); if (!t.getBaseType().equals(BASETYPE.DATE)) { throw new IllegalArgumentException("attribute <" + theName + "," + theNamespace + "> is not of type Date"); }
final IAttributeType t = getType().getAttribute(theName, theNamespace); if (!t.getBaseType().equals(BASETYPE.FLOAT)) { throw new IllegalArgumentException("attribute <" + theName + "," + theNamespace + "> is not of type Float"); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/context/base/StructureValue.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/context/base/StructureValue.java
Method name: void setDate(String, String, Date) Method name: float getFloat(String, String)
Number of AST nodes: 3 Number of AST nodes: 3
1
final IAttributeType t = getType().getAttribute(theName, theNamespace);
1
final IAttributeType t = getType().getAttribute(theName, theNamespace);
2
		if (!t.getBaseType().equals(BASETYPE.DATE)) {
2
		if (!t.getBaseType().equals(BASETYPE.FLOAT)) {
3
			throw new IllegalArgumentException("attribute <" + theName + ","
3
			throw new IllegalArgumentException("attribute <" + theName + ","
4
					+ theNamespace + "> is not of type Date");
4
					+ theNamespace + "> is not of type Float");
5
		}
5
		}
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.2
Clones locationClones are declared in the same class
Number of node comparisons5
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements3
    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
    final IAttributeType t = getType().getAttribute(theName, theNamespace);
    1
    final IAttributeType t = getType().getAttribute(theName, theNamespace);
    2
    if (!t.getBaseType().equals(BASETYPE.DATE))
    2
    if (!t.getBaseType().equals(BASETYPE.DATE))
    2
    if (!t.getBaseType().equals(BASETYPE.FLOAT))
    Differences
    Expression1Expression2Difference
    DATEFLOATVARIABLE_NAME_MISMATCH
    2
    if (!t.getBaseType().equals(BASETYPE.FLOAT))
    3
    throw new IllegalArgumentException("attribute <" + theName + "," + theNamespace + "> is not of type Date");
    3
    throw new IllegalArgumentException("attribute <" + theName + "," + theNamespace + "> is not of type Date");
    3
    throw new IllegalArgumentException("attribute <" + theName + "," + theNamespace + "> is not of type Float");
    Differences
    Expression1Expression2Difference
    "> is not of type Date""> is not of type Float"LITERAL_VALUE_MISMATCH
    3
    throw new IllegalArgumentException("attribute <" + theName + "," + theNamespace + "> is not of type Float");
    Precondition Violations (0)
    Row Violation