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()); }
try { if (SampleResult.TEXT.equals(res.getDataType())){ writer.setValue(new String(res.getResponseData(), res.getDataEncodingWithDefault())); } // Otherwise don't save anything - no point } catch (UnsupportedEncodingException e) { writer.setValue("Unsupported encoding in response data, can't record."); }
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/save/converters/SampleResultConverter.java
Method name: Map getArgumentsAsMap() Method name: void saveResponseData(HierarchicalStreamWriter, MarshallingContext, SampleResult, SampleSaveConfiguration)
Number of AST nodes: 3 Number of AST nodes: 3
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())) {
8
			    argMap.put(arg.getName(), arg.getValue()
1
try {
2
                if (SampleResult.TEXT.equals(res.getDataType())){
3
    				writer.setValue(new String(res.getResponseData(), res.getDataEncodingWithDefault()));
4
                }
5
                // Otherwise don't save anything - no point
6
			} catch (UnsupportedEncodingException e) {
9
);
7
				writer.setValue("Unsupported encoding in response data, can't record.");
10
			}
8
			}
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.1
Clones locationClones are in different classes
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)2.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    4
    Argument arg = (Argument)iter.next().getObjectValue();
    4
    Argument arg = (Argument)iter.next().getObjectValue();
    Preondition Violations
    Unmatched statement Argument arg=(Argument)iter.next().getObjectValue(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                  
    5
    if (!argMap.containsKey(arg.getName()))
    5
    if (!argMap.containsKey(arg.getName()))
    5
    if (SampleResult.TEXT.equals(res.getDataType()))
    Differences
    Expression1Expression2Difference
    !argMap.containsKey(arg.getName())SampleResult.TEXT.equals(res.getDataType())TYPE_COMPATIBLE_REPLACEMENT
    5
    if (SampleResult.TEXT.equals(res.getDataType()))
                                                                                                                                                                                  
    6
    writer.setValue(new String(res.getResponseData(), res.getDataEncodingWithDefault()));
    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
                                                                                            
    Precondition Violations (2)
    Row Violation
    1Unmatched statement Argument arg=(Argument)iter.next().getObjectValue(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched 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