assertTrue(
s.find("from Simple s where s.count > ( select min(sim.count) from Simple sim )").size()==2
);
t.commit();
t = s.beginTransaction();
assertTrue(
s.find("from Simple s where s = some( select sim from Simple sim where sim.count>=0 ) and s.count >= 0").size()==2
);
assertTrue(
s.find("from Simple s where s = some( select sim from Simple sim where sim.other.count=s.other.count ) and s.other.count > 0").size()==1
);
assertTrue(
s.find("from Simple s where s.count > ( select min(sim.count) from Simple sim )").size()==2
);
t.commit();
t = s.beginTransaction();
assertTrue(
s.find("from Simple s where s = some( select sim from Simple sim where sim.count>=0 ) and s.count >= 0").size()==2
);
assertTrue(
s.find("from Simple s where s = some( select sim from Simple sim where sim.other.count=s.other.count ) and s.other.count > 0").size()==1
);
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/dialect/functional/cache/SQLFunctionsInterSystemsTest.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/legacy/SQLFunctionsTest.java
|
Method name: void testSQLFunctions()
|
|
Method name: void testSQLFunctions()
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | assertTrue(
↵ | | 1 | assertTrue(↵
|
2 | s.find("from Simple s where s.count > ( select min(sim.count) from Simple sim )").size()==2
↵ | | 2 | s.find("from Simple s where s.count > ( select min(sim.count) from Simple sim )").size()==2↵
|
3 | );
↵ | | 3 | );↵
|
4 | t.commit();
↵ | | 4 | t.commit();↵
|
5 | t = s.beginTransaction();
↵ | | 5 | t = s.beginTransaction();↵
|
6 | assertTrue(
↵ | | 6 | assertTrue(↵
|
7 | s.find("from Simple s where s = some( select sim from Simple sim where sim.count>=0 ) and s.count >= 0").size()==2
↵ | | 7 | s.find("from Simple s where s = some( select sim from Simple sim where sim.count>=0 ) and s.count >= 0").size()==2↵
|
8 | );
↵ | | 8 | );↵
|
9 | assertTrue(
↵ | | 9 | assertTrue(↵
|
10 | s.find("from Simple s where s = some( select sim from Simple sim where sim.other.count=s.other.count ) and s.other.count > 0").size()==1
↵ | | 10 | s.find("from Simple s where s = some( select sim from Simple sim where sim.other.count=s.other.count ) and s.other.count > 0").size()==1↵
|
11 | ); | | 11 | );
|
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.0 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 25 |
-
{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.0 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
30 | assertTrue(s.find("from Simple s where s.count > ( select min(sim.count) from Simple sim )").size() == 2); | | 32 | assertTrue(s.find("from Simple s where s.count > ( select min(sim.count) from Simple sim )").size() == 2); |
31 | t.commit(); | | 33 | t.commit(); |
32 | t = s.beginTransaction(); | | 34 | t = s.beginTransaction(); |
33 | assertTrue(s.find("from Simple s where s = some( select sim from Simple sim where sim.count>=0 ) and s.count >= 0").size() == 2); | | 35 | assertTrue(s.find("from Simple s where s = some( select sim from Simple sim where sim.count>=0 ) and s.count >= 0").size() == 2); |
34 | assertTrue(s.find("from Simple s where s = some( select sim from Simple sim where sim.other.count=s.other.count ) and s.other.count > 0").size() == 1); | | 36 | assertTrue(s.find("from Simple s where s = some( select sim from Simple sim where sim.other.count=s.other.count ) and s.other.count > 0").size() == 1); |
Precondition Violations (0)
Row |
Violation |