while ( iter.hasNext() ) {
String[] lines = ( (PersistentIdentifierGenerator) iter.next() ).sqlDropStrings( dialect );
for ( int i = 0; i < lines.length ; i++ ) {
script.add( lines[i] );
}
}
while ( iter.hasNext() ) {
String[] lines = ( (PersistentIdentifierGenerator) iter.next() ).sqlCreateStrings( dialect );
for ( int i = 0; i < lines.length ; i++ ) {
script.add( lines[i] );
}
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cfg/Configuration.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cfg/Configuration.java
|
Method name: String[] generateDropSchemaScript(Dialect)
|
|
Method name: String[] generateSchemaCreationScript(Dialect)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | while ( iter.hasNext() ) {↵ | | 1 | while ( iter.hasNext() ) {↵
|
2 | String[] lines = ( (PersistentIdentifierGenerator) iter.next() ).sqlDropStrings( dialect );↵ | | 2 | String[] lines = ( (PersistentIdentifierGenerator) iter.next() ).sqlCreateStrings( dialect );↵
|
3 | for ( int i = 0; i < lines.length ; i++ ) {↵ | | 3 | for ( int i = 0; i < lines.length ; i++ ) {↵
|
4 | script.add( lines[i] );↵ | | 4 | script.add( lines[i] );↵
|
5 | }↵ | | 5 | }↵
|
6 | } | | 6 | }
|
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 | 4 |
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) | 4.1 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
26 | while (iter.hasNext()) | | 35 | while (iter.hasNext()) |
27 | String[] lines = ((PersistentIdentifierGenerator)iter.next()).sqlDropStrings(dialect); | | 36 | String[] lines = ((PersistentIdentifierGenerator)iter.next()).sqlCreateStrings(dialect); |
28 | for (int i = 0; i < lines.length; i++) | | 37 | for (int i = 0; i < lines.length; i++) |
29 | | | 38 | |
Precondition Violations (2)
Row |
Violation |
1 | Expression ((PersistentIdentifierGenerator)iter.next()).sqlDropStrings(dialect) is a method call throwing exception(s) that should be caught by a try block that will be extracted |
2 | Expression ((PersistentIdentifierGenerator)iter.next()).sqlCreateStrings(dialect) is a method call throwing exception(s) that should be caught by a try block that will be extracted |