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/Tar.java | |||
Method name: void merge(Section)
|
Method name: boolean check(ResourceCollection)
|
|||
Number of AST nodes: 11 | Number of AST nodes: 11 | |||
1 | String attributeName = (String) e.nextElement();↵ | |||
2 | Attribute attribute = section.getAttribute(attributeName);↵ | |||
3 | if (attributeName.equalsIgnoreCase(ATTRIBUTE_CLASSPATH)) {↵ | |||
4 | ↵ | 1 | while (iter.hasNext()) {↵ | |
2 | FileResource r = (FileResource) iter.next();↵ | |||
3 | File base = r.getBaseDir();↵ | |||
5 | if (classpathAttribute == null) {↵ | 4 | if (base == null) {↵ | |
6 | classpathAttribute = new Attribute();↵ | 5 | ↵ | |
7 | classpathAttribute.setName(ATTRIBUTE_CLASSPATH);↵ | |||
8 | }↵ | |||
9 | Enumeration cpe = attribute.getValues();↵ | |||
10 | while (cpe.hasMoreElements()) {↵ | |||
11 | String value = (String) cpe.nextElement();↵ | |||
12 | classpathAttribute.addValue(value);↵ | |||
13 | }↵ | 6 | base = Copy.NULL_FILE_PLACEHOLDER;↵ | |
7 | }↵ | |||
8 | basedirs.add(base);↵ | |||
9 | Vector files = (Vector) basedirToFilesMap.get(base);↵ | |||
10 | if (files == null) {↵ | |||
11 | files = new Vector();↵ | |||
12 | basedirToFilesMap.put(base, new Vector());↵ | |||
14 | } else {↵ | 13 | }↵ | |
15 | ↵ | |||
16 | // the merge file always wins↵ | 14 | ↵ | |
17 | storeAttribute(attribute);↵ | |||
18 | ↵ | 15 | files.add(r.getName());↵ | |
19 | } | 16 |
| |
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 10 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 1.1 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 12 | FileResource r = (FileResource)iter.next(); | ||||||||||||||||
|
| 13 | File base = r.getBaseDir(); | |||||||||||||||
9 | if (classpathAttribute == null) |
| 14 | if (base == null) | ||||||||||||||
10 | classpathAttribute = new Attribute(); |
| | |||||||||||||||
11 | classpathAttribute.setName(ATTRIBUTE_CLASSPATH); | | ||||||||||||||||
|
| 15 | base = Copy.NULL_FILE_PLACEHOLDER; |
Row | Violation |
---|---|
1 | Unmatched statement File base=r.getBaseDir(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Type org.apache.tools.ant.taskdefs.Manifest.Attribute of variable classpathAttribute does not match with type java.io.File of variable base |
3 | Unmatched statement classpathAttribute=new Attribute(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement base=Copy.NULL_FILE_PLACEHOLDER; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |