if (inErrorThreshold < 0L) { throw new IllegalArgumentException(JMeterUtils.getResString("argument_must_not_be_negative")); //$NON-NLS-1$ } if (inErrorThreshold == Long.MAX_VALUE) { setProperty(new LongProperty(ERROR_THRESHOLD_KEY, 0)); } else { setProperty(new LongProperty(ERROR_THRESHOLD_KEY, inErrorThreshold)); }
if (inWarningThreshold < 0L) { throw new IllegalArgumentException(JMeterUtils.getResString("argument_must_not_be_negative")); //$NON-NLS-1$ } if (inWarningThreshold == Long.MAX_VALUE) { setProperty(new LongProperty(WARNING_THRESHOLD_KEY, 0)); } else { setProperty(new LongProperty(WARNING_THRESHOLD_KEY, inWarningThreshold)); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/assertions/HTMLAssertion.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/assertions/HTMLAssertion.java
Method name: void setErrorThreshold(long) Method name: void setWarningThreshold(long)
Number of AST nodes: 5 Number of AST nodes: 5
1
if (inErrorThreshold < 0L) {
1
if (inWarningThreshold < 0L) {
2
			throw new IllegalArgumentException(JMeterUtils.getResString("argument_must_not_be_negative")); //$NON-NLS-1$
2
			throw new IllegalArgumentException(JMeterUtils.getResString("argument_must_not_be_negative")); //$NON-NLS-1$
3
		}
3
		}
4
		if (inErrorThreshold == Long.MAX_VALUE) {
4
		if (inWarningThreshold == Long.MAX_VALUE) {
5
			setProperty(new LongProperty(ERROR_THRESHOLD_KEY, 0));
5
			setProperty(new LongProperty(WARNING_THRESHOLD_KEY, 0));
6
		} else {
6
		} else {
7
			setProperty(new LongProperty(ERROR_THRESHOLD_KEY, inErrorThreshold));
7
			setProperty(new LongProperty(WARNING_THRESHOLD_KEY, inWarningThreshold));
8
		}
8
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.4
Clones locationClones are declared in the same class
Number of node comparisons20
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (inErrorThreshold < 0L)
    1
    if (inErrorThreshold < 0L)
    1
    if (inWarningThreshold < 0L)
    Differences
    Expression1Expression2Difference
    inErrorThresholdinWarningThresholdVARIABLE_NAME_MISMATCH
    1
    if (inWarningThreshold < 0L)
    2
    throw new IllegalArgumentException(JMeterUtils.getResString("argument_must_not_be_negative"));
    2
    throw new IllegalArgumentException(JMeterUtils.getResString("argument_must_not_be_negative"));
    3
    if (inErrorThreshold == Long.MAX_VALUE)
    3
    if (inErrorThreshold == Long.MAX_VALUE)
    3
    if (inWarningThreshold == Long.MAX_VALUE)
    Differences
    Expression1Expression2Difference
    inErrorThresholdinWarningThresholdVARIABLE_NAME_MISMATCH
    3
    if (inWarningThreshold == Long.MAX_VALUE)
    4
    setProperty(new LongProperty(ERROR_THRESHOLD_KEY, 0));
    4
    setProperty(new LongProperty(ERROR_THRESHOLD_KEY, 0));
    4
    setProperty(new LongProperty(WARNING_THRESHOLD_KEY, 0));
    Differences
    Expression1Expression2Difference
    ERROR_THRESHOLD_KEYWARNING_THRESHOLD_KEYVARIABLE_NAME_MISMATCH
    4
    setProperty(new LongProperty(WARNING_THRESHOLD_KEY, 0));
    else
    else
    5
    setProperty(new LongProperty(ERROR_THRESHOLD_KEY, inErrorThreshold));
    5
    setProperty(new LongProperty(ERROR_THRESHOLD_KEY, inErrorThreshold));
    5
    setProperty(new LongProperty(WARNING_THRESHOLD_KEY, inWarningThreshold));
    Differences
    Expression1Expression2Difference
    ERROR_THRESHOLD_KEYWARNING_THRESHOLD_KEYVARIABLE_NAME_MISMATCH
    inErrorThresholdinWarningThresholdVARIABLE_NAME_MISMATCH
    5
    setProperty(new LongProperty(WARNING_THRESHOLD_KEY, inWarningThreshold));
    Precondition Violations (0)
    Row Violation