File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/util/JDBCExceptionReporter.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/util/JDBCExceptionReporter.java | |||
Method name: void logWarnings(SQLWarning, String)
|
Method name: void logExceptions(SQLException, String)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | StringBuffer buf = new StringBuffer(30)↵ | 1 | StringBuffer buf = new StringBuffer(30)↵ | |
2 | .append( "SQL Warning: ")↵ | 2 | .append( "SQL Error: " )↵ | |
3 | .append( warning.getErrorCode() )↵ | 3 | .append( ex.getErrorCode() )↵ | |
4 | .append( ", SQLState: ")↵ | 4 | .append( ", SQLState: " )↵ | |
5 | .append( warning.getSQLState() );↵ | 5 | .append( ex.getSQLState() );↵ | |
6 | log.warn( buf.toString() );↵ | 6 | log.warn( buf.toString() );↵ | |
7 | log.warn( warning.getMessage() );↵ | 7 | log.error( ex.getMessage() );↵ | |
8 | warning = warning.getNextWarning(); | 8 | ex = ex.getNextException(); | |
See real code fragment | See real code fragment |
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.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 11 |
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) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6 | StringBuffer buf = new StringBuffer(30).append("SQL Warning: ").append(warning.getErrorCode()).append(", SQLState: ").append(warning.getSQLState()); |
| 6 | StringBuffer buf = new StringBuffer(30).append("SQL Error: ").append(ex.getErrorCode()).append(", SQLState: ").append(ex.getSQLState()); | ||||||||||||||||||||||
7 | log.warn(buf.toString()); | 7 | log.warn(buf.toString()); | |||||||||||||||||||||||
8 | log.warn(warning.getMessage()); |
| 8 | log.error(ex.getMessage()); | ||||||||||||||||||||||
9 | warning = warning.getNextWarning(); |
| 9 | ex = ex.getNextException(); |
Row | Violation |
---|---|
1 | Expression log.warn(warning.getMessage()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression log.error(ex.getMessage()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression log.warn(warning.getMessage()) is a void method call, and thus it cannot be parameterized |
4 | Expression log.error(ex.getMessage()) is a void method call, and thus it cannot be parameterized |
5 | Clone fragment #1 returns variable warning with type java.sql.SQLWarning , while Clone fragment #2 returns variable ex with type java.sql.SQLException |