File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/hql/ast/exec/AbstractStatementExecutor.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/hql/ast/exec/AbstractStatementExecutor.java | |||
Method name: void dropTemporaryTableIfNecessary(Queryable, SessionImplementor)
|
Method name: void createTemporaryTableIfNecessary(Queryable, SessionImplementor)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | IsolatedWork work = new IsolatedWork() {↵ | 1 | IsolatedWork work = new IsolatedWork() {↵ | |
2 | public void doWork(Connection connection) throws HibernateException {↵ | 2 | public void doWork(Connection connection) throws HibernateException {↵ | |
3 | Statement stmnt = null;↵ | 3 | Statement stmnt = null;↵ | |
4 | try {↵ | 4 | try {↵ | |
5 | stmnt = connection.createStatement();↵ | 5 | stmnt = connection.createStatement();↵ | |
6 | stmnt.executeUpdate( "drop table " + persister.getTemporaryIdTableName() );↵ | 6 | stmnt.executeUpdate( persister.getTemporaryIdTableDDL() );↵ | |
7 | }↵ | 7 | }↵ | |
8 | catch( Throwable t ) {↵ | 8 | catch( Throwable t ) {↵ | |
9 | log.warn( "unable to drop temporary id table after use [" + t.getMessage() + "]" );↵ | 9 | log.debug( "unable to create temporary id table [" + t.getMessage() + "]" );↵ | |
10 | }↵ | 10 | }↵ | |
11 | finally {↵ | 11 | finally {↵ | |
12 | if ( stmnt != null ) {↵ | 12 | if ( stmnt != null ) {↵ | |
13 | try {↵ | 13 | try {↵ | |
14 | stmnt.close();↵ | 14 | stmnt.close();↵ | |
15 | }↵ | 15 | }↵ | |
16 | catch( Throwable ignore ) {↵ | 16 | catch( Throwable ignore ) {↵ | |
17 | // ignore↵ | 17 | // ignore↵ | |
18 | }↵ | 18 | }↵ | |
19 | }↵ | 19 | }↵ | |
20 | }↵ | 20 | }↵ | |
21 | }↵ | 21 | }↵ | |
22 | };↵ | 22 | };↵ | |
23 | if ( shouldIsolateTemporaryTableDDL() ) {↵ | 23 | if ( shouldIsolateTemporaryTableDDL() ) {↵ | |
24 | if ( getFactory().getSettings().isDataDefinitionInTransactionSupported() ) {↵ | 24 | if ( getFactory().getSettings().isDataDefinitionInTransactionSupported() ) {↵ | |
25 | Isolater.doIsolatedWork( work, session );↵ | 25 | Isolater.doIsolatedWork( work, session );↵ | |
26 | }↵ | 26 | }↵ | |
27 | else {↵ | 27 | else {↵ | |
28 | Isolater.doNonTransactedWork( work, session );↵ | 28 | Isolater.doNonTransactedWork( work, session );↵ | |
29 | }↵ | 29 | }↵ | |
30 | }↵ | 30 | }↵ | |
31 | else {↵ | 31 | else {↵ | |
32 | work.doWork( session.getJDBCContext().getConnectionManager().getConnection() );↵ | 32 | work.doWork( session.getJDBCContext().getConnectionManager().getConnection() );↵ | |
33 | session.getJDBCContext().getConnectionManager().afterStatement();↵ | 33 | session.getJDBCContext().getConnectionManager().afterStatement();↵ | |
34 | } | 34 | } | |
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 19 |
Number of mapped statements | 7 |
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) | 4.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | IsolatedWork work = new IsolatedWork() {...}; |
| 1 | IsolatedWork work = new IsolatedWork() {...}; | ||||||||||||||||||||
3 | if (shouldIsolateTemporaryTableDDL()) | 2 | if (shouldIsolateTemporaryTableDDL()) | |||||||||||||||||||||
4 | if (getFactory().getSettings().isDataDefinitionInTransactionSupported()) | 3 | if (getFactory().getSettings().isDataDefinitionInTransactionSupported()) | |||||||||||||||||||||
5 | Isolater.doIsolatedWork(work, session); | 4 | Isolater.doIsolatedWork(work, session); | |||||||||||||||||||||
else | else | |||||||||||||||||||||||
6 | Isolater.doNonTransactedWork(work, session); | 5 | Isolater.doNonTransactedWork(work, session); | |||||||||||||||||||||
else | else | |||||||||||||||||||||||
7 | work.doWork(session.getJDBCContext().getConnectionManager().getConnection()); | 6 | work.doWork(session.getJDBCContext().getConnectionManager().getConnection()); | |||||||||||||||||||||
8 | session.getJDBCContext().getConnectionManager().afterStatement(); | 7 | session.getJDBCContext().getConnectionManager().afterStatement(); |
Row | Violation |
---|---|
1 | Expression log.warn("unable to drop temporary id table after use [" + t.getMessage() + "]") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression log.debug("unable to create temporary id table [" + t.getMessage() + "]") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression log.warn("unable to drop temporary id table after use [" + t.getMessage() + "]") is a void method call, and thus it cannot be parameterized |
4 | Expression log.debug("unable to create temporary id table [" + t.getMessage() + "]") is a void method call, and thus it cannot be parameterized |