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;
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 16 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 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 | typeList.add(type); |
| | | 4 | return type; |
4 | return attr; | | | |
Precondition Violations (4)
Row |
Violation |
1 | 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 |
2 | 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 |
3 | Unmatched return type; |
4 | Unmatched return attr; |