if (connection != null) { try { connection.close(); } catch (JMSException e) { LOGGER.info(e.getLocalizedMessage()); } }
if (engine != null) { try { engine.runTest(); } catch (JMeterEngineException e) { JMeterUtils.reportErrorToUser(e.getMessage(),JMeterUtils.getResString("remote_error_starting")); // $NON-NLS-1$ } }
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/gui/action/RemoteStart.java
Method name: void threadFinished() Method name: void doRemoteStart(String)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (connection != null) {
1
if (engine != null) {
2
			try {
2
			try {
3
				connection.close();
3
				engine.runTest();
4
			} catch (JMSException e) {
4
			} catch (JMeterEngineException e) {
5
				LOGGER.info(e.getLocalizedMessage());
5
				JMeterUtils.reportErrorToUser(e.getMessage(),JMeterUtils.getResString("remote_error_starting")); // $NON-NLS-1$
6
			}
6
			}
7
		}
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.4
Clones locationClones are in different classes
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)32.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    if (connection != null)
    5
    if (connection != null)
    2
    if (engine != null)
    Differences
    Expression1Expression2Difference
    connectionengineVARIABLE_NAME_MISMATCH
    javax.jms.QueueConnectionorg.apache.jmeter.engine.JMeterEngineVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type javax.jms.QueueConnection of variable connection does not match with type org.apache.jmeter.engine.JMeterEngine of variable engine
    • Make classes javax.jms.QueueConnection and org.apache.jmeter.engine.JMeterEngine extend a common superclass
    2
    if (engine != null)
    6
    try
    6
    try
    3
    try
    Differences
    Expression1Expression2Difference
    javax.jms.JMSExceptionorg.apache.jmeter.engine.JMeterEngineExceptionSUBCLASS_TYPE_MISMATCH
    javax.jms.JMSExceptionorg.apache.jmeter.engine.JMeterEngineExceptionSUBCLASS_TYPE_MISMATCH
    inforeportErrorToUserMETHOD_INVOCATION_NAME_MISMATCH
    org.apache.log.Loggerorg.apache.jmeter.util.JMeterUtilsVARIABLE_TYPE_MISMATCH
    LOGGER.info(e.getLocalizedMessage())JMeterUtils.reportErrorToUser(e.getMessage(),JMeterUtils.getResString("remote_error_starting"))TYPE_COMPATIBLE_REPLACEMENT
    LOGGER.info(e.getLocalizedMessage())JMeterUtils.reportErrorToUser(e.getMessage(),JMeterUtils.getResString("remote_error_starting"))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 JMeterUtils.reportErrorToUser(e.getMessage(),JMeterUtils.getResString("remote_error_starting")) 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 JMeterUtils.reportErrorToUser(e.getMessage(),JMeterUtils.getResString("remote_error_starting")) is a void method call, and thus it cannot be parameterized
    Type org.apache.log.Logger of variable LOGGER does not match with type org.apache.jmeter.util.JMeterUtils of variable JMeterUtils
    • Make classes org.apache.log.Logger and org.apache.jmeter.util.JMeterUtils extend a common superclass
    Expression LOGGER.info(e.getLocalizedMessage()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression JMeterUtils.reportErrorToUser(e.getMessage(),JMeterUtils.getResString("remote_error_starting")) 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 JMeterUtils.reportErrorToUser(e.getMessage(),JMeterUtils.getResString("remote_error_starting")) is a void method call, and thus it cannot be parameterized
    3
    try
                                            
    4
    engine.runTest();
    Preondition Violations
    Unmatched statement engine.runTest(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement engine.runTest(); 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
    4
    engine.runTest();
    7
    connection.close();
    7
    connection.close();
    Preondition Violations
    Unmatched statement connection.close(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement connection.close(); 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
                                                
    Precondition Violations (15)
    Row Violation
    1Type javax.jms.QueueConnection of variable connection does not match with type org.apache.jmeter.engine.JMeterEngine of variable engine
    2Expression LOGGER.info(e.getLocalizedMessage()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression JMeterUtils.reportErrorToUser(e.getMessage(),JMeterUtils.getResString("remote_error_starting")) 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 JMeterUtils.reportErrorToUser(e.getMessage(),JMeterUtils.getResString("remote_error_starting")) is a void method call, and thus it cannot be parameterized
    6Type org.apache.log.Logger of variable LOGGER does not match with type org.apache.jmeter.util.JMeterUtils of variable JMeterUtils
    7Expression LOGGER.info(e.getLocalizedMessage()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression JMeterUtils.reportErrorToUser(e.getMessage(),JMeterUtils.getResString("remote_error_starting")) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression LOGGER.info(e.getLocalizedMessage()) is a void method call, and thus it cannot be parameterized
    10Expression JMeterUtils.reportErrorToUser(e.getMessage(),JMeterUtils.getResString("remote_error_starting")) is a void method call, and thus it cannot be parameterized
    11Unmatched statement engine.runTest(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    12Unmatched statement engine.runTest(); 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
    13Unmatched statement connection.close(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    14Unmatched statement connection.close(); 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
    15The refactoring of the clones is infeasible, because classes org.apache.jmeter.protocol.jms.sampler.JMSSampler and org.apache.jmeter.gui.action.RemoteStart do not have a common superclass