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/resources/Tokens.java | |||
Method name: InputSource resolveEntity(String, String)
|
Method name: Collection getCollection()
|
|||
Number of AST nodes: 3 | Number of AST nodes: 2 | |||
1 | if (result == null) {↵ | |||
2 | try {↵ | |||
3 | result =↵ | |||
4 | (InputSource) resolveEntity.invoke(resolverImpl,↵ | |||
5 | new Object[] {publicId, systemId});↵ | |||
6 | ↵ | 1 | try {↵ | |
2 | rdr = new InputStreamReader(cat, encoding);↵ | |||
7 | } catch (Exception ex) {↵ | 3 | } catch (UnsupportedEncodingException e) {↵ | |
8 | throw new BuildException(ex);↵ | 4 | throw new BuildException(e);↵ | |
9 | }↵ | |||
10 | } | 5 |
| |
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 | 4 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
10 | try |
| 11 | try | ||||||||||||||||||||||
11 | result = (InputSource)resolveEntity.invoke(resolverImpl, new Object[] {publicId, systemId}); |
| | |||||||||||||||||||||||
| 12 | rdr = new InputStreamReader(cat, encoding); |
Row | Violation |
---|---|
1 | Unmatched statement result=(InputSource)resolveEntity.invoke(resolverImpl,new Object[]{publicId,systemId}); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |