String filename = args[i];
if ( filename.endsWith( ".jar" ) ) {
cfg.addJar( new File( filename ) );
}
else {
cfg.addFile( filename );
}
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);
}
}
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/SchemaExportTask.java
|
Method name: void main(String[])
|
|
Method name: Configuration getConfiguration()
|
Number of AST nodes: 4
|
|
Number of AST nodes: 5
|
|
| | | 1 | for (int i = 0; i < files.length; i++) {↵
|
1 | String filename = args[i];↵ | | 2 | String filename = files[i];↵
|
2 | if ( filename.endsWith( ".jar" ) ) {↵ | | 3 | if ( filename.endsWith(".jar") ) {↵
|
3 | cfg.addJar( new File( filename ) );↵ | | 4 | cfg.addJar( new File(filename) );↵
|
4 | }↵ | | 5 | }↵
|
5 | else {↵ | | 6 | else {↵
|
6 | cfg.addFile( filename );↵ | | 7 | cfg.addFile(filename);↵
|
7 | ↵ | | 8 | }↵
|
8 | } | | 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.2 |
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.2 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
39 | String filename = args[i]; | | 8 | String filename = files[i]; |
40 | if (filename.endsWith(".jar")) | | 9 | if (filename.endsWith(".jar")) |
41 | cfg.addJar(new File(filename)); | | 10 | cfg.addJar(new File(filename)); |
| | | | |
42 | | | 11 | |
Precondition Violations (0)
Row |
Violation |