File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/hql/ast/util/SyntheticAndFactory.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/mapping/PersistentClass.java | |||
Method name: void addDiscriminatorWhereFragment(RestrictableStatement, Queryable, Map, String)
|
Method name: void checkColumnDuplication()
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | AST and = create( AND, "{and}" );↵ | |||
2 | AST currentFirstChild = statement.getWhereClause().getFirstChild();↵ | |||
3 | and.setFirstChild( discrimNode );↵ | |||
4 | and.addChild( currentFirstChild );↵ | |||
5 | statement.getWhereClause().setFirstChild( and ); | 1 | while ( iter.hasNext() ) {↵ | |
2 | cols.clear();↵ | |||
3 | Join join = (Join) iter.next();↵ | |||
4 | checkColumnDuplication( cols, join.getKey().getColumnIterator() );↵ | |||
5 | checkPropertyColumnDuplication( cols, join.getPropertyIterator() );↵ | |||
6 |
| |||
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.0 |
Clones location | Clones are in different classes |
Number of node comparisons | 20 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 8 | cols.clear(); | ||||||||||||||||||||||
|
| 9 | Join join = (Join)iter.next(); | |||||||||||||||||||||
11 | AST and = create(AND, "{and}"); | | ||||||||||||||||||||||
12 | AST currentFirstChild = statement.getWhereClause().getFirstChild(); | | ||||||||||||||||||||||
13 | and.setFirstChild(discrimNode); |
| 11 | checkPropertyColumnDuplication(cols, join.getPropertyIterator()); | ||||||||||||||||||||
14 | and.addChild(currentFirstChild); |
| 10 | checkColumnDuplication(cols, join.getKey().getColumnIterator()); | ||||||||||||||||||||
15 | statement.getWhereClause().setFirstChild(and); | |
Row | Violation |
---|---|
1 | Unmatched statement Join join=(Join)iter.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Expression and.setFirstChild(discrimNode) is a void method call, and thus it cannot be parameterized |
3 | Expression checkPropertyColumnDuplication(cols,join.getPropertyIterator()) is a void method call, and thus it cannot be parameterized |
4 | Expression and.setFirstChild(discrimNode) is a void method call, and thus it cannot be parameterized |
5 | Expression checkPropertyColumnDuplication(cols,join.getPropertyIterator()) is a void method call, and thus it cannot be parameterized |
6 | Expression and.addChild(currentFirstChild) is a void method call, and thus it cannot be parameterized |
7 | Expression checkColumnDuplication(cols,join.getKey().getColumnIterator()) is a void method call, and thus it cannot be parameterized |
8 | Expression and.addChild(currentFirstChild) is a void method call, and thus it cannot be parameterized |
9 | Expression checkColumnDuplication(cols,join.getKey().getColumnIterator()) is a void method call, and thus it cannot be parameterized |