PrintStream writer = new PrintStream(out);
writer.print(n);
writer.flush();
FileOutputStream outstream = new FileOutputStream(propsFile);
props.store(outstream, "Ant JUnitTask generated properties file");
outstream.close();
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/UUEncoder.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
|
Method name: void encodeString(String)
|
|
Method name: TestResultHolder executeAsForked(JUnitTest, ExecuteWatchdog, File)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | PrintStream writer = new PrintStream(out);↵ | | |
|
2 | writer.print(n);↵ | | |
|
3 | writer.flush↵ | | 1 | FileOutputStream outstream = new FileOutputStream(propsFile);↵
|
| | | 2 | props.store(outstream, "Ant JUnitTask generated properties file");↵
|
4 | (); | | 3 | outstream.close();
|
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.0 |
Clones location | Clones are in different classes |
Number of node comparisons | 9 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | PrintStream writer = new PrintStream(out); | | | |
2 | writer.print(n); | | 56 | outstream.close(); |
3 | writer.flush(); | | | |
Precondition Violations (4)
Row |
Violation |
1 | Expression writer.print(n) is a void method call, and thus it cannot be parameterized |
2 | Expression outstream.close() is a void method call, and thus it cannot be parameterized |
3 | Expression writer.print(n) is a void method call, and thus it cannot be parameterized |
4 | Expression outstream.close() is a void method call, and thus it cannot be parameterized |