File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Property.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java | |||
Method name: void resolve(Properties, String, Stack)
|
Method name: void doReplace(File, int)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 8 | |||
1 | String propertyName = (String) j.nextElement();↵ | 1 | String ↵ | |
2 | fragment = getProject().getProperty(propertyName);↵ | 2 | buf = FileUtils.readFully(br);↵ | |
3 | if (fragment == null) {↵ | 3 | if (buf == null) {↵ | |
4 | if (props.containsKey(propertyName)) {↵ | 4 | ↵ | |
5 | resolve(props, propertyName, referencesSeen↵ | 5 | buf = "";↵ | |
6 | }↵ | |||
6 | );↵ | 7 | String res = doReplace(regex, subs, buf, options);↵ | |
7 | fragment = props.getProperty(propertyName);↵ | 8 | if (!res.equals(buf)) {↵ | |
8 | } else {↵ | 9 | changes = true;↵ | |
9 | ↵ | 10 | }↵ | |
10 | fragment = "${" + propertyName + "}";↵ | 11 | ↵ | |
11 | }↵ | |||
12 | } | 12 | pw.print(res);↵ | |
13 |
| |||
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 9 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 5 |
Time elapsed for statement mapping (ms) | 1.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 58 | String buf = FileUtils.readFully(br); | ||||||||||||
| 59 | if (buf == null) | ||||||||||||
| 60 | buf = ""; | ||||||||||||
| 61 | String res = doReplace(regex, subs, buf, options); | ||||||||||||
18 | if (props.containsKey(propertyName)) |
| 62 | if (!res.equals(buf)) | ||||||||||
19 | resolve(props, propertyName, referencesSeen); |
| | |||||||||||
20 | fragment = props.getProperty(propertyName); |
| | |||||||||||
else | | |||||||||||||
21 | fragment = "${" + propertyName + "}"; |
| | |||||||||||
| 63 | changes = true; |
Row | Violation |
---|---|
1 | Unmatched statement resolve(props,propertyName,referencesSeen); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement fragment=props.getProperty(propertyName); cannot be moved, because it updates a variable modified in other unmapped statements |
3 | Unmatched statement fragment="${" + propertyName + "}"; cannot be moved, because it updates a variable modified in other unmapped statements |