InputStreamReader isr;
if (manifestEncoding == null) {
isr = new InputStreamReader(is);
} else {
isr = new InputStreamReader(is, manifestEncoding);
}
newManifest = getManifest(isr);
InputStreamReader isr;
if (manifestEncoding == null) {
isr = new InputStreamReader(is);
} else {
isr = new InputStreamReader(is, manifestEncoding);
}
manifest = getManifest(isr);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Jar.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Jar.java
|
Method name: void filesetManifest(File, InputStream)
|
|
Method name: void filesetManifest(File, InputStream)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | InputStreamReader isr;↵ | | 1 | InputStreamReader isr;↵
|
2 | if (manifestEncoding == null) {↵ | | 2 | if (manifestEncoding == null) {↵
|
3 | isr = new InputStreamReader(is);↵ | | 3 | isr = new InputStreamReader(is);↵
|
4 | } else {↵ | | 4 | } else {↵
|
5 | isr = new InputStreamReader(is, manifestEncoding);↵ | | 5 | isr = new InputStreamReader(is, manifestEncoding);↵
|
6 | }↵ | | 6 | }↵
|
7 | newManifest = getManifest(isr); | | 7 | manifest = getManifest(isr);
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in the same method |
Number of node comparisons | 14 |
-
{Non-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 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
16 | InputStreamReader isr; | | 5 | InputStreamReader isr; |
17 | if (manifestEncoding == null) | | 6 | if (manifestEncoding == null) |
18 | isr = new InputStreamReader(is); | | 7 | isr = new InputStreamReader(is); |
| | | | |
19 | isr = new InputStreamReader(is, manifestEncoding); | | 8 | isr = new InputStreamReader(is, manifestEncoding); |
20 | newManifest = getManifest(isr); | | 9 | manifest = getManifest(isr); |
Precondition Violations (2)
Row |
Violation |
1 | Expression manifest is a field being modified, and thus it cannot be parameterized |
2 | Clone fragment #1 returns variables newManifest , while Clone fragment #2 returns variables |