if (target == null) {
StringBuffer sb = new StringBuffer("Target \"");
sb.append(root);
sb.append("\" does not exist in the project \"");
sb.append(name);
sb.append("\". ");
visiting.pop();
if (!visiting.empty()) {
String parent = (String) visiting.peek();
sb.append("It is used from target \"");
sb.append(parent);
sb.append("\".");
}
throw new BuildException(new String(sb));
}
if (al != null) {
Iterator iter = al.iterator();
while (iter.hasNext()) {
String uri = (String) iter.next();
String prefix = (String) nsPrefixMap.get(uri);
out.write(" xmlns");
if (!"".equals(prefix)) {
out.write(":");
out.write(prefix);
}
out.write("=\"");
out.write(uri);
out.write("\"");
}
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/Project.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/DOMElementWriter.java
|
Method name: void tsort(String, Hashtable, Hashtable, Stack, Vector)
|
|
Method name: void openElement(Element, Writer, int, String, boolean)
|
Number of AST nodes: 13
|
|
Number of AST nodes: 12
|
|
1 | if (target == null) {↵ | | 1 | if (al != null) {↵
|
2 | StringBuffer sb = new StringBuffer("Target \"");↵ | | 2 | ↵
|
3 | sb.append(root);↵ | | |
|
4 | sb.append("\" does not exist in the project \"");↵ | | |
|
5 | sb.append(name);↵ | | |
|
6 | sb.append("\". ");↵ | | |
|
7 | visiting.pop();↵ | | |
|
8 | if (!visiting.empty()) {↵ | | |
|
9 | String parent = (String) visiting.peek();↵ | | |
|
10 | sb.append("It is used from target \""↵ | | 3 | Iterator iter = al.iterator();↵
|
| | | 4 | while (iter.hasNext()) {↵
|
| | | 5 | String uri = (String) iter.next();↵
|
| | | 6 | String prefix = (String) nsPrefixMap.get(uri);↵
|
| | | 7 | out.write(" xmlns");↵
|
| | | 8 | if (!"".equals(prefix)) {↵
|
| | | 9 | out.write(":");↵
|
11 | );↵ | | 10 | out.write(prefix);↵
|
12 | sb.append(parent);↵ | | 11 | }↵
|
13 | sb.append("\".");↵ | | 12 | out.write("=\"");↵
|
14 | }↵ | | 13 | ↵
|
15 | throw new BuildException(new String(sb));↵ | | 14 | out.write(uri);↵
|
| | | 15 | out.write("\"");↵
|
| | | 16 | }↵
|
16 | } | | 17 | }
|
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.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 1 |