if ( enabledFilters == null || enabledFilters.isEmpty() ) {
filterNames = Collections.EMPTY_SET;
}
else {
Set tmp = new HashSet();
tmp.addAll( enabledFilters.keySet() );
this.filterNames = Collections.unmodifiableSet( tmp );
}
if ( enabledFilters == null || enabledFilters.isEmpty() ) {
filterNames = Collections.EMPTY_SET;
}
else {
Set tmp = new HashSet();
tmp.addAll( enabledFilters.keySet() );
this.filterNames = Collections.unmodifiableSet( tmp );
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/engine/query/QueryPlanCache.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/engine/query/QueryPlanCache.java
|
Method name: void HQLQueryPlanKey(String, boolean, Map)
|
|
Method name: void FilterQueryPlanKey(String, String, boolean, Map)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if ( enabledFilters == null || enabledFilters.isEmpty() ) {↵ | | 1 | if ( enabledFilters == null || enabledFilters.isEmpty() ) {↵
|
2 | filterNames = Collections.EMPTY_SET;↵ | | 2 | filterNames = Collections.EMPTY_SET;↵
|
3 | }↵ | | 3 | }↵
|
4 | else {↵ | | 4 | else {↵
|
5 | Set tmp = new HashSet();↵ | | 5 | Set tmp = new HashSet();↵
|
6 | tmp.addAll( enabledFilters.keySet() );↵ | | 6 | tmp.addAll( enabledFilters.keySet() );↵
|
7 | this.filterNames = Collections.unmodifiableSet( tmp );↵ | | 7 | this.filterNames = Collections.unmodifiableSet( tmp );↵
|
8 | } | | 8 | }
|
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.2 |
Clones location | Clones are in the same java file |
Number of node comparisons | 25 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
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.2 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
3 | if (enabledFilters == null || enabledFilters.isEmpty()) | | 4 | if (enabledFilters == null || enabledFilters.isEmpty()) |
4 | filterNames = Collections.EMPTY_SET; | | 5 | filterNames = Collections.EMPTY_SET; |
| | | | |
5 | | | 6 | |
6 | tmp.addAll(enabledFilters.keySet()); | | 7 | tmp.addAll(enabledFilters.keySet()); |
7 | this.filterNames = Collections.unmodifiableSet(tmp); | | 8 | this.filterNames = Collections.unmodifiableSet(tmp); |
Precondition Violations (0)
Row |
Violation |