File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/exception/CacheSQLStateConverter.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/exception/SQLStateConverter.java | |||
Method name: JDBCException convert(SQLException, String, String)
|
Method name: JDBCException convert(SQLException, String, String)
|
|||
Number of AST nodes: 10 | Number of AST nodes: 10 | |||
1 | if ( sqlStateClassCode != null ) { ↵ | 1 | if ( sqlStateClassCode != null ) {↵ | |
2 | if ( SQL_GRAMMAR_CATEGORIES.contains( sqlStateClassCode ) ) { ↵ | 2 | if ( SQL_GRAMMAR_CATEGORIES.contains( sqlStateClassCode ) ) {↵ | |
3 | return new SQLGrammarException( message, sqlException, sql ); ↵ | 3 | return new SQLGrammarException( message, sqlException, sql );↵ | |
4 | } ↵ | 4 | }↵ | |
5 | else if ( INTEGRITY_VIOLATION_CATEGORIES.contains( errorCode ) ) { ↵ | 5 | else if ( INTEGRITY_VIOLATION_CATEGORIES.contains( sqlStateClassCode ) ) {↵ | |
6 | String constraintName = extracter.extractConstraintName( sqlException ); ↵ | 6 | String constraintName = extracter.extractConstraintName( sqlException );↵ | |
7 | return new ConstraintViolationException( message, sqlException, sql, constraintName ); ↵ | 7 | return new ConstraintViolationException( message, sqlException, sql, constraintName );↵ | |
8 | } ↵ | 8 | }↵ | |
9 | else if ( CONNECTION_CATEGORIES.contains( sqlStateClassCode ) ) { ↵ | 9 | else if ( CONNECTION_CATEGORIES.contains( sqlStateClassCode ) ) {↵ | |
10 | return new JDBCConnectionException( message, sqlException, sql ); ↵ | 10 | return new JDBCConnectionException( message, sqlException, sql );↵ | |
11 | } ↵ | 11 | }↵ | |
12 | else if ( DATA_CATEGORIES.contains( sqlStateClassCode ) ) { ↵ | 12 | else if ( DATA_CATEGORIES.contains( sqlStateClassCode ) ) {↵ | |
13 | return new DataException( message, sqlException, sql ); ↵ | 13 | return new DataException( message, sqlException, sql );↵ | |
14 | } ↵ | 14 | }↵ | |
15 | } | 15 | } | |
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.9 |
Clones location | Clones are in different classes |
Number of node comparisons | 58 |
Number of mapped statements | 10 |
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) | 1.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | if (sqlStateClassCode != null) | 4 | if (sqlStateClassCode != null) | |||||||||||||||
4 | if (SQL_GRAMMAR_CATEGORIES.contains(sqlStateClassCode)) | 5 | if (SQL_GRAMMAR_CATEGORIES.contains(sqlStateClassCode)) | |||||||||||||||
5 | return new SQLGrammarException(message, sqlException, sql); | 6 | return new SQLGrammarException(message, sqlException, sql); | |||||||||||||||
6 | else if (INTEGRITY_VIOLATION_CATEGORIES.contains(errorCode)) |
| 7 | else if (INTEGRITY_VIOLATION_CATEGORIES.contains(sqlStateClassCode)) | ||||||||||||||
7 | String constraintName = extracter.extractConstraintName(sqlException); | 8 | String constraintName = extracter.extractConstraintName(sqlException); | |||||||||||||||
8 | return new ConstraintViolationException(message, sqlException, sql, constraintName); | 9 | return new ConstraintViolationException(message, sqlException, sql, constraintName); | |||||||||||||||
9 | else if (CONNECTION_CATEGORIES.contains(sqlStateClassCode)) | 10 | else if (CONNECTION_CATEGORIES.contains(sqlStateClassCode)) | |||||||||||||||
10 | return new JDBCConnectionException(message, sqlException, sql); | 11 | return new JDBCConnectionException(message, sqlException, sql); | |||||||||||||||
11 | else if (DATA_CATEGORIES.contains(sqlStateClassCode)) | 12 | else if (DATA_CATEGORIES.contains(sqlStateClassCode)) | |||||||||||||||
12 | return new DataException(message, sqlException, sql); | 13 | return new DataException(message, sqlException, sql); |
Row | Violation |
---|---|
1 | Type java.lang.Integer of variable errorCode does not match with type java.lang.String of variable sqlStateClassCode |