File path: /apache-ant-1.7.0/src/org/apache/tools/ant/TaskAdapter.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/TaskAdapter.java | |||
Method name: void execute()
|
Method name: void execute()
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | try {↵ | 1 | try {↵ | |
2 | Method setLocationM = proxy.getClass().getMethod(↵ | 2 | Method setProjectM = proxy.getClass().getMethod(↵ | |
3 | "setLocation", new Class[] {Location.class});↵ | 3 | "setProject", new Class[] {Project.class});↵ | |
4 | if (setLocationM != null) {↵ | 4 | if (setProjectM != null) {↵ | |
5 | setLocationM.invoke(proxy, new Object[] {getLocation()});↵ | 5 | setProjectM.invoke(proxy, new Object[] {getProject()});↵ | |
6 | }↵ | 6 | }↵ | |
7 | } catch (NoSuchMethodException e) {↵ | 7 | } catch (NoSuchMethodException e) {↵ | |
8 | // ignore this if the class being used as a task does not have↵ | 8 | // ignore this if the class being used as a task does not have↵ | |
9 | // a set location method.↵ | 9 | // a set project method.↵ | |
10 | } catch (Exception ex) {↵ | 10 | } catch (Exception ex) {↵ | |
11 | log("Error setting location in " + proxy.getClass(),↵ | 11 | log("Error setting project in " + proxy.getClass(),↵ | |
12 | Project.MSG_ERR);↵ | 12 | Project.MSG_ERR);↵ | |
13 | throw new BuildException(ex);↵ | 13 | throw new BuildException(ex);↵ | |
14 | } | 14 |
| |
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 method |
Number of node comparisons | 8 |
Number of mapped statements | 3 |
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) | 1.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | try |
| 5 | try | |||||||||||||
2 | Method setLocationM = proxy.getClass().getMethod("setLocation", new Class[] {Location.class}); |
| 6 | Method setProjectM = proxy.getClass().getMethod("setProject", new Class[] {Project.class}); | |||||||||||||
3 | if (setLocationM != null) |
| 7 | if (setProjectM != null) | |||||||||||||
4 | setLocationM.invoke(proxy, new Object[] {getLocation()}); |
| | ||||||||||||||
|
| 8 | setProjectM.invoke(proxy, new Object[] {getProject()}); |
Row | Violation |
---|---|
1 | Unmatched statement setLocationM.invoke(proxy,new Object[]{getLocation()}); 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 setProjectM.invoke(proxy,new Object[]{getProject()}); 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 |