File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/proxy/ProxyTest.java | File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/reattachment/ProxyReattachmentTest.java | |||
Method name: void testFullyLoadedPCSerialization()
|
Method name: void testIterateWithEvictTopOfLoop()
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | for ( int dp_indx = 0; dp_indx < nestedDataPointCount; dp_indx++ ) {↵ | |||
2 | DataPoint dp = new DataPoint();↵ | |||
3 | dp.setDescription( "data-point [" + c_indx + ", " + dp_indx + "]" );↵ | |||
4 | // more HSQLDB fun...↵ | |||
5 | // dp.setX( new BigDecimal( c_indx )↵ | 1 | Parent p = new Parent( String.valueOf( i + 100 ) );↵ | |
2 | Child child = new Child( "child" + i );↵ | |||
6 | );↵ | 3 | child.setParent( p ); ↵ | |
7 | dp.setX( new BigDecimal( c_indx + dp_indx ) );↵ | 4 | p.getChildren().add( child ); ↵ | |
8 | dp.setY( new BigDecimal( dp_indx ) );↵ | 5 | s.save( p ); ↵ | |
9 | container.getDataPoints().add( dp );↵ | 6 | parents.add(↵ | |
10 | } | 7 |
| |
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 having the same super class |
Number of node comparisons | 27 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11 | DataPoint dp = new DataPoint(); |
| 5 | Parent p = new Parent(String.valueOf(i + 100)); | |||||||||||||
| 6 | Child child = new Child("child" + i); | |||||||||||||||
|
| 7 | child.setParent(p); | ||||||||||||||
|
| 8 | p.getChildren().add(child); | ||||||||||||||
|
| 9 | s.save(p); | ||||||||||||||
12 | dp.setDescription("data-point [" + c_indx + ", " + dp_indx + "]"); |
| | ||||||||||||||
13 | dp.setX(new BigDecimal(c_indx + dp_indx)); |
| | ||||||||||||||
14 | dp.setY(new BigDecimal(dp_indx)); |
| | ||||||||||||||
15 | container.getDataPoints().add(dp); |
| 10 | parents.add(p); |
Row | Violation |
---|---|
1 | Unmatched statement child.setParent(p); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement p.getChildren().add(child); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement s.save(p); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement dp.setDescription("data-point [" + c_indx + ", "+ dp_indx+ "]"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement dp.setX(new BigDecimal(c_indx + dp_indx)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement dp.setY(new BigDecimal(dp_indx)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Clone fragment #1 returns variable dp with type org.hibernate.test.proxy.DataPoint , while Clone fragment #2 returns variable p with type org.hibernate.test.reattachment.Parent |