if (subResults != null) { for (int i = 0; i < subResults.length; i++) { config.addChild(getConfiguration(subResults[i], saveConfig)); } }
if (saveConfig.saveAssertions() && assResults != null) { for (int i = 0; i < assResults.length; i++) { config.addChild(getConfiguration(assResults[i])); } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/save/OldSaveService.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/save/OldSaveService.java
Method name: Configuration getConfiguration(SampleResult, SampleSaveConfiguration) Method name: Configuration getConfiguration(SampleResult, SampleSaveConfiguration)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (subResults != null) {
1
if (saveConfig.saveAssertions() && assResults != null) {
2
			for (int i = 0; i < subResults.length; i++) {
2
			for (int i = 0; i < assResults.length; i++) {
3
				config.addChild(getConfiguration(subResults[i], saveConfig));
3
				config.addChild(getConfiguration(assResults[i]));
4
			}
4
			}
5
		}
5
		}
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 the same method
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    23
    for (int i = 0; i < subResults.length; i++)
    23
    for (int i = 0; i < subResults.length; i++)
    29
    for (int i = 0; i < assResults.length; i++)
    Differences
    Expression1Expression2Difference
    subResultsassResultsVARIABLE_NAME_MISMATCH
    org.apache.jmeter.samplers.SampleResult[]org.apache.jmeter.assertions.AssertionResult[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable subResults.length does not match with type int of variable assResults.length
    • Make classes org.apache.jmeter.samplers.SampleResult[] and org.apache.jmeter.assertions.AssertionResult[] extend a common superclass
    29
    for (int i = 0; i < assResults.length; i++)
    24
    config.addChild(getConfiguration(subResults[i], saveConfig));
    24
    config.addChild(getConfiguration(subResults[i], saveConfig));
    30
    config.addChild(getConfiguration(assResults[i]));
    Differences
    Expression1Expression2Difference
    getConfiguration(subResults[i],saveConfig)getConfiguration(assResults[i])ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression getConfiguration(subResults[i],saveConfig) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression getConfiguration(assResults[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method getConfiguration
    30
    config.addChild(getConfiguration(assResults[i]));
    Precondition Violations (3)
    Row Violation
    1Type int of variable subResults.length does not match with type int of variable assResults.length
    2Expression getConfiguration(subResults[i],saveConfig) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression getConfiguration(assResults[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted