try {
zOut = new GZIPOutputStream(new FileOutputStream(zipFile));
zipResource(getSrcResource(), zOut);
} catch (IOException ioe) {
String msg = "Problem creating gzip " + ioe.getMessage();
throw new BuildException(msg, ioe, getLocation());
} finally {
FileUtils.close(zOut);
}
try {
bos = new BufferedOutputStream(
new FileOutputStream(new File(dir, linkFileName)));
properties.store(bos, "Symlinks from " + dir);
} catch (IOException ioe) {
throw new BuildException(ioe, getLocation());
} finally {
FileUtils.close(bos);
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/GZip.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
|
Method name: void pack()
|
|
Method name: void writePropertyFile(Properties, File)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | try {↵ | | 1 | try {↵
|
2 | zOut = new GZIPOutputStream(↵ | | 2 | bos = new BufferedOutputStream(↵
|
3 | new FileOutputStream(zipFile));↵ | | 3 | new FileOutputStream(↵
|
4 | zipResource(getSrcResource(), zOut);↵ | | |
|
5 | } catch (IOException ioe) {↵ | | |
|
6 | String msg = "Problem creating gzip " + ioe.getMessage();↵ | | 4 | new File(dir, linkFileName)));↵
|
| | | 5 | properties.store(bos, "Symlinks from " + dir);↵
|
| | | 6 | } catch (IOException ioe) {↵
|
7 | throw new BuildException(msg, ioe, getLocation());↵ | | 7 | throw new BuildException(ioe, getLocation());↵
|
8 | } finally {↵ | | 8 | } finally {↵
|
9 | FileUtils.close(zOut);↵ | | 9 | FileUtils.close(bos);↵
|
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.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 1 |