try {
log.info("Subscriber closed");
this.SUBSCRIBER.close();
this.SESSION.close();
this.CONN.close();
this.SUBSCRIBER = null;
this.SESSION = null;
this.CONN = null;
} catch (JMSException e) {
log.error(e.getMessage());
} catch (Throwable e) {
log.error(e.getMessage());
}
try {
log.info("Publisher closed");
this.PUBLISHER.close();
this.SESSION.close();
this.CONN.close();
this.PUBLISHER = null;
this.SESSION = null;
this.CONN = null;
} catch (JMSException e) {
log.error(e.getMessage());
} catch (Throwable e) {
log.error(e.getMessage());
}
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/jms/client/OnMessageSubscriber.java
|
|
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/jms/client/Publisher.java
|
Method name: void close()
|
|
Method name: void close()
|
Number of AST nodes: 8
|
|
Number of AST nodes: 8
|
|
1 | try {↵ | | 1 | try {↵
|
2 | log.info("Subscriber closed");↵ | | 2 | log.info("Publisher closed");↵
|
3 | this.SUBSCRIBER.close();↵ | | 3 | this.PUBLISHER.close();↵
|
4 | this.SESSION.close();↵ | | 4 | this.SESSION.close();↵
|
5 | this.CONN.close();↵ | | 5 | this.CONN.close();↵
|
6 | this.SUBSCRIBER = null;↵ | | 6 | this.PUBLISHER = null;↵
|
7 | this.SESSION = null;↵ | | 7 | this.SESSION = null;↵
|
8 | this.CONN = null;↵ | | 8 | this.CONN = null;↵
|
9 | } catch (JMSException e) {↵ | | 9 | } catch (JMSException e) {↵
|
10 | log.error(e.getMessage());↵ | | 10 | log.error(e.getMessage());↵
|
11 | } catch (Throwable e) {↵ | | 11 | } catch (Throwable e) {↵
|
12 | log.error(e.getMessage());↵ | | 12 | log.error(e.getMessage());↵
|
13 | } | | 13 | }
|
See real code fragment |
|
See real code fragment |
Summary
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.6 |
Clones location | Clones are in different classes |
Number of node comparisons | 64 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 7 |
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) | 6.1 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | try | | 1 | try |
2 | log.info("Subscriber closed"); | | 2 | log.info("Publisher closed"); |
3 | | | 3 | |
4 | | | 4 | |
5 | | | 5 | |
| | | 6 | |
6 | | | | |
7 | | | 7 | |
8 | | | 8 | |
Precondition Violations (3)
Row |
Violation |
1 | Type javax.jms.TopicSubscriber of variable this.SUBSCRIBER does not match with type javax.jms.TopicPublisher of variable this.PUBLISHER |
2 | Unmatched statement this.PUBLISHER=null; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched statement this.SUBSCRIBER=null; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |