if (store.getAssociatedItems("serviceId1", "metaDataId1").size() == 0)
System.out.println("Associated item size correct!");
else
fail("Associated item size not correct, "
+ store.getAssociatedItems("serviceId1", "metaDataId1")
.size() + " should be 0");
if (store.getAssociatedItems("serviceId1", "metaDataId1").size() == 1)
System.out.println("Associated item size correct!");
else
fail("Associated item size not correct, "
+ store.getAssociatedItems("serviceId1", "metaDataId1")
.size() + " should be 1");
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/test/java/org/columba/core/associations/AssociationStoreCases.java
|
|
File path: /columba-1.4-src/core/src/test/java/org/columba/core/associations/AssociationStoreCases.java
|
Method name: void testRemoveItem()
|
|
Method name: void testRemoveAssociation()
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | if (store.getAssociatedItems("serviceId1", "metaDataId1").size() == 0)↵ | | 1 | if (store.getAssociatedItems("serviceId1", "metaDataId1").size() == 1)↵
|
2 | System.out.println("Associated item size correct!");↵ | | 2 | System.out.println("Associated item size correct!");↵
|
3 | else↵ | | 3 | else↵
|
4 | fail("Associated item size not correct, "↵ | | 4 | fail("Associated item size not correct, "↵
|
5 | + store.getAssociatedItems("serviceId1", "metaDataId1")↵ | | 5 | + store.getAssociatedItems("serviceId1", "metaDataId1")↵
|
6 | .size() + " should be 0"); | | 6 | .size() + " should be 1");
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 9 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.9 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
15 | if (store.getAssociatedItems("serviceId1", "metaDataId1").size() == 0) | | 7 | if (store.getAssociatedItems("serviceId1", "metaDataId1").size() == 1) |
16 | System.out.println("Associated item size correct!"); | | 8 | System.out.println("Associated item size correct!"); |
| | | | |
17 | fail("Associated item size not correct, " + store.getAssociatedItems("serviceId1", "metaDataId1").size() + " should be 0"); | | 9 | fail("Associated item size not correct, " + store.getAssociatedItems("serviceId1", "metaDataId1").size() + " should be 1"); |
Precondition Violations (0)
Row |
Violation |