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
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.3
Clones locationClones are in different classes
Number of node comparisons64
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)3.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    try
    1
    try
    2
    log.info("Subscriber closed");
    2
    log.info("Subscriber closed");
    2
    log.info("Publisher closed");
    Differences
    Expression1Expression2Difference
    "Subscriber closed""Publisher closed"LITERAL_VALUE_MISMATCH
    2
    log.info("Publisher closed");
    3
    this.SUBSCRIBER.close();
    3
    this.SUBSCRIBER.close();
    3
    this.PUBLISHER.close();
    Differences
    Expression1Expression2Difference
    SUBSCRIBERPUBLISHERVARIABLE_NAME_MISMATCH
    javax.jms.TopicSubscriberjavax.jms.TopicPublisherVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type javax.jms.TopicSubscriber of variable this.SUBSCRIBER does not match with type javax.jms.TopicPublisher of variable this.PUBLISHER
    • Make classes javax.jms.TopicSubscriber and javax.jms.TopicPublisher extend a common superclass
    3
    this.PUBLISHER.close();
    4
    this.SESSION.close();
    4
    this.SESSION.close();
    5
    this.CONN.close();
    5
    this.CONN.close();
                                                  
    6
    this.PUBLISHER = null;
    6
    this.SUBSCRIBER = null;
                                                    
    7
    this.SESSION = null;
    7
    this.SESSION = null;
    8
    this.CONN = null;
    8
    this.CONN = null;
    Precondition Violations (1)
    Row Violation
    1Type javax.jms.TopicSubscriber of variable this.SUBSCRIBER does not match with type javax.jms.TopicPublisher of variable this.PUBLISHER