File path: /hibernate-distribution-3.3.2.GA/project/connection-c3p0/src/main/java/org/hibernate/connection/C3P0ConnectionProvider.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/connection/DriverManagerConnectionProvider.java | |||
Method name: void configure(Properties)
|
Method name: void configure(Properties)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | if ( jdbcDriverClass == null ) {↵ | 1 | if (driverClass==null) {↵ | |
2 | log.warn( "No JDBC Driver class was specified by property " + Environment.DRIVER );↵ | 2 | log.warn("no JDBC Driver class was specified by property " + Environment.DRIVER);↵ | |
3 | }↵ | 3 | }↵ | |
4 | else {↵ | 4 | else {↵ | |
5 | try {↵ | 5 | try {↵ | |
6 | ↵ | 6 | // trying via forName() first to be as close to DriverManager's semantics↵ | |
7 | Class.forName( jdbcDriverClass );↵ | 7 | Class.forName(driverClass);↵ | |
8 | }↵ | 8 | }↵ | |
9 | catch ( ClassNotFoundException cnfe ) {↵ | 9 | catch (ClassNotFoundException cnfe) {↵ | |
10 | try {↵ | 10 | try {↵ | |
11 | ReflectHelper.classForName( jdbcDriverClass );↵ | 11 | ReflectHelper.classForName(driverClass);↵ | |
12 | }↵ | 12 | }↵ | |
13 | catch ( ClassNotFoundException e ) {↵ | 13 | catch (ClassNotFoundException e) {↵ | |
14 | String msg = "JDBC Driver class not found: " + jdbcDriverClass;↵ | 14 | String msg = "JDBC Driver class not found: " + driverClass;↵ | |
15 | log.error( msg, e );↵ | 15 | log.error( msg, e );↵ | |
16 | throw new HibernateException( msg, e );↵ | 16 | throw new HibernateException(msg, e);↵ | |
17 | }↵ | 17 | }↵ | |
18 | }↵ | 18 | }↵ | |
19 | } | 19 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.5 |
Clones location | Clones are in different classes |
Number of node comparisons | 8 |
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) | 1.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8 | if (jdbcDriverClass == null) |
| 10 | if (driverClass == null) | |||||||||||||
9 | log.warn("No JDBC Driver class was specified by property " + Environment.DRIVER); |
| 11 | log.warn("no JDBC Driver class was specified by property " + Environment.DRIVER); | |||||||||||||
else | else | ||||||||||||||||
10 | try |
| 12 | try | |||||||||||||
11 | Class.forName(jdbcDriverClass); |
| 13 | Class.forName(driverClass); |
Row | Violation |
---|