if ( "leading".equalsIgnoreCase( firstArg ) ) {
trailing = false;
}
else if ( "trailing".equalsIgnoreCase( firstArg ) ) {
leading = false;
}
else if ( "both".equalsIgnoreCase( firstArg ) ) {
}
else {
potentialTrimCharacterArgIndex = 0;
}
if ( "leading".equalsIgnoreCase( firstArg ) ) {
trailing = false;
}
else if ( "trailing".equalsIgnoreCase( firstArg ) ) {
leading = false;
}
else if ( "both".equalsIgnoreCase( firstArg ) ) {
}
else {
potentialTrimCharacterArgIndex = 0;
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/dialect/DerbyDialect.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/dialect/function/AbstractAnsiTrimEmulationFunction.java
|
Method name: String render(List, SessionFactoryImplementor)
|
|
Method name: String render(List, SessionFactoryImplementor)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | if ( "leading".equalsIgnoreCase( firstArg ) ) {↵ | | 1 | if ( "leading".equalsIgnoreCase( firstArg ) ) {↵
|
2 | trailing = false;↵ | | 2 | trailing = false;↵
|
3 | }↵ | | 3 | }↵
|
4 | else if ( "trailing".equalsIgnoreCase( firstArg ) ) {↵ | | 4 | else if ( "trailing".equalsIgnoreCase( firstArg ) ) {↵
|
5 | leading = false;↵ | | 5 | leading = false;↵
|
6 | }↵ | | 6 | }↵
|
7 | else if ( "both".equalsIgnoreCase( firstArg ) ) {↵ | | 7 | else if ( "both".equalsIgnoreCase( firstArg ) ) {↵
|
8 | }↵ | | 8 | }↵
|
9 | else {↵ | | 9 | else {↵
|
10 | potentialTrimCharacterArgIndex = 0;↵ | | 10 | potentialTrimCharacterArgIndex = 0;↵
|
11 | } | | 11 | }
|
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.8 |
Clones location | Clones are in different classes |
Number of node comparisons | 30 |
-
{Non-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) | 1.8 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
11 | if ("leading".equalsIgnoreCase(firstArg)) | | 11 | if ("leading".equalsIgnoreCase(firstArg)) |
12 | | | 12 | |
13 | else if ("trailing".equalsIgnoreCase(firstArg)) | | 13 | else if ("trailing".equalsIgnoreCase(firstArg)) |
14 | | | 14 | |
15 | else if ("both".equalsIgnoreCase(firstArg)) | | 15 | else if ("both".equalsIgnoreCase(firstArg)) |
| | | | |
16 | potentialTrimCharacterArgIndex = 0; | | 16 | potentialTrimCharacterArgIndex = 0; |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables potentialTrimCharacterArgIndex, trailing, leading , while Clone fragment #2 returns variables potentialTrimCharacterArgIndex, trailing, leading |