File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cfg/ResultSetMappingBinder.java | File path: /hibernate-distribution-3.3.2.GA/project/testing/src/main/java/org/hibernate/junit/UnitTestCase.java | |||
Method name: java.util.Map bindPropertyResults(String, Element, PersistentClass, Mappings)
|
Method name: TestSuite createFailureExpectedSuite(Class)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 6 | |||
1 | while ( parentPropIter.hasNext() ) {↵ | 1 | while (tests.hasMoreElements()) {↵ | |
2 | String currentPropertyName = ( (Property) parentPropIter.next() ).getName();↵ | |||
3 | String currentName = reducedName + '.' + currentPropertyName;↵ | |||
4 | if (hasFollowers) {↵ | |||
5 | followers.add( currentName );↵ | |||
6 | }↵ | |||
7 | if ( name.equals( currentName ) ) hasFollowers = true;↵ | |||
8 | ↵ | |||
2 | Test t = (Test) tests.nextElement();↵ | |||
3 | if (t instanceof TestCase) {↵ | |||
4 | String name = ((TestCase) t).getName();↵ | |||
5 | if (!failureExpected.contains(name + "FailureExpected")) {↵ | |||
6 | result.addTest(t);↵ | |||
7 | }↵ | |||
8 | } ↵ | |||
9 | } | 9 | } | |
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 | 9 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.1 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
38 | String currentPropertyName = ((Property)parentPropIter.next()).getName(); |
| | ||||||||||||||
39 | String currentName = reducedName + '.' + currentPropertyName; |
| 15 | String name = ((TestCase)t).getName(); | |||||||||||||
40 | if (hasFollowers) |
| 16 | if (!failureExpected.contains(name + "FailureExpected")) | |||||||||||||
| 17 | result.addTest(t); | |||||||||||||||
41 | followers.add(currentName); |
| |
Row | Violation |
---|---|
1 | Unmatched statement String currentPropertyName=((Property)parentPropIter.next()).getName(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Expression !failureExpected.contains(name + "FailureExpected") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement followers.add(currentName); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Clone fragment #1 returns variables currentName , while Clone fragment #2 returns variables |