final IStructureType type = new StructureType(theName, theNamespace); typeMap.put(new Name(theName, theNamespace), type); typeList.add(type); return type;
final IAttributeType attr = new AttributeType(theName, theNamespace); attributeMap.put(new Name(theName, theNamespace), attr); attributeList.add(attr); return attr;
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: IStructureType addChild(String, String) Method name: IAttributeType addAttribute(String, String)
Number of AST nodes: 4 Number of AST nodes: 4
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
		typeList.add(type);
3
		attributeList.add(attr);
4
		return type;
4
		return attr;
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 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
    typeList.add(type);
    3
    typeList.add(type);
    3
    attributeList.add(attr);
    Differences
    Expression1Expression2Difference
    typeattrVARIABLE_NAME_MISMATCH
    org.columba.core.context.base.api.IStructureTypeorg.columba.core.context.base.api.IAttributeTypeVARIABLE_TYPE_MISMATCH
    typeListattributeListVARIABLE_NAME_MISMATCH
    java.util.Listjava.util.ListVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.core.context.base.api.IStructureType of variable type does not match with type org.columba.core.context.base.api.IAttributeType of variable attr
    • Make classes org.columba.core.context.base.api.IStructureType and org.columba.core.context.base.api.IAttributeType extend a common superclass
    Type java.util.List<org.columba.core.context.base.api.IStructureType> of variable typeList does not match with type java.util.List<org.columba.core.context.base.api.IAttributeType> of variable attributeList
    • Make classes java.util.List and java.util.List extend a common superclass
    3
    attributeList.add(attr);
                                  
    4
    return attr;
    Preondition Violations
    Unmatched return attr;
    4
    return attr;
    4
    return type;
    4
    return type;
    Preondition Violations
    Unmatched return type;
                                  
    Precondition Violations (4)
    Row Violation
    1Type org.columba.core.context.base.api.IStructureType of variable type does not match with type org.columba.core.context.base.api.IAttributeType of variable attr
    2Type java.util.List<org.columba.core.context.base.api.IStructureType> of variable typeList does not match with type java.util.List<org.columba.core.context.base.api.IAttributeType> of variable attributeList
    3Unmatched return attr;
    4Unmatched return type;