if (type == null) {
throw new BuildException(
"classname attribute must be set for provider element",
getLocation());
}
if (type.length() == 0) {
throw new BuildException(
"Invalid empty classname", getLocation());
}
if (type == null) {
throw new BuildException(
"type attribute must be set for service element",
getLocation());
}
if (type.length() == 0) {
throw new BuildException(
"Invalid empty type classname", getLocation());
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/spi/Provider.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/spi/Service.java
|
Method name: void check()
|
|
Method name: void check()
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | if (type == null) {↵ | | 1 | if (type == null) {↵
|
2 | throw new BuildException(↵ | | 2 | throw new BuildException(↵
|
3 | "classname attribute must be set for provider element",↵ | | 3 | "type attribute must be set for service element",↵
|
4 | getLocation());↵ | | 4 | getLocation());↵
|
5 | }↵ | | 5 | }↵
|
6 | if (type.length() == 0) {↵ | | 6 | if (type.length() == 0) {↵
|
7 | throw new BuildException(↵ | | 7 | throw new BuildException(↵
|
8 | "Invalid empty classname", getLocation());↵ | | 8 | "Invalid empty type classname", getLocation());↵
|
9 | } | | 9 | }
|
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) | 0.4 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 10 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 6.1 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (type == null) | | 1 | if (type == null) |
2 | throw new BuildException("classname attribute must be set for provider element", getLocation()); | | 2 | throw new BuildException("type attribute must be set for service element", getLocation()); |
3 | if (type.length() == 0) | | 3 | if (type.length() == 0) |
4 | throw new BuildException("Invalid empty classname", getLocation()); | | 4 | throw new BuildException("Invalid empty type classname", getLocation()); |
Precondition Violations (0)
Row |
Violation |