switch (onError) {
case OnError.FAIL_ALL:
throw new BuildException(message);
case OnError.FAIL:
// Fall Through
case OnError.REPORT:
log(message, Project.MSG_WARN);
break;
case OnError.IGNORE:
// log at a lower level
log(message, Project.MSG_VERBOSE);
break;
default:
// Ignore the problem
break;
}
switch (onError) {
case OnError.FAIL_ALL:
throw new BuildException(message);
case OnError.FAIL:
case OnError.REPORT:
log(message, Project.MSG_WARN);
break;
case OnError.IGNORE:
log(message, Project.MSG_VERBOSE);
break;
default:
// Ignore the problem
break;
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Definer.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Definer.java
|
Method name: URL fileToURL()
|
|
Method name: Enumeration resourceToURLs(ClassLoader)
|
Number of AST nodes: 12
|
|
Number of AST nodes: 12
|
|
1 | switch (onError) {↵ | | 1 | switch (onError) {↵
|
2 | case OnError.FAIL_ALL:↵ | | 2 | case OnError.FAIL_ALL:↵
|
3 | throw new BuildException(message);↵ | | 3 | throw new BuildException(message);↵
|
4 | case OnError.FAIL:↵ | | 4 | case OnError.FAIL:↵
|
5 | // Fall Through↵ | | 5 | ↵
|
6 | case OnError.REPORT:↵ | | 6 | case OnError.REPORT:↵
|
7 | log(message, Project.MSG_WARN);↵ | | 7 | log(message, Project.MSG_WARN);↵
|
8 | break;↵ | | 8 | break;↵
|
9 | case OnError.IGNORE:↵ | | 9 | case OnError.IGNORE:↵
|
10 | // log at a lower level↵ | | 10 | ↵
|
11 | log(message, Project.MSG_VERBOSE);↵ | | 11 | log(message, Project.MSG_VERBOSE);↵
|
12 | break;↵ | | 12 | break;↵
|
13 | default:↵ | | 13 | default:↵
|
14 | // Ignore the problem↵ | | 14 | // Ignore the problem↵
|
15 | break;↵ | | 15 | break;↵
|
16 | } | | 16 | }
|
See real code fragment |
|
See real code fragment |
Summary
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) | 1.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 75 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 12 |
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) | 3.6 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
9 | switch (onError) | | 6 | switch (onError) |
10 | | | 7 | |
11 | throw new BuildException(message); | | 8 | throw new BuildException(message); |
12 | | | 9 | |
13 | | | 10 | |
14 | log(message, Project.MSG_WARN); | | 11 | log(message, Project.MSG_WARN); |
15 | | | 12 | |
16 | | | 13 | |
17 | log(message, Project.MSG_VERBOSE); | | 14 | log(message, Project.MSG_VERBOSE); |
18 | | | 15 | |
19 | | | 16 | |
20 | | | 17 | |
Precondition Violations (0)
Row |
Violation |