File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/resources/Resources.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/resources/Files.java | |||
Method name: String toString()
|
Method name: String toString()
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | /** | 1 | /** | |
2 | * Format this BaseResourceCollectionContainer as a String. | 2 | * Format this Files collection as a String. | |
3 | * @return a descriptive <code>String</code>. | 3 | * @return a descriptive <code>String</code>. | |
4 | */ | 4 | */ | |
5 | public synchronized String toString() { | 5 | public String toString() { | |
6 | if (isReference()) { | 6 | // if (isReference()) { | |
7 | return getCheckedRef().toString(); | 7 | // return getRef().toString(); | |
8 | } | 8 | // } | |
9 | if (coll == null || coll.isEmpty()) { | 9 | Iterator i = iterator(); | |
10 | return ""; | 10 | // if (!i.hasNext()) { | |
11 | } | 11 | // return ""; | |
12 | StringBuffer sb = new StringBuffer(); | 12 | // } | |
13 | for (Iterator i = coll.iterator(); i.hasNext();) { | 13 | StringBuffer sb = new StringBuffer(); | |
14 | if (sb.length() > 0) { | 14 | while (i.hasNext()) { | |
15 | sb.append(File.pathSeparatorChar); | 15 | if (sb.length() > 0) { | |
16 | } | 16 | sb.append(File.pathSeparatorChar); | |
17 | sb.append(i.next()); | 17 | } | |
18 | } | 18 | sb.append(i.next()); | |
19 | return sb.toString(); | 19 | } | |
20 | } | 20 | return sb.toStr | |
See real code fragment | See real code fragment |
Number of mapped statements | 5 |
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.0 |
Similarity Score | 1.000 |
Clone type | Type 1 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
6 | for (Iterator i = coll.iterator(); i.hasNext(); ) | 3 | while (i.hasNext()) | |
7 | if (sb.length() > 0) | 4 | if (sb.length() > 0) | |
8 | sb.append(File.pathSeparatorChar); | 5 | sb.append(File.pathSeparatorChar); | |
9 | sb.append(i.next()); | 6 | sb.append(i.next()); |
Row | Violation |
---|