File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/TarFileSet.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/ZipFileSet.java | |||
Method name: AbstractFileSet getRef(Project)
|
Method name: AbstractFileSet getRef(Project)
|
|||
Number of AST nodes: 10 | Number of AST nodes: 10 | |||
1 | dieOnCircularReference(p);↵ | 1 | dieOnCircularReference(p);↵ | |
2 | Object o = getRefid().getReferencedObject(p);↵ | 2 | Object o = getRefid().getReferencedObject(p);↵ | |
3 | if (o instanceof TarFileSet) {↵ | 3 | if (o instanceof ZipFileSet) {↵ | |
4 | return (AbstractFileSet) o;↵ | 4 | return (AbstractFileSet) o;↵ | |
5 | } else if (o instanceof FileSet) {↵ | 5 | } else if (o instanceof FileSet) {↵ | |
6 | TarFileSet zfs = new TarFileSet((FileSet) o);↵ | 6 | ZipFileSet zfs = new ZipFileSet((FileSet) o);↵ | |
7 | configureFileSet(zfs);↵ | 7 | configureFileSet(zfs);↵ | |
8 | return zfs;↵ | 8 | return zfs;↵ | |
9 | } else {↵ | 9 | } else {↵ | |
10 | String msg = getRefid().getRefId() + " doesn\'t denote a tarfileset or a fileset";↵ | 10 | String msg = getRefid().getRefId() + " doesn\'t denote a zipfileset or a fileset";↵ | |
11 | throw new BuildException(msg);↵ | 11 | throw new BuildException(msg);↵ | |
12 | } | 12 |
| |
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.3 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 57 |
Number of mapped statements | 10 |
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) | 2.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | dieOnCircularReference(p); | 1 | dieOnCircularReference(p); | |||||||||||||||||||
2 | Object o = getRefid().getReferencedObject(p); | 2 | Object o = getRefid().getReferencedObject(p); | |||||||||||||||||||
3 | if (o instanceof TarFileSet) |
| 3 | if (o instanceof ZipFileSet) | ||||||||||||||||||
4 | return (AbstractFileSet)o; | 4 | return (AbstractFileSet)o; | |||||||||||||||||||
5 | else if (o instanceof FileSet) | 5 | else if (o instanceof FileSet) | |||||||||||||||||||
6 | TarFileSet zfs = new TarFileSet((FileSet)o); |
| 6 | ZipFileSet zfs = new ZipFileSet((FileSet)o); | ||||||||||||||||||
7 | configureFileSet(zfs); |
| 7 | configureFileSet(zfs); | ||||||||||||||||||
8 | return zfs; |
| 8 | return zfs; | ||||||||||||||||||
else | else | |||||||||||||||||||||
9 | String msg = getRefid().getRefId() + " doesn\'t denote a tarfileset or a fileset"; |
| 9 | String msg = getRefid().getRefId() + " doesn\'t denote a zipfileset or a fileset"; | ||||||||||||||||||
10 | throw new BuildException(msg); | 10 | throw new BuildException(msg); |
Row | Violation |
---|---|
1 | Expression o instanceof TarFileSet cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression o instanceof ZipFileSet cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression new TarFileSet((FileSet)o) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression new ZipFileSet((FileSet)o) cannot be parameterized, because it has dependencies to/from statements that will be extracted |