Iterator itr = collection.iterator();
while ( itr.hasNext() ) {
assertClassAssignability( itr.next().getClass(), clazz );
}
if ( dialect.supportsTableCheck() ) {
Iterator chiter = checkConstraints.iterator();
while ( chiter.hasNext() ) {
buf.append( ", check (" )
.append( chiter.next() )
.append( ')' );
}
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/testing/src/main/java/org/hibernate/junit/UnitTestCase.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/mapping/Table.java
|
Method name: void assertElementTypeAssignability(java.util.Collection, Class)
|
|
Method name: String sqlCreateString(Dialect, Mapping, String, String)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 4
|
|
| | | 1 | if ( dialect.supportsTableCheck() ) {↵
|
1 | Iterator itr = collection.iterator();
↵ | | 2 | Iterator chiter = checkConstraints.iterator();↵
|
2 | while ( itr.hasNext() ) {
↵ | | 3 | while ( chiter.hasNext() ) {↵
|
3 | assertClassAssignability( ↵ | | 4 | buf.append( ", check (" )↵
|
4 | itr.next().getClass(), clazz );
↵ | | 5 | .append( chiter.next() )↵
|
| | | 6 | .append( ')' );↵
|
| | | 7 | }↵
|
5 | } | | 8 | }
|
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.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 5 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 2 |
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.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | Iterator itr = collection.iterator(); | | 44 | Iterator chiter = checkConstraints.iterator(); |
2 | while (itr.hasNext()) | | 45 | while (chiter.hasNext()) |
3 | assertClassAssignability(itr.next().getClass(), clazz); | | | |
| | | 46 | buf.append(", check (").append(chiter.next()).append(')'); |
Precondition Violations (1)
Row |
Violation |
1 | Type java.util.Collection of variable collection does not match with type java.util.List of variable checkConstraints |