File path: /apache-ant-1.7.0/src/org/apache/tools/ant/IntrospectionHelper.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/IntrospectionHelper.java | |||
Method name: void setAttribute(Project, Object, String, String)
|
Method name: void addText(Project, Object, String)
|
|||
Number of AST nodes: 2 | Number of AST nodes: 2 | |||
1 | try {↵ | 1 | try {↵ | |
2 | as.set(p, element, value);↵ | 2 | addText.invoke(element, new Object[] {text});↵ | |
3 | } catch (IllegalAccessException ie) {↵ | 3 | } catch (IllegalAccessException ie) {↵ | |
4 | // impossible as getMethods should only return public methods↵ | 4 | // impossible as getMethods should only return public methods↵ | |
5 | throw new BuildException(ie);↵ | 5 | throw new BuildException(ie);↵ | |
6 | } catch (InvocationTargetException ite) {↵ | 6 | } catch (InvocationTargetException ite) {↵ | |
7 | Throwable t = ite.getTargetException();↵ | 7 | Throwable t = ite.getTargetException();↵ | |
8 | if (t instanceof BuildException) {↵ | 8 | if (t instanceof BuildException) {↵ | |
9 | throw (BuildException) t;↵ | 9 | throw (BuildException) t;↵ | |
10 | }↵ | 10 | }↵ | |
11 | throw new BuildException(t);↵ | 11 | throw new BuildException(t);↵ | |
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 declared in the same class |
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.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||
---|---|---|---|---|---|---|---|
19 | try | 7 | try | ||||
|
| 8 | addText.invoke(element, new Object[] {text}); | ||||
20 | as.set(p, element, value); |
| |
Row | Violation |
---|---|
1 | Unmatched statement addText.invoke(element,new Object[]{text}); 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 |
2 | Unmatched statement as.set(p,element,value); 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 |