public void initConnection(Context ctx, String connfactory, String topic) { try { ConnectionFactory.getTopicConnectionFactory(ctx,connfactory); this.CONN = ConnectionFactory.getTopicConnection(); this.TOPIC = InitialContextFactory.lookupTopic(ctx, topic); this.SESSION = this.CONN.createTopicSession(false, TopicSession.AUTO_ACKNOWLEDGE); this.PUBLISHER = this.SESSION.createPublisher(this.TOPIC); log.info("created the topic connection successfully"); } catch (JMSException e) { log.error("Connection error: " + e.getMessage());
public void initConnection(Context ctx, String connfactory, String topic) { try { ConnectionFactory.getTopicConnectionFactory(ctx,connfactory); this.CONN = ConnectionFactory.getTopicConnection(); this.TOPIC = InitialContextFactory.lookupTopic(ctx, topic); this.SESSION = this.CONN.createTopicSession(false, TopicSession.AUTO_ACKNOWLEDGE); this.SUBSCRIBER = this.SESSION.createSubscriber(this.TOPIC); log.info("created the topic connection successfully"); } catch (JMSException e) { log.error("Connection error: " + e.getMessage());
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/jms/client/Publisher.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/jms/client/ReceiveSubscriber.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public void initConnection(Context ctx, String connfactory, String topic) {
1
public void initConnection(Context ctx, String connfactory, String topic) {
2
		try {
2
		try {
3
			ConnectionFactory.getTopicConnectionFactory(ctx,connfactory);
3
			ConnectionFactory.getTopicConnectionFactory(ctx,connfactory);
4
			this.CONN = ConnectionFactory.getTopicConnection();
4
			this.CONN = ConnectionFactory.getTopicConnection();
5
			this.TOPIC = InitialContextFactory.lookupTopic(ctx, topic);
5
			this.TOPIC = InitialContextFactory.lookupTopic(ctx, topic);
6
			this.SESSION = this.CONN.createTopicSession(false, TopicSession.AUTO_ACKNOWLEDGE);
6
			this.SESSION = this.CONN.createTopicSession(false, TopicSession.AUTO_ACKNOWLEDGE);
7
			this.PUBLISHER = this.SESSION.createPublisher(this.TOPIC);
7
			this.SUBSCRIBER = this.SESSION.createSubscriber(this.TOPIC);
8
			log.info("created the topic connection successfully");
8
			log.info("created the topic connection successfully");
9
		} catch (JMSException e) {
9
		} catch (JMSException e) {
10
			log.error("Connection error: " + e.getMessage());
10
			log.error("Connection error: " + e.getMessage());
11
		
11
		
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0