try { listener.testStarted(); } catch (Exception ex) { log.error("", ex); // $NON-NLS-1$ }
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/samplers/RemoteTestListenerWrapper.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/action/RemoteStart.java
Method name: void testStarted() Method name: void doRemoteStart(String)
Number of AST nodes: 2 Number of AST nodes: 3
1
try {
2
			listener.testStarted
1
if (engine != null) {
2
			try {
3
();
3
				engine.runTest();
4
		} catch (Exception ex) {
4
			} catch (JMeterEngineException e) {
5
			log.error("", ex); // $NON-NLS-1$
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.3
Clones locationClones are in different classes
Number of node comparisons4
  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.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    try
    1
    try
    3
    try
    Differences
    Expression1Expression2Difference
    java.lang.Exceptionorg.apache.jmeter.engine.JMeterEngineExceptionSUBCLASS_TYPE_MISMATCH
    exeVARIABLE_NAME_MISMATCH
    java.lang.Exceptionorg.apache.jmeter.engine.JMeterEngineExceptionSUBCLASS_TYPE_MISMATCH
    ""e.getMessage()TYPE_COMPATIBLE_REPLACEMENT
    exJMeterUtils.getResString("remote_error_starting")AST_TYPE_MISMATCH
    errorreportErrorToUserMETHOD_INVOCATION_NAME_MISMATCH
    org.apache.log.Loggerorg.apache.jmeter.util.JMeterUtilsVARIABLE_TYPE_MISMATCH
    log.error("",ex)JMeterUtils.reportErrorToUser(e.getMessage(),JMeterUtils.getResString("remote_error_starting"))TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression e.getMessage() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression log.error("",ex) 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.error("",ex) 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.error("",ex) 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.error("",ex) 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
    2
    listener.testStarted();
    2
    listener.testStarted();
    Preondition Violations
    Unmatched statement listener.testStarted(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement listener.testStarted(); 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();
    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();
    Precondition Violations (16)
    Row Violation
    1Expression e.getMessage() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression ex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression log.error("",ex) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression JMeterUtils.reportErrorToUser(e.getMessage(),JMeterUtils.getResString("remote_error_starting")) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression log.error("",ex) is a void method call, and thus it cannot be parameterized
    6Expression JMeterUtils.reportErrorToUser(e.getMessage(),JMeterUtils.getResString("remote_error_starting")) is a void method call, and thus it cannot be parameterized
    7Type org.apache.log.Logger of variable log does not match with type org.apache.jmeter.util.JMeterUtils of variable JMeterUtils
    8Expression log.error("",ex) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression JMeterUtils.reportErrorToUser(e.getMessage(),JMeterUtils.getResString("remote_error_starting")) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression log.error("",ex) is a void method call, and thus it cannot be parameterized
    11Expression JMeterUtils.reportErrorToUser(e.getMessage(),JMeterUtils.getResString("remote_error_starting")) is a void method call, and thus it cannot be parameterized
    12Unmatched statement listener.testStarted(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    13Unmatched statement listener.testStarted(); 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
    14Unmatched statement engine.runTest(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    15Unmatched 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
    16The refactoring of the clones is infeasible, because classes org.apache.jmeter.samplers.RemoteTestListenerWrapper and org.apache.jmeter.gui.action.RemoteStart do not have a common superclass