int endName = value.indexOf('}', pos);
if (endName < 0) {
throw new BuildException("Syntax error in property: "
+ value);
}
String propertyName = value.substring(pos + 2, endName);
fragments.addElement(null);
propertyRefs.addElement(propertyName);
prev = endName + 1;
String prefix = value.substring(0, index);
String mappedUri = context.getPrefixMapping(prefix);
if (mappedUri == null) {
throw new BuildException(
"Unable to find XML NS prefix " + prefix);
}
value = ProjectHelper.genComponentName(
mappedUri, value.substring(index + 1));
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/PropertyHelper.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/helper/ProjectHelper2.java
|
Method name: void parsePropertyStringDefault(String, Vector, Vector)
|
|
Method name: void onStartElement(String, String, String, Attributes, AntXMLContext)
|
Number of AST nodes: 7
|
|
Number of AST nodes: 5
|
|
1 | int endName = value.indexOf('}', pos↵ | | 1 | String prefix = value.substring(0, index);↵
|
2 | );↵ | | 2 | String mappedUri = context.getPrefixMapping(prefix);↵
|
3 | if (endName < 0) {↵ | | 3 | ↵
|
| | | 4 | if (mappedUri == null) {↵
|
4 | throw new BuildException("Syntax error in property: "↵ | | 5 | throw new BuildException(↵
|
5 | ↵ | | |
|
| | | 6 | "Unable to find XML NS prefix " + prefix);↵
|
6 | + value);↵ | | 7 | ↵
|
7 | ↵ | | 8 | }↵
|
8 | }↵ | | 9 | ↵
|
9 | String propertyName = value.substring(pos + 2, endName);↵ | | 10 | value = ProjectHelper.genComponentName(↵
|
10 | fragments.addElement(null);↵ | | 11 | ↵
|
11 | propertyRefs.addElement(propertyName);↵ | | |
|
12 | prev = endName + 1; | | 12 | mappedUri, value.substring(index + 1));
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 0 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 1 |