File path: /jakarta-jmeter-2.3.2/src/junit/org/apache/jmeter/protocol/java/sampler/JUnitSampler.java | File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/jms/client/ConnectionFactory.java | |||
Method name: Method getRunTestMethod(Object)
|
Method name: TopicConnection getTopicConnection()
|
|||
Number of AST nodes: 5 | Number of AST nodes: 4 | |||
1 | if (clazz != null){↵ | 1 | if (factory != null)↵ | |
2 | // log.info("class " + clazz.getClass().getName() +↵ | |||
3 | // " method name is " + RUNTEST);↵ | |||
4 | try {↵ | |||
5 | Class[] param = {TestResult.class};↵ | |||
6 | return clazz.getClass().getMethod(RUNTEST,param);↵ | |||
7 | } catch (NoSuchMethodException e) {↵ | |||
8 | log.warn(e.getMessage());↵ | |||
9 | }↵ | |||
10 | }↵ | |||
11 | ↵ | 2 | {↵ | |
3 | try {↵ | |||
4 | return factory.createTopicConnection();↵ | |||
5 | } catch (JMSException e) {↵ | |||
6 | log.error(e.getMessage());↵ | |||
7 | }↵ | |||
8 | }↵ | |||
12 | return null; | 9 | return null; | |
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 different classes |
Number of node comparisons | 8 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 9.3 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (clazz != null) |
| 1 | if (factory != null) | |||||||||||||||||||||
2 | try |
| 2 | try | |||||||||||||||||||||
|
| 3 | return factory.createTopicConnection(); | ||||||||||||||||||||||
3 | Class[] param = {TestResult.class}; | | |||||||||||||||||||||||
4 | return clazz.getClass().getMethod(RUNTEST, param); |
| | ||||||||||||||||||||||
5 | return null; | 4 | return null; |
Row | Violation |
---|---|
1 | Type java.lang.Object of variable clazz does not match with type javax.jms.TopicConnectionFactory of variable factory |
2 | Expression log.warn(e.getMessage()) is a void method call, and thus it cannot be parameterized |
3 | Expression log.error(e.getMessage()) is a void method call, and thus it cannot be parameterized |
4 | Unmatched statement return factory.createTopicConnection(); 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 |
5 | Unmatched return factory.createTopicConnection(); |
6 | Unmatched return clazz.getClass().getMethod(RUNTEST,param); |