File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/test/java/org/hibernate/test/util/CacheTestUtil.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cfg/ResultSetMappingBinder.java | |||
Method name: TestSuite createFailureExpectedSuite(Class)
|
Method name: java.util.Map bindPropertyResults(String, Element, PersistentClass, Mappings)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 7 | |||
1 | while (tests.hasMoreElements()) {↵ | 1 | while ( parentPropIter.hasNext() ) {↵ | |
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 | ↵ | 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;↵ | |||
10 | } | 8 | } | |
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 | 1 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 1.1 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| 38 | String currentPropertyName = ((Property)parentPropIter.next()).getName(); | ||||||||||||||
15 | String name = ((TestCase)t).getName(); |
| 39 | String currentName = reducedName + '.' + currentPropertyName; | |||||||||||||
16 | if (!failureExpected.contains(name + "FailureExpected")) |
| 40 | if (hasFollowers) | |||||||||||||
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 , while Clone fragment #2 returns variables currentName |