for (int i = 0; i < files.length; i++) {
String filename = files[i];
if ( filename.endsWith(".jar") ) {
cfg.addJar( new File(filename) );
}
else {
cfg.addFile(filename);
}
}
String filename = args[i];
if ( filename.endsWith( ".jar" ) ) {
cfg.addJar( new File( filename ) );
}
else {
cfg.addFile( filename );
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/tool/hbm2ddl/SchemaUpdateTask.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/tool/hbm2ddl/SchemaExport.java
|
Method name: Configuration getConfiguration()
|
|
Method name: void main(String[])
|
Number of AST nodes: 5
|
|
Number of AST nodes: 4
|
|
1 | for (int i = 0; i < files.length; i++) {↵ | | |
|
2 | String filename = files[i];↵ | | 1 | String filename = args[i];↵
|
3 | if ( filename.endsWith(".jar") ) {↵ | | 2 | if ( filename.endsWith( ".jar" ) ) {↵
|
4 | cfg.addJar( new File(filename) );↵ | | 3 | cfg.addJar( new File( filename ) );↵
|
5 | }↵ | | 4 | }↵
|
6 | else {↵ | | 5 | else {↵
|
7 | cfg.addFile(filename);↵ | | 6 | cfg.addFile( filename );↵
|
8 | }↵ | | 7 | ↵
|
9 | } | | 8 | }
|
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.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 11 |
-
{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) | 1.1 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
8 | String filename = files[i]; | | 39 | String filename = args[i]; |
9 | if (filename.endsWith(".jar")) | | 40 | if (filename.endsWith(".jar")) |
10 | cfg.addJar(new File(filename)); | | 41 | cfg.addJar(new File(filename)); |
| | | | |
11 | | | 42 | |
Precondition Violations (0)
Row |
Violation |