File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/XMLCatalog.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/XMLCatalog.java | |||
Method name: Source resolve(String, String)
|
Method name: Source resolve(String, String)
|
|||
Number of AST nodes: 12 | Number of AST nodes: 12 | |||
1 | log("Matching catalog entry found for uri: '"↵ | 1 | log("Matching catalog entry found for uri: '"↵ | |
2 | + matchingEntry.getPublicId() + "' location: '"↵ | 2 | + matchingEntry.getPublicId() + "' location: '"↵ | |
3 | + matchingEntry.getLocation() + "'",↵ | 3 | + matchingEntry.getLocation() + "'",↵ | |
4 | Project.MSG_DEBUG);↵ | 4 | Project.MSG_DEBUG);↵ | |
5 | //↵ | 5 | //↵ | |
6 | // Use the passed in base in preference to the base↵ | 6 | // Use the passed in base in preference to the base↵ | |
7 | // from matchingEntry, which is either null or the↵ | 7 | // from matchingEntry, which is either null or the↵ | |
8 | // directory in which the external catalog file from↵ | 8 | // directory in which the external catalog file from↵ | |
9 | // which it was obtained is located. We make a copy↵ | 9 | // which it was obtained is located. We make a copy↵ | |
10 | // so matchingEntry's original base is untouched.↵ | 10 | // so matchingEntry's original base is untouched. Of↵ | |
11 | // course, if there is no base, no need to make a↵ | |||
12 | // copy...↵ | |||
11 | //↵ | 13 | //↵ | |
12 | // This is the standard behavior as per my reading of↵ | 14 | // This is the standard behavior as per my reading of↵ | |
13 | // the JAXP and XML Catalog specs. CKS 11/7/2002↵ | 15 | // the JAXP and XML Catalog specs. CKS 11/7/2002↵ | |
14 | //↵ | 16 | //↵ | |
15 | ResourceLocation entryCopy = matchingEntry;↵ | 17 | ResourceLocation entryCopy = matchingEntry;↵ | |
16 | if (base != null) {↵ | 18 | if (base != null) {↵ | |
17 | try {↵ | 19 | try {↵ | |
18 | URL baseURL = new URL(base);↵ | 20 | URL baseURL = new URL(base);↵ | |
19 | entryCopy = new ResourceLocation();↵ | 21 | entryCopy = new ResourceLocation();↵ | |
20 | entryCopy.setBase(baseURL);↵ | 22 | entryCopy.setBase(baseURL);↵ | |
21 | } catch (MalformedURLException ex) {↵ | 23 | } catch (MalformedURLException ex) {↵ | |
22 | // ignore↵ | 24 | // ignore↵ | |
23 | }↵ | 25 | }↵ | |
24 | }↵ | 26 | }↵ | |
25 | entryCopy.setPublicId(matchingEntry.getPublicId());↵ | 27 | entryCopy.setPublicId(matchingEntry.getPublicId());↵ | |
26 | entryCopy.setLocation(matchingEntry.getLocation());↵ | 28 | entryCopy.setLocation(matchingEntry.getLocation());↵ | |
27 | source = filesystemLookup(entryCopy);↵ | 29 | source = filesystemLookup(entryCopy);↵ | |
28 | if (source == null) {↵ | 30 | if (source == null) {↵ | |
29 | source = classpathLookup(entryCopy);↵ | 31 | source = classpathLookup(entryCopy);↵ | |
30 | } | 32 |
| |
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.5 |
Clones location | Clones are in the same java file |
Number of node comparisons | 35 |
Number of mapped statements | 12 |
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) | 8.2 |
Clone type | Type 1 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
5 | log("Matching catalog entry found for uri: '" + matchingEntry.getPublicId() + "' location: '" + matchingEntry.getLocation() + "'", Project.MSG_DEBUG); | 6 | log("Matching catalog entry found for uri: '" + matchingEntry.getPublicId() + "' location: '" + matchingEntry.getLocation() + "'", Project.MSG_DEBUG); | |
6 | ResourceLocation entryCopy = matchingEntry; | 7 | ResourceLocation entryCopy = matchingEntry; | |
7 | if (base != null) | 8 | if (base != null) | |
8 | try | 9 | try | |
9 | URL baseURL = new URL(base); | 10 | URL baseURL = new URL(base); | |
10 | entryCopy = new ResourceLocation(); | 11 | entryCopy = new ResourceLocation(); | |
11 | entryCopy.setBase(baseURL); | 12 | entryCopy.setBase(baseURL); | |
12 | entryCopy.setPublicId(matchingEntry.getPublicId()); | 13 | entryCopy.setPublicId(matchingEntry.getPublicId()); | |
13 | entryCopy.setLocation(matchingEntry.getLocation()); | 14 | entryCopy.setLocation(matchingEntry.getLocation()); | |
14 | source = filesystemLookup(entryCopy); | 15 | source = filesystemLookup(entryCopy); | |
15 | if (source == null) | 16 | if (source == null) | |
16 | source = classpathLookup(entryCopy); | 17 | source = classpathLookup(entryCopy); |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variables source, entryCopy , while Clone fragment #2 returns variables source |