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. Of↵ | 10 | // so matchingEntry's original base is untouched.↵ | |
11 | // course, if there is no base, no need to make a↵ | |||
12 | // copy...↵ | |||
13 | //↵ | 11 | //↵ | |
14 | // This is the standard behavior as per my reading of↵ | 12 | // This is the standard behavior as per my reading of↵ | |
15 | // the JAXP and XML Catalog specs. CKS 11/7/2002↵ | 13 | // the JAXP and XML Catalog specs. CKS 11/7/2002↵ | |
16 | //↵ | 14 | //↵ | |
17 | ResourceLocation entryCopy = matchingEntry;↵ | 15 | ResourceLocation entryCopy = matchingEntry;↵ | |
18 | if (base != null) {↵ | 16 | if (base != null) {↵ | |
19 | try {↵ | 17 | try {↵ | |
20 | URL baseURL = new URL(base);↵ | 18 | URL baseURL = new URL(base);↵ | |
21 | entryCopy = new ResourceLocation();↵ | 19 | entryCopy = new ResourceLocation();↵ | |
22 | entryCopy.setBase(baseURL);↵ | 20 | entryCopy.setBase(baseURL);↵ | |
23 | } catch (MalformedURLException ex) {↵ | 21 | } catch (MalformedURLException ex) {↵ | |
24 | // ignore↵ | 22 | // ignore↵ | |
25 | }↵ | 23 | }↵ | |
26 | }↵ | 24 | }↵ | |
27 | entryCopy.setPublicId(matchingEntry.getPublicId());↵ | 25 | entryCopy.setPublicId(matchingEntry.getPublicId());↵ | |
28 | entryCopy.setLocation(matchingEntry.getLocation());↵ | 26 | entryCopy.setLocation(matchingEntry.getLocation());↵ | |
29 | source = filesystemLookup(entryCopy);↵ | 27 | source = filesystemLookup(entryCopy);↵ | |
30 | if (source == null) {↵ | 28 | if (source == null) {↵ | |
31 | source = classpathLookup(entryCopy);↵ | 29 | source = classpathLookup(entryCopy);↵ | |
32 | } | 30 |
| |
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 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) | 5.7 |
Clone type | Type 1 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
6 | log("Matching catalog entry found for uri: '" + matchingEntry.getPublicId() + "' location: '" + matchingEntry.getLocation() + "'", Project.MSG_DEBUG); | 5 | log("Matching catalog entry found for uri: '" + matchingEntry.getPublicId() + "' location: '" + matchingEntry.getLocation() + "'", Project.MSG_DEBUG); | |
7 | ResourceLocation entryCopy = matchingEntry; | 6 | ResourceLocation entryCopy = matchingEntry; | |
8 | if (base != null) | 7 | if (base != null) | |
9 | try | 8 | try | |
10 | URL baseURL = new URL(base); | 9 | URL baseURL = new URL(base); | |
11 | entryCopy = new ResourceLocation(); | 10 | entryCopy = new ResourceLocation(); | |
12 | entryCopy.setBase(baseURL); | 11 | entryCopy.setBase(baseURL); | |
13 | entryCopy.setPublicId(matchingEntry.getPublicId()); | 12 | entryCopy.setPublicId(matchingEntry.getPublicId()); | |
14 | entryCopy.setLocation(matchingEntry.getLocation()); | 13 | entryCopy.setLocation(matchingEntry.getLocation()); | |
15 | source = filesystemLookup(entryCopy); | 14 | source = filesystemLookup(entryCopy); | |
16 | if (source == null) | 15 | if (source == null) | |
17 | source = classpathLookup(entryCopy); | 16 | source = classpathLookup(entryCopy); |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variables source , while Clone fragment #2 returns variables source, entryCopy |