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: 9 | Number of AST nodes: 9 | |||
1 | if ( SQL_GRAMMAR_CATEGORIES.contains( sqlStateClassCode ) ) { ↵ | 1 | if ( SQL_GRAMMAR_CATEGORIES.contains( sqlStateClassCode ) ) {↵ | |
2 | return new SQLGrammarException( message, sqlException, sql ); ↵ | 2 | return new SQLGrammarException( message, sqlException, sql );↵ | |
3 | } ↵ | 3 | }↵ | |
4 | else if ( INTEGRITY_VIOLATION_CATEGORIES.contains( errorCode ) ) { ↵ | 4 | else if ( INTEGRITY_VIOLATION_CATEGORIES.contains( sqlStateClassCode ) ) {↵ | |
5 | String constraintName = extracter.extractConstraintName( sqlException ); ↵ | 5 | String constraintName = extracter.extractConstraintName( sqlException );↵ | |
6 | return new ConstraintViolationException( message, sqlException, sql, constraintName ); ↵ | 6 | return new ConstraintViolationException( message, sqlException, sql, constraintName );↵ | |
7 | } ↵ | 7 | }↵ | |
8 | else if ( CONNECTION_CATEGORIES.contains( sqlStateClassCode ) ) { ↵ | 8 | else if ( CONNECTION_CATEGORIES.contains( sqlStateClassCode ) ) {↵ | |
9 | return new JDBCConnectionException( message, sqlException, sql ); ↵ | 9 | return new JDBCConnectionException( message, sqlException, sql );↵ | |
10 | } ↵ | 10 | }↵ | |
11 | else if ( DATA_CATEGORIES.contains( sqlStateClassCode ) ) { ↵ | 11 | else if ( DATA_CATEGORIES.contains( sqlStateClassCode ) ) {↵ | |
12 | return new DataException( message, sqlException, sql ); ↵ | 12 | return new DataException( message, sqlException, sql );↵ | |
13 | } | 13 | } | |
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 | 9 |
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 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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 |