final IAttributeType attr = new AttributeType(theName, theNamespace); attributeMap.put(new Name(theName, theNamespace), attr); attributeList.add(attr); return attr;
final IStructureType type = new StructureType(theName, theNamespace); typeMap.put(new Name(theName, theNamespace), type); typeList.add(type); return type;
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/context/base/StructureType.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/context/base/StructureType.java
Method name: IAttributeType addAttribute(String, String) Method name: IStructureType addChild(String, String)
Number of AST nodes: 4 Number of AST nodes: 4
1
final IAttributeType attr = new AttributeType(theName, theNamespace);
1
final IStructureType type = new StructureType(theName, theNamespace);
2
		attributeMap.put(new Name(theName, theNamespace), attr);
2
		typeMap.put(new Name(theName, theNamespace), type);
3
		attributeList.add(attr);
3
		typeList.add(type);
4
		return attr;
4
		return 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.0
Clones locationClones are declared in the same class
Number of node comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                                                              
    1
    final IStructureType type = new StructureType(theName, theNamespace);
    1
    final IAttributeType attr = new AttributeType(theName, theNamespace);
                                                                                                                                              
                                                                                                            
    2
    typeMap.put(new Name(theName, theNamespace), type);
    2
    attributeMap.put(new Name(theName, theNamespace), attr);
                                                                                                                      
    3
    attributeList.add(attr);
    3
    attributeList.add(attr);
    3
    typeList.add(type);
    Differences
    Expression1Expression2Difference
    attrtypeVARIABLE_NAME_MISMATCH
    org.columba.core.context.base.api.IAttributeTypeorg.columba.core.context.base.api.IStructureTypeVARIABLE_TYPE_MISMATCH
    attributeListtypeListVARIABLE_NAME_MISMATCH
    java.util.Listjava.util.ListVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.core.context.base.api.IAttributeType of variable attr does not match with type org.columba.core.context.base.api.IStructureType of variable type
    • Make classes org.columba.core.context.base.api.IAttributeType and org.columba.core.context.base.api.IStructureType extend a common superclass
    Type java.util.List<org.columba.core.context.base.api.IAttributeType> of variable attributeList does not match with type java.util.List<org.columba.core.context.base.api.IStructureType> of variable typeList
    • Make classes java.util.List and java.util.List extend a common superclass
    3
    typeList.add(type);
                                  
    4
    return type;
    Preondition Violations
    Unmatched return type;
    4
    return type;
    4
    return attr;
    4
    return attr;
    Preondition Violations
    Unmatched return attr;
                                  
    Precondition Violations (4)
    Row Violation
    1Type org.columba.core.context.base.api.IAttributeType of variable attr does not match with type org.columba.core.context.base.api.IStructureType of variable type
    2Type java.util.List<org.columba.core.context.base.api.IAttributeType> of variable attributeList does not match with type java.util.List<org.columba.core.context.base.api.IStructureType> of variable typeList
    3Unmatched return type;
    4Unmatched return attr;