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/types/resources/BZip2Resource.java | |||
Method name: InputStream decompress(String, InputStream)
|
Method name: InputStream wrapStream(InputStream)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 4 | |||
1 | if (BZIP2.equals(v)) {↵ | |||
2 | final char[] magic = new char[] {'B', 'Z'};↵ | |||
3 | for (int i = 0; i < magic.length; i++) {↵ | 1 | for (int i = 0; i < MAGIC.length; i++) {↵ | |
4 | if (istream.read() != magic[i]) {↵ | 2 | if (in.read() != MAGIC[i]) {↵ | |
5 | throw new BuildException(↵ | 3 | throw new IOException(↵ | |
6 | "Invalid bz2 file." + name);↵ | |||
7 | }↵ | |||
8 | }↵ | |||
9 | ↵ | 4 | "Invalid bz2 stream.");↵ | |
5 | }↵ | |||
6 | }↵ | |||
10 | return new CBZip2InputStream(istream);↵ | 7 | return new CBZip2InputStream(i↵ | |
11 | } | 8 |
| |
See real code fragment | See real code fragment |
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.4 |
Clones location | Clones are in different classes |
Number of node comparisons | 7 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.1 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5 | final char[] magic = new char[] {'B', 'Z'}; | | |||||||||||||||
6 | for (int i = 0; i < magic.length; i++) |
| 1 | for (int i = 0; i < MAGIC.length; i++) | |||||||||||||
7 | if (istream.read() != magic[i]) |
| 2 | if (in.read() != MAGIC[i]) | |||||||||||||
8 | throw new BuildException("Invalid bz2 file." + name); |
| 3 | throw new IOException("Invalid bz2 stream."); | |||||||||||||
9 | return new CBZip2InputStream(istream); |
| 4 | return new CBZip2InputStream(in); |
Row | Violation |
---|