if ( args[i].startsWith( "--config=" ) ) {
cfg.configure( args[i].substring( 9 ) );
}
else if ( args[i].startsWith( "--naming=" ) ) {
cfg.setNamingStrategy(
( NamingStrategy ) ReflectHelper.classForName( args[i].substring( 9 ) )
.newInstance()
);
}
if ( args[i].startsWith( "--config=" ) ) {
cfg.configure( args[i].substring( 9 ) );
}
else if ( args[i].startsWith( "--naming=" ) ) {
cfg.setNamingStrategy(
( NamingStrategy ) ReflectHelper.classForName( args[i].substring( 9 ) ).newInstance()
);
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/tool/hbm2ddl/SchemaExport.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/tool/hbm2ddl/SchemaValidator.java
|
Method name: void main(String[])
|
|
Method name: void main(String[])
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | if ( args[i].startsWith( "--config=" ) ) {↵ | | 1 | if ( args[i].startsWith( "--config=" ) ) {↵
|
2 | cfg.configure( args[i].substring( 9 ) );↵ | | 2 | cfg.configure( args[i].substring( 9 ) );↵
|
3 | }↵ | | 3 | }↵
|
4 | else if ( args[i].startsWith( "--naming=" ) ) {↵ | | 4 | else if ( args[i].startsWith( "--naming=" ) ) {↵
|
5 | cfg.setNamingStrategy(↵ | | 5 | cfg.setNamingStrategy(↵
|
6 | ( NamingStrategy ) ReflectHelper.classForName( args[i].substring( 9 ) )↵ | | 6 | ( NamingStrategy ) ReflectHelper.classForName( args[i].substring( 9 ) )↵
|
7 | .newInstance()↵ | | 7 | .newInstance()↵
|
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.5 |
Clones location | Clones are in different classes |
Number of node comparisons | 15 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
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.3 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
35 | else if (args[i].startsWith("--config=")) | | 8 | else if (args[i].startsWith("--config=")) |
36 | cfg.configure(args[i].substring(9)); | | 9 | cfg.configure(args[i].substring(9)); |
37 | else if (args[i].startsWith("--naming=")) | | 10 | else if (args[i].startsWith("--naming=")) |
38 | cfg.setNamingStrategy((NamingStrategy)ReflectHelper.classForName(args[i].substring(9)).newInstance()); | | 11 | cfg.setNamingStrategy((NamingStrategy)ReflectHelper.classForName(args[i].substring(9)).newInstance()); |
Precondition Violations (0)
Row |
Violation |