File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cfg/HbmBinder.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cfg/HbmBinder.java | |||
Method name: void bindProperty(Element, Property, Mappings, java.util.Map)
|
Method name: void bindProperty(Element, Property, Mappings, java.util.Map)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | if ( property.isUpdateable() && generation == PropertyGeneration.ALWAYS ) {↵ | 1 | if ( property.isInsertable() ) {↵ | |
2 | if ( updateNode == null ) {↵ | 2 | if ( insertNode == null ) {↵ | |
3 | // updateable only because the user did not specify ↵ | 3 | // insertable simply because that is the user did not specify↵ | |
4 | // anything; just override it↵ | 4 | // anything; just override it↵ | |
5 | property.setUpdateable( false );↵ | 5 | property.setInsertable( false );↵ | |
6 | }↵ | 6 | }↵ | |
7 | else {↵ | 7 | else {↵ | |
8 | // the user specifically supplied update="true",↵ | 8 | // the user specifically supplied insert="true",↵ | |
9 | // which constitutes an illegal combo↵ | 9 | // which constitutes an illegal combo↵ | |
10 | throw new MappingException(↵ | 10 | throw new MappingException(↵ | |
11 | "cannot specify both update=\"true\" and generated=\"" + generation.getName() +↵ | 11 | "cannot specify both insert=\"true\" and generated=\"" + generation.getName() +↵ | |
12 | "\" for property: " +↵ | 12 | "\" for property: " +↵ | |
13 | propName↵ | 13 | propName↵ | |
14 | );↵ | 14 | );↵ | |
15 | }↵ | 15 | }↵ | |
16 | } | 16 |
| |
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.2 |
Clones location | Clones are in the same method |
Number of node comparisons | 10 |
Number of mapped statements | 3 |
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) | 0.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
31 | if (updateNode == null) |
| 27 | if (insertNode == null) | ||||||||||||
32 | property.setUpdateable(false); |
| 28 | property.setInsertable(false); | ||||||||||||
else | else | |||||||||||||||
33 | throw new MappingException("cannot specify both update=\"true\" and generated=\"" + generation.getName() + "\" for property: " + propName); |
| 29 | throw new MappingException("cannot specify both insert=\"true\" and generated=\"" + generation.getName() + "\" for property: " + propName); |
Row | Violation |
---|---|
1 | Expression property.setUpdateable(false) is a void method call, and thus it cannot be parameterized |
2 | Expression property.setInsertable(false) is a void method call, and thus it cannot be parameterized |