InputStream is = null;
try {
is = new FileInputStream(filename);
fileProperties.load(is);
} catch (IOException ioe) {
// ignore because properties file is not required
} finally {
if (is != null) {
try {
is.close();
} catch (IOException e) {
// ignore
}
}
}
try {
FileWriter out = null;
try {
out = new FileWriter(crashFile);
out.write(testCase + "\n");
out.flush();
} finally {
if (out != null) {
out.close();
}
}
} catch (IOException e) {
// ignored.
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/listener/MailLogger.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
|
Method name: void buildFinished(BuildEvent)
|
|
Method name: void registerTestCase(String)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 6
|
|
1 | InputStream is↵ | | 1 | try {↵
|
2 | = null;↵ | | 2 | FileWriter out = null;↵
|
3 | try {↵ | | 3 | try {↵
|
4 | is = new FileInputStream(filename);↵ | | 4 | out = new File↵
|
5 | fileProperties.load(is);↵ | | |
|
6 | } catch (IOException ioe) {↵ | | |
|
7 | // ignore because properties file is not required↵ | | |
|
| | | 5 | Writer(crashFile);↵
|
| | | 6 | out.write(testCase + "\n");↵
|
| | | 7 | out.flush();↵
|
8 | } finally {↵ | | 8 | } finally {↵
|
9 | if (is != null) {↵ | | 9 | if (out != null) {↵
|
10 | try {↵ | | 10 | out.close();↵
|
11 | ↵ | | 11 | }↵
|
12 | is.close();↵ | | 12 | ↵
|
13 | ↵ | | 13 | }↵
|
14 | } catch (IOException e) {↵ | | 14 | } catch (IOException e) {↵
|
15 | // ignore↵ | | 15 | // ignore↵
|
16 | }↵ | | |
|
17 | }↵ | | 16 | d.↵
|
18 | } | | 17 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 0 |
Number of refactorable cases | 0 |
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 | 1 |