while (this.SUBSCRIBER.count(0) < this.loop) { try { Thread.sleep(0, 50); } catch (Exception e) { log.info(e.getMessage()); } }
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/SubscriberSampler.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/action/RemoteStart.java
Method name: SampleResult sampleWithReceive() Method name: void doRemoteStart(String)
Number of AST nodes: 3 Number of AST nodes: 3
1
while (this.SUBSCRIBER.count(0) < this.loop) {
1
if (engine != null) {
2
			try {
2
			try {
3
				Thread.sleep(0, 50);
3
				engine.runTest();
4
			} catch (Exception e) {
4
			} catch (JMeterEngineException e) {
5
				log.info(e.getMessage());
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 statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)33.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    10
    try
    10
    try
    3
    try
    Differences
    Expression1Expression2Difference
    java.lang.Exceptionorg.apache.jmeter.engine.JMeterEngineExceptionSUBCLASS_TYPE_MISMATCH
    java.lang.Exceptionorg.apache.jmeter.engine.JMeterEngineExceptionSUBCLASS_TYPE_MISMATCH
    inforeportErrorToUserMETHOD_INVOCATION_NAME_MISMATCH
    org.apache.log.Loggerorg.apache.jmeter.util.JMeterUtilsVARIABLE_TYPE_MISMATCH
    log.info(e.getMessage())JMeterUtils.reportErrorToUser(e.getMessage(),JMeterUtils.getResString("remote_error_starting"))TYPE_COMPATIBLE_REPLACEMENT
    log.info(e.getMessage())JMeterUtils.reportErrorToUser(e.getMessage(),JMeterUtils.getResString("remote_error_starting"))ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression log.info(e.getMessage()) 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 log.info(e.getMessage()) 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 log 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 log.info(e.getMessage()) 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 log.info(e.getMessage()) 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();
    11
    Thread.sleep(0, 50);
    11
    Thread.sleep(0, 50);
    Preondition Violations
    Unmatched statement Thread.sleep(0,50); 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 (13)
    Row Violation
    1Expression log.info(e.getMessage()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression JMeterUtils.reportErrorToUser(e.getMessage(),JMeterUtils.getResString("remote_error_starting")) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression log.info(e.getMessage()) is a void method call, and thus it cannot be parameterized
    4Expression JMeterUtils.reportErrorToUser(e.getMessage(),JMeterUtils.getResString("remote_error_starting")) is a void method call, and thus it cannot be parameterized
    5Type org.apache.log.Logger of variable log does not match with type org.apache.jmeter.util.JMeterUtils of variable JMeterUtils
    6Expression log.info(e.getMessage()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression JMeterUtils.reportErrorToUser(e.getMessage(),JMeterUtils.getResString("remote_error_starting")) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression log.info(e.getMessage()) is a void method call, and thus it cannot be parameterized
    9Expression JMeterUtils.reportErrorToUser(e.getMessage(),JMeterUtils.getResString("remote_error_starting")) is a void method call, and thus it cannot be parameterized
    10Unmatched statement engine.runTest(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    11Unmatched 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
    12Unmatched statement Thread.sleep(0,50); 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
    13The refactoring of the clones is infeasible, because classes org.apache.jmeter.protocol.jms.sampler.SubscriberSampler and org.apache.jmeter.gui.action.RemoteStart do not have a common superclass