if (bshInterpreter == null || !hasInitFile) { return; } try { bshInterpreter.eval((new StringBuffer("testEnded(")) // $NON-NLS-1$ .append(host) .append(")") // $NON-NLS-1$ .toString()); // $NON-NLS-1$ } catch (JMeterException ignored) { log.debug(getClass().getName() + " : " + ignored.getLocalizedMessage()); // $NON-NLS-1$ }
if (bshInterpreter == null || !hasInitFile) { return; } try { bshInterpreter.evalNoLog("testEnded()"); // $NON-NLS-1$ } catch (JMeterException ignored) { log.debug(getClass().getName() + " : " + ignored.getLocalizedMessage()); // $NON-NLS-1$ }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/util/BeanShellTestElement.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/util/BeanShellTestElement.java
Method name: void testEnded(String) Method name: void testEnded()
Number of AST nodes: 4 Number of AST nodes: 4
1
if (bshInterpreter == null || !hasInitFile) {
1
if (bshInterpreter == null || !hasInitFile) {
2
            return;
2
            return;
3
        }
3
        }
4
		try {
4
		try {
5
			bshInterpreter.eval((new StringBuffer("testEnded(")) // $NON-NLS-1$
5
			bshInterpreter.eval
6
					.append(host)
7
					.append(")") // $NON-NLS-1$
8
					.toString()); // $NON-NLS-1$
6
NoLog("testEnded()"); // $NON-NLS-1$
9
		} catch (JMeterException ignored) {
7
		} catch (JMeterException ignored) {
10
            log.debug(getClass().getName() + " : " + ignored.getLocalizedMessage()); // $NON-NLS-1$
8
            log.debug(getClass().getName() + " : " + ignored.getLocalizedMessage()); // $NON-NLS-1$
11
		}
9
		}
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 declared in the same class
Number of node comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (bshInterpreter == null || !hasInitFile)
    1
    if (bshInterpreter == null || !hasInitFile)
    2
    return;
    2
    return;
    3
    try
    3
    try
    4
    bshInterpreter.eval((new StringBuffer("testEnded(")).append(host).append(")").toString());
    4
    bshInterpreter.eval((new StringBuffer("testEnded(")).append(host).append(")").toString());
    4
    bshInterpreter.evalNoLog("testEnded()");
    Differences
    Expression1Expression2Difference
    evalevalNoLogMETHOD_INVOCATION_NAME_MISMATCH
    (new StringBuffer("testEnded(")).append(host).append(")").toString()"testEnded()"TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression bshInterpreter.eval((new StringBuffer("testEnded(")).append(host).append(")").toString()) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression bshInterpreter.evalNoLog("testEnded()") is a method call throwing exception(s) that should be caught by a try block that will be extracted
    4
    bshInterpreter.evalNoLog("testEnded()");
    Precondition Violations (2)
    Row Violation
    1Expression bshInterpreter.eval((new StringBuffer("testEnded(")).append(host).append(")").toString()) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    2Expression bshInterpreter.evalNoLog("testEnded()") is a method call throwing exception(s) that should be caught by a try block that will be extracted