File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/dialect/Dialect.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/dialect/resolver/DialectFactory.java | |||
Method name: Dialect getDialect(Properties)
|
Method name: Dialect buildDialect(Properties)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | String dialectName = props.getProperty( Environment.DIALECT );↵ | 1 | String dialectName = properties.getProperty( Environment.DIALECT );↵ | |
2 | if ( dialectName == null ) {↵ | 2 | if ( dialectName == null ) {↵ | |
3 | return getDialect();↵ | 3 | throw new HibernateException( "'hibernate.dialect' must be set when no Connection avalable" );↵ | |
4 | }↵ | 4 | }↵ | |
5 | return instantiateDialect( dialectName ); | 5 | return constructDialect( dialectName ); | |
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.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 8 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | String dialectName = props.getProperty(Environment.DIALECT); |
| 1 | String dialectName = properties.getProperty(Environment.DIALECT); | ||||||||||||
2 | if (dialectName == null) | 2 | if (dialectName == null) | |||||||||||||
|
| 3 | throw new HibernateException("'hibernate.dialect' must be set when no Connection avalable"); | |||||||||||||
3 | return getDialect(); |
| | |||||||||||||
4 | return instantiateDialect(dialectName); |
| 4 | return constructDialect(dialectName); |
Row | Violation |
---|---|
1 | Unmatched throw new HibernateException("'hibernate.dialect' must be set when no Connection avalable"); |
2 | Unmatched return getDialect(); |
3 | Expression instantiateDialect(dialectName) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression constructDialect(dialectName) cannot be parameterized, because it has dependencies to/from statements that will be extracted |