File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Manifest.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Property.java | |||
Method name: void write(PrintWriter)
|
Method name: void addProperties(Properties)
|
|||
Number of AST nodes: 9 | Number of AST nodes: 9 | |||
1 | if (name != null) {↵ | |||
2 | Attribute nameAttr = new Attribute(ATTRIBUTE_NAME, name);↵ | |||
3 | nameAttr.write(writer);↵ | |||
4 | }↵ | |||
5 | ↵ | 1 | resolveAllProperties(props);↵ | |
6 | Enumeration e = getAttributeKeys();↵ | 2 | Enumeration e = props.keys();↵ | |
7 | while (e.hasMoreElements()) {↵ | 3 | while (e.hasMoreElements()) {↵ | |
8 | String key = (String) e.nextElement();↵ | 4 | String propertyName = (String) e.nextElement();↵ | |
9 | Attribute attribute = getAttribute(key↵ | 5 | String propertyValue = props.getProperty(propertyName);↵ | |
10 | );↵ | 6 | String v = getProject().replaceProperties(propertyValue);↵ | |
11 | attribute.write(writer)↵ | 7 | if (prefix != null) {↵ | |
12 | ;↵ | 8 | propertyName = prefix + propertyName;↵ | |
13 | }↵ | 9 | }↵ | |
14 | writer.print(EOL); | 10 | addProperty(propertyName, v);↵ | |
11 |
| |||
See real code fragment | See real code fragment |
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.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 7 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 0.8 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 4 | String propertyName = (String)e.nextElement(); | ||||||||||||
| 5 | String propertyValue = props.getProperty(propertyName); | ||||||||||||
| 6 | String v = getProject().replaceProperties(propertyValue); | ||||||||||||
1 | if (name != null) |
| 7 | if (prefix != null) | ||||||||||
2 | Attribute nameAttr = new Attribute(ATTRIBUTE_NAME, name); | | ||||||||||||
3 | nameAttr.write(writer); | | ||||||||||||
| 8 | propertyName = prefix + propertyName; |
Row | Violation |
---|