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: 5 | Number of AST nodes: 5 | |||
1 | while (warning != null) {↵ | 1 | while (ex != null) {↵ | |
2 | StringBuffer buf = new StringBuffer(30)↵ | 2 | StringBuffer buf = new StringBuffer(30)↵ | |
3 | .append( "SQL Warning: ")↵ | 3 | .append( "SQL Error: " )↵ | |
4 | .append( warning.getErrorCode() )↵ | 4 | .append( ex.getErrorCode() )↵ | |
5 | .append( ", SQLState: ")↵ | 5 | .append( ", SQLState: " )↵ | |
6 | .append( warning.getSQLState() );↵ | 6 | .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();↵ | |
10 | } | 10 |
| |
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 26 |
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) | 2.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5 | while (warning != null) |
| 5 | while (ex != null) | ||||||||||||||||||||||||
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 | Expression warning.getNextWarning() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression ex.getNextException() cannot be parameterized, because it has dependencies to/from statements that will be extracted |