File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/reflect/ClassTools.java | File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/reflect/ClassTools.java | |||
Method name: Object construct(String)
|
Method name: void invoke(Object, String)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | Object instance = null;↵ | 1 | Method m;↵ | |
2 | try {↵ | 2 | try {↵ | |
3 | instance = ClassUtils.getClass(className).newI↵ | 3 | m = ClassUtils.getPublicMethod(instance.getClass(), methodName, new Class [] {});↵ | |
4 | nstance();↵ | 4 | m.invoke(instance, null);↵ | |
5 | } catch (ClassNotFoundException e) {↵ | 5 | } catch (NoSuchMethodException e) {↵ | |
6 | throw new JMeterException(e);↵ | 6 | throw new JMeterException(e);↵ | |
7 | } catch (InstantiationException e) {↵ | 7 | } catch (IllegalAccessException e) {↵ | |
8 | throw new JMeterException(e);↵ | 8 | throw new JMeterException(e);↵ | |
9 | } catch (IllegalAccessException e) {↵ | 9 | } catch (InvocationTargetException e) {↵ | |
10 | throw new JMeterException(e);↵ | 10 | throw new JMeterException(e);↵ | |
11 | }↵ | 11 |
| |
12 | return instance; | |||
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) | 1.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 8 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 2.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Method m; | ||||||||||||||||||||||||||||||||||||
1 | Object instance = null; | | ||||||||||||||||||||||||||||||||||||
2 | try |
| 2 | try | ||||||||||||||||||||||||||||||||||
|
| 3 | m = ClassUtils.getPublicMethod(instance.getClass(), methodName, new Class[] {}); | |||||||||||||||||||||||||||||||||||
3 | instance = ClassUtils.getClass(className).newInstance(); |
| | |||||||||||||||||||||||||||||||||||
|
| 4 | m.invoke(instance, null); | |||||||||||||||||||||||||||||||||||
4 | return instance; |
| |
Row | Violation |
---|---|
1 | Unmatched statement m=ClassUtils.getPublicMethod(instance.getClass(),methodName,new Class[]{}); 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 instance=ClassUtils.getClass(className).newInstance(); 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 |
3 | Unmatched statement m.invoke(instance,null); 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 |
4 | Unmatched return instance; |