while (tests.hasMoreElements()) {
Test t = (Test) tests.nextElement();
if (t instanceof TestCase) {
String name = ((TestCase) t).getName();
if (!failureExpected.contains(name + "FailureExpected")) {
result.addTest(t);
}
}
}
while (tests.hasMoreElements()) {
Test t = (Test) tests.nextElement();
if (t instanceof TestCase) {
String name = ((TestCase) t).getName();
if (!failureExpected.contains(name + "FailureExpected")) {
result.addTest(t);
}
}
}
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: 6
|
|
Number of AST nodes: 6
|
|
1 | while (tests.hasMoreElements()) {↵ | | 1 | while (tests.hasMoreElements()) {
↵
|
2 | Test t = (Test) tests.nextElement();↵ | | 2 | Test t = (Test) tests.nextElement();
↵
|
3 | if (t instanceof TestCase) {↵ | | 3 | if (t instanceof TestCase) {
↵
|
4 | String name = ((TestCase) t).getName();↵ | | 4 | String name = ((TestCase) t).getName();
↵
|
5 | if (!failureExpected.contains(name + "FailureExpected")) {↵ | | 5 | if (!failureExpected.contains(name + "FailureExpected")) {
↵
|
6 | result.addTest(t);↵ | | 6 | result.addTest(t);
↵
|
7 | }↵ | | 7 | }
↵
|
8 | } ↵ | | 8 | }
↵
|
9 | } | | 9 | }
|
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.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 12 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 6 |
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.7 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
12 | while (tests.hasMoreElements()) | | 12 | while (tests.hasMoreElements()) |
13 | Test t = (Test)tests.nextElement(); | | 13 | Test t = (Test)tests.nextElement(); |
14 | if (t instanceof TestCase) | | 14 | if (t instanceof TestCase) |
15 | String name = ((TestCase)t).getName(); | | 15 | String name = ((TestCase)t).getName(); |
16 | if (!failureExpected.contains(name + "FailureExpected")) | | 16 | if (!failureExpected.contains(name + "FailureExpected")) |
17 | | | 17 | |
Precondition Violations (0)
Row |
Violation |