Argument arg = (Argument) iter.next().getObjectValue(); // Because CollectionProperty.mergeIn will not prevent adding two // properties of the same name, we need to select the first value so // that this element's values prevail over defaults provided by // configuration // elements: if (!argMap.containsKey(arg.getName())) { argMap.put(arg.getName(), arg.getValue()); }
while (iter.hasNext()) { HTTPFileArg file = (HTTPFileArg) iter.next().getObjectValue(); str.append(file.getPath()); if (iter.hasNext()) { str.append("&"); //$NON-NLS-1$ } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/config/Arguments.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/util/HTTPFileArgs.java
Method name: Map getArgumentsAsMap() Method name: String toString()
Number of AST nodes: 3 Number of AST nodes: 5
1
Argument arg = (Argument) iter.next().getObjectValue();
2
			// Because CollectionProperty.mergeIn will not prevent adding two
3
			// properties of the same name, we need to select the first value so
4
			// that this element's values prevail over defaults provided by
5
			// configuration
6
			// elements:
7
			if (!argMap.containsKey(arg.getName()
1
while (iter.hasNext()) {
2
			HTTPFileArg file = (HTTPFileArg) iter.next().getObjectValue();
3
			str.append(file.getPath());
8
)) {
4
			if (iter.hasNext()) {
9
			    argMap.put(arg.getName(), arg.getValue());
5
				str.append("&"); //$NON-NLS-1$
10
			}
6
			}
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.2
Clones locationClones are in different classes having the same super class
Number of node comparisons7
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)8.1
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    4
    Argument arg = (Argument)iter.next().getObjectValue();
    4
    Argument arg = (Argument)iter.next().getObjectValue();
    4
    HTTPFileArg file = (HTTPFileArg)iter.next().getObjectValue();
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.config.Argumentorg.apache.jmeter.protocol.http.util.HTTPFileArgSUBCLASS_TYPE_MISMATCH
    argfileVARIABLE_NAME_MISMATCH
    org.apache.jmeter.config.Argumentorg.apache.jmeter.protocol.http.util.HTTPFileArgSUBCLASS_TYPE_MISMATCH
    org.apache.jmeter.config.Argumentorg.apache.jmeter.protocol.http.util.HTTPFileArgSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression (HTTPFileArg)iter.next().getObjectValue() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    HTTPFileArg file = (HTTPFileArg)iter.next().getObjectValue();
                                                                
    5
    str.append(file.getPath());
    Preondition Violations
    Unmatched statement str.append(file.getPath()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    str.append(file.getPath());
    5
    if (!argMap.containsKey(arg.getName()))
    5
    if (!argMap.containsKey(arg.getName()))
    6
    if (iter.hasNext())
    Differences
    Expression1Expression2Difference
    !argMap.containsKey(arg.getName())iter.hasNext()TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression !argMap.containsKey(arg.getName()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression iter.hasNext() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    if (iter.hasNext())
    6
    argMap.put(arg.getName(), arg.getValue());
    6
    argMap.put(arg.getName(), arg.getValue());
    Preondition Violations
    Unmatched statement argMap.put(arg.getName(),arg.getValue()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                            
                                          
    7
    str.append("&");
    Precondition Violations (6)
    Row Violation
    1Expression (HTTPFileArg)iter.next().getObjectValue() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Unmatched statement str.append(file.getPath()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Expression !argMap.containsKey(arg.getName()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression iter.hasNext() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Unmatched statement argMap.put(arg.getName(),arg.getValue()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Clone fragment #1 returns variable arg with type org.apache.jmeter.config.Argument , while Clone fragment #2 returns variable file with type org.apache.jmeter.protocol.http.util.HTTPFileArg