if ((store.getAssociatedItems("serviceId1", "metaDataId1") != null)
&& (store.getAssociatedItems("serviceId1", "metaDataId1")
.size() == 1)
&& ((String) (store.getAssociatedItems("serviceId1",
"metaDataId1").toArray()[0])).equals("itemId1"))
System.out.println("Correct value 'itemId1' found");
else
fail("Associated item not found "
+ store.getAssociatedItems("serviceId1", "metaDataId1")
.size());
if ((store.getAssociatedItems("serviceId1", "metaDataId1") != null)
&& (store.getAssociatedItems("serviceId1", "metaDataId1")
.size() == 1)
&& ((String) (store.getAssociatedItems("serviceId1",
"metaDataId1").toArray()[0])).equals("itemId1"))
System.out.println("Correct value 'itemId1' found");
else
fail("Associated item not found "
+ store.getAssociatedItems("serviceId1", "metaDataId1")
.size());
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 testAddAssociation()
|
|
Method name: void testGetAssociatedItems()
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | if ((store.getAssociatedItems("serviceId1", "metaDataId1") != null)↵ | | 1 | if ((store.getAssociatedItems("serviceId1", "metaDataId1") != null)↵
|
2 | && (store.getAssociatedItems("serviceId1", "metaDataId1")↵ | | 2 | && (store.getAssociatedItems("serviceId1", "metaDataId1")↵
|
3 | .size() == 1)↵ | | 3 | .size() == 1)↵
|
4 | && ((String) (store.getAssociatedItems("serviceId1",↵ | | 4 | && ((String) (store.getAssociatedItems("serviceId1",↵
|
5 | "metaDataId1").toArray()[0])).equals("itemId1"))↵ | | 5 | "metaDataId1").toArray()[0])).equals("itemId1"))↵
|
6 | System.out.println("Correct value 'itemId1' found");↵ | | 6 | System.out.println("Correct value 'itemId1' found");↵
|
7 | else↵ | | 7 | else↵
|
8 | fail("Associated item not found "↵ | | 8 | fail("Associated item not found "↵
|
9 | + store.getAssociatedItems("serviceId1", "metaDataId1")↵ | | 9 | + store.getAssociatedItems("serviceId1", "metaDataId1")↵
|
10 | .size()); | | 10 | .size());
|
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.7 |
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) | 0.8 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
2 | if ((store.getAssociatedItems("serviceId1", "metaDataId1") != null) && (store.getAssociatedItems("serviceId1", "metaDataId1").size() == 1) && ((String)(store.getAssociatedItems("serviceId1", "metaDataId1").toArray()[0])).equals("itemId1")) | | 2 | if ((store.getAssociatedItems("serviceId1", "metaDataId1") != null) && (store.getAssociatedItems("serviceId1", "metaDataId1").size() == 1) && ((String)(store.getAssociatedItems("serviceId1", "metaDataId1").toArray()[0])).equals("itemId1")) |
3 | System.out.println("Correct value 'itemId1' found"); | | 3 | System.out.println("Correct value 'itemId1' found"); |
| | | | |
4 | fail("Associated item not found " + store.getAssociatedItems("serviceId1", "metaDataId1").size()); | | 4 | fail("Associated item not found " + store.getAssociatedItems("serviceId1", "metaDataId1").size()); |
Precondition Violations (0)
Row |
Violation |