SQLWarning warnings = statement.getWarnings();
if ( warnings != null) {
JDBCExceptionReporter.logAndClearWarnings( connectionHelper.getConnection() );
}
while ( iter.hasNext() ) {
Object compValue = iter.next();
if (compValue != null) {
return checkComponentNullability(compValue, componentType);
}
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/tool/hbm2ddl/SchemaExport.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/engine/Nullability.java
|
Method name: void execute(boolean, boolean, Writer, Statement, String)
|
|
Method name: String checkSubElementsNullability(Type, Object)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 4
|
|
1 | SQLWarning warnings = statement.getWarnings↵ | | 1 | while ( iter.hasNext() ) {↵
|
2 | ();↵ | | 2 | Object compValue = iter.next();↵
|
3 | if ( warnings != null) {↵ | | 3 | if (compValue != null) {↵
|
4 | JDBCExceptionReporter.logAndClearWarnings( connectionHelper.getConnection() );↵ | | 4 | return checkComponentNullability(compValue, componentType);↵
|
| | | 5 | }↵
|
5 | } | | 6 | }
|
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 | 6 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 0.4 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
| | | 10 | Object compValue = iter.next(); |
13 | if (warnings != null) | | 11 | if (compValue != null) |
| | | 12 | return checkComponentNullability(compValue, componentType); |
14 | JDBCExceptionReporter.logAndClearWarnings(connectionHelper.getConnection()); | | | |
Precondition Violations (3)
Row |
Violation |
1 | Unmatched statement Object compValue=iter.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Type java.sql.SQLWarning of variable warnings does not match with type java.lang.Object of variable compValue |
3 | Unmatched return checkComponentNullability(compValue,componentType); |