String token = tokens.nextToken();
result.append( token );
if ( isQuote( token ) ) {
quoted = !quoted;
}
else if ( !quoted ) {
if ( "is".equals( token ) ) {
result.append( "\n " );
}
}
String token = tokens.nextToken();
if ( isQuote( token ) ) {
quoted = !quoted;
}
else if ( !quoted ) {
if ( isBreak( token ) ) {
result.append( "\n " );
}
}
result.append( token );
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/jdbc/util/DDLFormatterImpl.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/jdbc/util/DDLFormatterImpl.java
|
Method name: String formatCommentOn(String)
|
|
Method name: String formatAlterTable(String)
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | String token = tokens.nextToken();↵ | | 1 | String token = tokens.nextToken();↵
|
2 | result.append( token );↵ | | 2 | ↵
|
3 | if ( isQuote( token ) ) {↵ | | 3 | if ( isQuote( token ) ) {↵
|
4 | quoted = !quoted;↵ | | 4 | quoted = !quoted;↵
|
5 | }↵ | | 5 | }↵
|
6 | else if ( !quoted ) {↵ | | 6 | else if ( !quoted ) {↵
|
7 | if ( "is".equals( token ) ) {↵ | | 7 | if ( isBreak( token ) ) {↵
|
8 | result.append( "\n " );↵ | | 8 | result.append( "\n " );↵
|
9 | }↵ | | 9 | }↵
|
10 | } | | 10 | }↵
|
| | | 11 | result.append( token );
|
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 14 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 7 |
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.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
5 | String token = tokens.nextToken(); | | 5 | String token = tokens.nextToken(); |
6 | result.append(token); | | 11 | result.append(token); |
7 | if (isQuote(token)) | | 6 | if (isQuote(token)) |
8 | | | 7 | |
9 | | | 8 | |
10 | | | 9 | |
11 | | | 10 | |
Precondition Violations (4)
Row |
Violation |
1 | Expression "is".equals(token) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression isBreak(token) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression "is".equals(token) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression isBreak(token) cannot be parameterized, because it has dependencies to/from statements that will be extracted |