if (instance == null) {
synchronized (TagManager.class) {
if (instance == null)
instance = new TagManager();
}
}
return instance;
if (instance == null) {
synchronized (AssociationStore.class) {
if (instance == null)
instance = new AssociationStore();
}
}
return instance;
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/tagging/TagManager.java
|
|
File path: /columba-1.4-src/core/src/main/java/org/columba/core/association/AssociationStore.java
|
Method name: TagManager getInstance()
|
|
Method name: AssociationStore getInstance()
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if (instance == null) {↵ | | 1 | if (instance == null) {↵
|
2 | synchronized (TagManager.class) {↵ | | 2 | synchronized (AssociationStore.class) {↵
|
3 | if (instance == null)↵ | | 3 | if (instance == null)↵
|
4 | instance = new TagManager();↵ | | 4 | instance = new AssociationStore();↵
|
5 | }↵ | | 5 | }↵
|
6 | }↵ | | 6 | }↵
|
7 | return instance; | | 7 | return instance;
|
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 5 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.4 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
3 | if (instance == null) | | 3 | if (instance == null) |
| | | 4 | instance = new AssociationStore(); |
4 | instance = new TagManager(); | | | |
Precondition Violations (1)
Row |
Violation |
1 | Type org.columba.core.tagging.TagManager of variable instance does not match with type org.columba.core.association.AssociationStore of variable instance |