if ( !quotedIdentifier && ( dialect.openQuote()==token.charAt(0) ) ) {
isOpenQuote = true;
quotedIdentifier = true;
isQuoteCharacter = true;
}
else if ( quotedIdentifier && ( dialect.closeQuote()==token.charAt(0) ) ) {
quotedIdentifier = false;
isQuoteCharacter = true;
isOpenQuote = false;
}
else {
isOpenQuote = false;
}
if ( !quotedIdentifier && ( dialect.openQuote()==token.charAt(0) ) ) {
isOpenQuote = true;
quotedIdentifier = true;
isQuoteCharacter = true;
}
else if ( quotedIdentifier && ( dialect.closeQuote()==token.charAt(0) ) ) {
quotedIdentifier = false;
isQuoteCharacter = true;
isOpenQuote = false;
}
else {
isOpenQuote = false;
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/sql/Template.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/sql/Template.java
|
Method name: String renderWhereStringTemplate(String, String, Dialect, SQLFunctionRegistry)
|
|
Method name: String renderOrderByStringTemplate(String, Dialect, SQLFunctionRegistry)
|
Number of AST nodes: 9
|
|
Number of AST nodes: 9
|
|
1 | if ( !quotedIdentifier && ( dialect.openQuote()==token.charAt(0) ) ) {↵ | | 1 | if ( !quotedIdentifier && ( dialect.openQuote()==token.charAt(0) ) ) {↵
|
2 | isOpenQuote = true;↵ | | 2 | isOpenQuote = true;↵
|
3 | quotedIdentifier = true; ↵ | | 3 | quotedIdentifier = true; ↵
|
4 | isQuoteCharacter = true;↵ | | 4 | isQuoteCharacter = true;↵
|
5 | }↵ | | 5 | }↵
|
6 | else if ( quotedIdentifier && ( dialect.closeQuote()==token.charAt(0) ) ) {↵ | | 6 | else if ( quotedIdentifier && ( dialect.closeQuote()==token.charAt(0) ) ) {↵
|
7 | quotedIdentifier = false;↵ | | 7 | quotedIdentifier = false;↵
|
8 | isQuoteCharacter = true;↵ | | 8 | isQuoteCharacter = true;↵
|
9 | isOpenQuote = false;↵ | | 9 | isOpenQuote = false;↵
|
10 | }↵ | | 10 | }↵
|
11 | else {↵ | | 11 | else {↵
|
12 | isOpenQuote = false;↵ | | 12 | isOpenQuote = false;↵
|
13 | } | | 13 | }
|
See real code fragment |
|
See real code fragment |
Summary
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.9 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 64 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 9 |
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) | 6.0 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
27 | else if (!quotedIdentifier && (dialect.openQuote() == token.charAt(0))) | | 24 | else if (!quotedIdentifier && (dialect.openQuote() == token.charAt(0))) |
28 | | | 25 | |
29 | | | 26 | |
30 | | | 27 | |
31 | else if (quotedIdentifier && (dialect.closeQuote() == token.charAt(0))) | | 28 | else if (quotedIdentifier && (dialect.closeQuote() == token.charAt(0))) |
32 | quotedIdentifier = false; | | 29 | quotedIdentifier = false; |
33 | | | 30 | |
34 | | | 31 | |
| | | | |
35 | | | 32 | |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables quotedIdentifier, isOpenQuote, isQuoteCharacter , while Clone fragment #2 returns variables quotedIdentifier, isOpenQuote, isQuoteCharacter |