t.start();
try {
t.join();
} catch (InterruptedException e) {
try {
t.join();
} catch (InterruptedException e2) {
// Ignore
}
}
request.setInput(new String(baos.toByteArray()));
t.start();
try {
t.join();
} catch (InterruptedException e) {
try {
t.join();
} catch (InterruptedException ee) {
// Empty
}
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/input/GreedyInputHandler.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Concat.java
|
Method name: void handleInput(InputRequest)
|
|
Method name: void binaryCat(ResourceCollection)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 3
|
|
1 | t.start();↵ | | 1 | t.start();↵
|
2 | try {↵ | | 2 | try {↵
|
3 | t.join();↵ | | 3 | t.join();↵
|
4 | } catch (InterruptedException e) {↵ | | 4 | } catch (InterruptedException e) {↵
|
5 | try {↵ | | 5 | try {↵
|
6 | t.join();↵ | | 6 | t.join();↵
|
7 | } catch (InterruptedException e2) {↵ | | 7 | } catch (InterruptedException ee) {↵
|
8 | // Ignore↵ | | 8 | // Empty↵
|
9 | }↵ | | 9 | }↵
|
10 | }↵ | | 10 | }
|
11 | request.setInput(new String(baos.toByteArray())); | | | |
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 different classes |
Number of node comparisons | 7 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 3 |
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.5 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
10 | t.start(); | | 10 | t.start(); |
11 | try | | 11 | try |
12 | | | 12 | |
13 | request.setInput(new String(baos.toByteArray())); | | | |
Precondition Violations (2)
Row |
Violation |
1 | Unmatched statement request.setInput(new String(baos.toByteArray())); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | The refactoring of the clones is infeasible, because classes org.apache.tools.ant.input.GreedyInputHandler and org.apache.tools.ant.taskdefs.Concat do not have a common superclass |