Test t = (Test) tests.nextElement();
if (t instanceof TestCase) {
String name = ((TestCase) t).getName();
if (name.endsWith("FailureExpected"))
failureExpected.add(name);
}
Test t = (Test) tests.nextElement();
if (t instanceof TestCase) {
String name = ((TestCase) t).getName();
if (name.endsWith("FailureExpected"))
failureExpected.add(name);
}
Clone fragments detected by clone detection tool
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/testing/src/main/java/org/hibernate/junit/UnitTestCase.java
|
Method name: TestSuite createFailureExpectedSuite(Class)
|
|
Method name: TestSuite createFailureExpectedSuite(Class)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | Test t = (Test) tests.nextElement();↵ | | 1 | Test t = (Test) tests.nextElement();↵
|
2 | ↵ | | |
|
3 | if (t instanceof TestCase) {↵ | | 2 | if (t instanceof TestCase) {↵
|
4 | ↵ | | |
|
5 | String name = ((TestCase) t).getName();↵ | | 3 | String name = ((TestCase) t).getName();↵
|
6 | ↵ | | |
|
7 | if (name.endsWith("FailureExpected"))↵ | | 4 | if (name.endsWith("FailureExpected"))↵
|
8 | ↵ | | |
|
9 | failureExpected.add(name);↵ | | 5 | failureExpected.add(name);↵
|
10 | ↵ | | |
|
11 | } | | 6 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 10 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
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.8 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
5 | Test t = (Test)tests.nextElement(); | | 5 | Test t = (Test)tests.nextElement(); |
6 | if (t instanceof TestCase) | | 6 | if (t instanceof TestCase) |
7 | String name = ((TestCase)t).getName(); | | 7 | String name = ((TestCase)t).getName(); |
8 | if (name.endsWith("FailureExpected")) | | 8 | if (name.endsWith("FailureExpected")) |
9 | failureExpected.add(name); | | 9 | failureExpected.add(name); |
Precondition Violations (0)
Row |
Violation |