InputStream i = null;
try {
i = srcR.getInputStream();
expandStream(srcR.getName(), i, dir);
} catch (IOException ioe) {
throw new BuildException("Error while expanding " + srcR.getName(),
ioe, getLocation());
} finally {
FileUtils.close(i);
}
FileInputStream fis = null;
try {
fis = new FileInputStream(srcF);
expandStream(srcF.getPath(), fis, dir);
} catch (IOException ioe) {
throw new BuildException("Error while expanding " + srcF.getPath(),
ioe, getLocation());
} finally {
FileUtils.close(fis);
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Untar.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Untar.java
|
Method name: void expandResource(Resource, File)
|
|
Method name: void expandFile(FileUtils, File, File)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | InputStream i = null;↵ | | 1 | FileInputStream fis = null;↵
|
2 | try {↵ | | 2 | try {↵
|
3 | i = srcR.getInputStream();↵ | | 3 | fis = new FileInputStream(srcF);↵
|
4 | expandStream(srcR.getName(), i, dir);↵ | | 4 | expandStream(srcF.getPath(), fis, dir);↵
|
5 | } catch (IOException ioe) {↵ | | 5 | } catch (IOException ioe) {↵
|
6 | throw new BuildException("Error while expanding " + srcR.getName(),↵ | | 6 | throw new BuildException("Error while expanding " + srcF.getPath(),↵
|
7 | ioe, getLocation());↵ | | 7 | ioe, getLocation());↵
|
8 | } finally {↵ | | 8 | } finally {↵
|
9 | FileUtils.close(i);↵ | | 9 | FileUtils.close(fis);↵
|
10 | } | | 10 | }
|
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.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 1 |