if (connection != null) { try { connection.close(); } catch (JMSException e) { LOGGER.info(e.getLocalizedMessage()); } }
if(channel != null) { try { channel.close(); } catch(IOException iex) { log.debug("Error closing channel",iex); } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/jms/sampler/JMSSampler.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/sampler/AjpSampler.java
Method name: void threadFinished() Method name: void threadFinished()
Number of AST nodes: 3 Number of AST nodes: 3
1
if (connection != null) {
1
if(channel != null) {
2
			try {
3
				connection.close();
4
			
2
            try {
3
            channel.close();
5
} catch (JMSException e) {
4
            } catch(IOException iex) {
6
				LOGGER.info(e.getLocalizedMessage());
7
			}
8
		
5
            log.debug("Error closing channel",iex);
6
            }
9
}
7
        }
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.5
Clones locationClones are in different classes having the same super class
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    if (connection != null)
    5
    if (connection != null)
    1
    if (channel != null)
    Differences
    Expression1Expression2Difference
    connectionchannelVARIABLE_NAME_MISMATCH
    javax.jms.QueueConnectionjava.net.SocketVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type javax.jms.QueueConnection of variable connection does not match with type java.net.Socket of variable channel
    • Make classes javax.jms.QueueConnection and java.net.Socket extend a common superclass
    1
    if (channel != null)
    6
    try
    6
    try
    2
    try
    Differences
    Expression1Expression2Difference
    javax.jms.JMSExceptionjava.io.IOExceptionSUBCLASS_TYPE_MISMATCH
    eiexVARIABLE_NAME_MISMATCH
    javax.jms.JMSExceptionjava.io.IOExceptionSUBCLASS_TYPE_MISMATCH
    infodebugMETHOD_INVOCATION_NAME_MISMATCH
    LOGGERlogVARIABLE_NAME_MISMATCH
    LOGGER.info(e.getLocalizedMessage())log.debug("Error closing channel",iex)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression LOGGER.info(e.getLocalizedMessage()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression log.debug("Error closing channel",iex) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression LOGGER.info(e.getLocalizedMessage()) is a void method call, and thus it cannot be parameterized
    Expression log.debug("Error closing channel",iex) is a void method call, and thus it cannot be parameterized
    Expression LOGGER.info(e.getLocalizedMessage()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression log.debug("Error closing channel",iex) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression LOGGER.info(e.getLocalizedMessage()) is a void method call, and thus it cannot be parameterized
    Expression log.debug("Error closing channel",iex) is a void method call, and thus it cannot be parameterized
    2
    try
    7
    connection.close();
    7
    connection.close();
    3
    channel.close();
    Differences
    Expression1Expression2Difference
    connectionchannelVARIABLE_NAME_MISMATCH
    javax.jms.QueueConnectionjava.net.SocketVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type javax.jms.QueueConnection of variable connection does not match with type java.net.Socket of variable channel
    • Make classes javax.jms.QueueConnection and java.net.Socket extend a common superclass
    3
    channel.close();
    Precondition Violations (10)
    Row Violation
    1Type javax.jms.QueueConnection of variable connection does not match with type java.net.Socket of variable channel
    2Expression LOGGER.info(e.getLocalizedMessage()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression log.debug("Error closing channel",iex) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression LOGGER.info(e.getLocalizedMessage()) is a void method call, and thus it cannot be parameterized
    5Expression log.debug("Error closing channel",iex) is a void method call, and thus it cannot be parameterized
    6Expression LOGGER.info(e.getLocalizedMessage()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression log.debug("Error closing channel",iex) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression LOGGER.info(e.getLocalizedMessage()) is a void method call, and thus it cannot be parameterized
    9Expression log.debug("Error closing channel",iex) is a void method call, and thus it cannot be parameterized
    10Type javax.jms.QueueConnection of variable connection does not match with type java.net.Socket of variable channel