File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/tuple/entity/EntityMetamodel.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/tuple/entity/EntityMetamodel.java | |||
Method name: boolean hasPartialInsertComponentGeneration(Component)
|
Method name: boolean hasPartialUpdateComponentGeneration(Component)
|
|||
Number of AST nodes: 9 | Number of AST nodes: 9 | |||
1 | Iterator subProperties = component.getPropertyIterator();↵ | 1 | Iterator subProperties = component.getPropertyIterator();↵ | |
2 | while ( subProperties.hasNext() ) {↵ | 2 | while ( subProperties.hasNext() ) {↵ | |
3 | Property prop = ( Property ) subProperties.next();↵ | 3 | Property prop = ( Property ) subProperties.next();↵ | |
4 | if ( prop.getGeneration() == PropertyGeneration.ALWAYS || prop.getGeneration() == PropertyGeneration.INSERT ) {↵ | 4 | if ( prop.getGeneration() == PropertyGeneration.ALWAYS ) {↵ | |
5 | return true;↵ | 5 | return true;↵ | |
6 | }↵ | 6 | }↵ | |
7 | else if ( prop.getValue() instanceof Component ) {↵ | 7 | else if ( prop.getValue() instanceof Component ) {↵ | |
8 | if ( hasPartialInsertComponentGeneration( ( Component ) prop.getValue() ) ) {↵ | 8 | if ( hasPartialUpdateComponentGeneration( ( Component ) prop.getValue() ) ) {↵ | |
9 | return true;↵ | 9 | return true;↵ | |
10 | }↵ | 10 | }↵ | |
11 | }↵ | 11 | }↵ | |
12 | }↵ | 12 | }↵ | |
13 | return false; | 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.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 7 |
Number of mapped statements | 2 |
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.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7 | if (hasPartialInsertComponentGeneration((Component)prop.getValue())) |
| 7 | if (hasPartialUpdateComponentGeneration((Component)prop.getValue())) | ||||||||||
8 | return true; |
| 8 | return true; |
Row | Violation |
---|---|
1 | Conditional return true; |
2 | Conditional return true; |