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);
}
}
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/SchemaUpdateTask.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/tool/hbm2ddl/SchemaValidatorTask.java
|
Method name: Configuration getConfiguration()
|
|
Method name: Configuration getConfiguration()
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | for (int i = 0; i < files.length; i++) {↵ | | 1 | for (int i = 0; i < files.length; i++) {↵
|
2 | String filename = files[i];↵ | | 2 | String filename = files[i];↵
|
3 | if ( filename.endsWith(".jar") ) {↵ | | 3 | if ( filename.endsWith(".jar") ) {↵
|
4 | cfg.addJar( new File(filename) );↵ | | 4 | cfg.addJar( new File(filename) );↵
|
5 | }↵ | | 5 | }↵
|
6 | else {↵ | | 6 | else {↵
|
7 | cfg.addFile(filename);↵ | | 7 | cfg.addFile(filename);↵
|
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.3 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 13 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
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 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
7 | for (int i = 0; i < files.length; i++) | | 7 | for (int i = 0; i < files.length; i++) |
8 | String filename = files[i]; | | 8 | String filename = files[i]; |
9 | if (filename.endsWith(".jar")) | | 9 | if (filename.endsWith(".jar")) |
10 | cfg.addJar(new File(filename)); | | 10 | cfg.addJar(new File(filename)); |
| | | | |
11 | | | 11 | |
Precondition Violations (0)
Row |
Violation |