if (matchingEntry.getBase() != null) {
baseURL = matchingEntry.getBase();
} else {
try {
baseURL = FILE_UTILS.getFileURL(getProject().getBaseDir());
} catch (MalformedURLException ex) {
throw new BuildException("Project basedir cannot be converted to a URL");
}
}
if (matchingEntry.getBase() != null) {
baseURL = matchingEntry.getBase();
} else {
try {
baseURL = FILE_UTILS.getFileURL(getProject().getBaseDir());
} catch (MalformedURLException ex) {
throw new BuildException("Project basedir cannot be converted to a URL");
}
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/XMLCatalog.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/XMLCatalog.java
|
Method name: InputSource filesystemLookup(ResourceLocation)
|
|
Method name: InputSource urlLookup(ResourceLocation)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | if (matchingEntry.getBase() != null) {↵ | | 1 | if (matchingEntry.getBase() != null) {↵
|
2 | baseURL = matchingEntry.getBase();↵ | | 2 | baseURL = matchingEntry.getBase();↵
|
3 | } else {↵ | | 3 | } else {↵
|
4 | try {↵ | | 4 | try {↵
|
5 | baseURL = FILE_UTILS.getFileURL(getProject().getBaseDir());↵ | | 5 | baseURL = FILE_UTILS.getFileURL(getProject().getBaseDir());↵
|
6 | } catch (MalformedURLException ex) {↵ | | 6 | } catch (MalformedURLException ex) {↵
|
7 | throw new BuildException("Project basedir cannot be converted to a URL");↵ | | 7 | throw new BuildException("Project basedir cannot be converted to a URL");↵
|
8 | }↵ | | 8 | }↵
|
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 8 |
-
{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) | 0.5 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
4 | if (matchingEntry.getBase() != null) | | 3 | if (matchingEntry.getBase() != null) |
5 | baseURL = matchingEntry.getBase(); | | 4 | baseURL = matchingEntry.getBase(); |
| | | | |
6 | | | 5 | |
7 | baseURL = FILE_UTILS.getFileURL(getProject().getBaseDir()); | | 6 | baseURL = FILE_UTILS.getFileURL(getProject().getBaseDir()); |
Precondition Violations (0)
Row |
Violation |