if (DEBUG) {
FileOutputStream fos = null;
try {
fos = new FileOutputStream(name + ".class");
fos.write(bytes);
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
try {fos.close();} catch (Exception e) {}
}
}
if (DEBUG) {
FileOutputStream fos = null;
try {
fos = new FileOutputStream(name + ".class");
fos.write(bytes);
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
try {fos.close();} catch (Exception e) {}
}
}
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/java/MiniJava.java
|
|
File path: /jruby-1.4.0/src/org/jruby/java/MiniJava.java
|
Method name: Class defineOldStyleImplClass(Ruby, String, String[], Map>)
|
|
Method name: Class defineImplClass(Ruby, String, String[], Map>)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if (DEBUG) {↵ | | 1 | if (DEBUG) {↵
|
2 | FileOutputStream fos = null;↵ | | 2 | FileOutputStream fos = null;↵
|
3 | try {↵ | | 3 | try {↵
|
4 | fos = new FileOutputStream(name + ".class");↵ | | 4 | fos = new FileOutputStream(name + ".class");↵
|
5 | fos.write(bytes);↵ | | 5 | fos.write(bytes);↵
|
6 | } catch (IOException ioe) {↵ | | 6 | } catch (IOException ioe) {↵
|
7 | ioe.printStackTrace();↵ | | 7 | ioe.printStackTrace();↵
|
8 | } finally {↵ | | 8 | } finally {↵
|
9 | try {fos.close();} catch (Exception e) {}↵ | | 9 | try {fos.close();} catch (Exception e) {}↵
|
10 | }↵ | | 10 | }↵
|
11 | } | | 11 | }
|
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 declared in the same 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.2 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
140 | if (DEBUG) | | 76 | if (DEBUG) |
141 | FileOutputStream fos = null; | | 77 | FileOutputStream fos = null; |
142 | | | 78 | |
143 | fos = new FileOutputStream(name + ".class"); | | 79 | fos = new FileOutputStream(name + ".class"); |
144 | | | 80 | |
Precondition Violations (0)
Row |
Violation |