float minValue = 9999999; for (int t = 0; t < keys.size(); t++) { String key = (String) keys.elementAt(t); Vector temp = (Vector) data.get(key); for (int j = 0; j < temp.size(); j++) { float f = ((Integer) temp.elementAt(j)).intValue(); minValue = Math.min(f, minValue); } } return (float) (minValue - minValue * 0.1);
float maxValue = 0; for (int t = 0; t < keys.size(); t++) { String key = (String) keys.elementAt(t); Vector temp = (Vector) data.get(key); for (int j = 0; j < temp.size(); j++) { float f = ((Integer) temp.elementAt(j)).intValue(); maxValue = Math.max(f, maxValue); } } return (float) (maxValue + maxValue * 0.1);
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/reporters/FileReporter.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/reporters/FileReporter.java
Method name: float getMin() Method name: float getMax()
Number of AST nodes: 8 Number of AST nodes: 8
1
float minValue = 9999999;
1
float maxValue = 0;
2
		for (int t = 0; t < keys.size(); t++) {
2
		for (int t = 0; t < keys.size(); t++) {
3
			String key = (String) keys.elementAt(t);
3
			String key = (String) keys.elementAt(t);
4
			Vector temp = (Vector) data.get(key);
4
			Vector temp = (Vector) data.get(key);
5
			for (int j = 0; j < temp.size(); j++) {
5
			for (int j = 0; j < temp.size(); j++) {
6
				float f = ((Integer) temp.elementAt(j)).intValue();
6
				float f = ((Integer) temp.elementAt(j)).intValue();
7
				minValue = Math.min(f, minValue);
7
				maxValue = Math.max(f, maxValue);
8
			}
8
			}
9
		}
9
		}
10
		return (float) (minValue - minValue * 0.1);
10
		return (float) (maxValue + maxValue * 0.1);
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 declared in the same class
Number of node comparisons24
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)2.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    float minValue = 9999999;
    1
    float minValue = 9999999;
    1
    float maxValue = 0;
    Differences
    Expression1Expression2Difference
    minValuemaxValueVARIABLE_NAME_MISMATCH
    99999990LITERAL_VALUE_MISMATCH
    1
    float maxValue = 0;
    2
    for (int t = 0; t < keys.size(); t++)
    2
    for (int t = 0; t < keys.size(); t++)
    3
    String key = (String)keys.elementAt(t);
    3
    String key = (String)keys.elementAt(t);
    4
    Vector temp = (Vector)data.get(key);
    4
    Vector temp = (Vector)data.get(key);
    5
    for (int j = 0; j < temp.size(); j++)
    5
    for (int j = 0; j < temp.size(); j++)
    6
    float f = ((Integer)temp.elementAt(j)).intValue();
    6
    float f = ((Integer)temp.elementAt(j)).intValue();
    7
    minValue = Math.min(f, minValue);
    7
    minValue = Math.min(f, minValue);
    7
    maxValue = Math.max(f, maxValue);
    Differences
    Expression1Expression2Difference
    minValuemaxValueVARIABLE_NAME_MISMATCH
    minmaxMETHOD_INVOCATION_NAME_MISMATCH
    minValuemaxValueVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression Math.min(f,minValue) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression Math.max(f,maxValue) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7
    maxValue = Math.max(f, maxValue);
                                                                                              
    8
    return (float)(maxValue + maxValue * 0.1);
    8
    return (float)(minValue - minValue * 0.1);
                                                                                              
    Precondition Violations (2)
    Row Violation
    1Expression Math.min(f,minValue) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression Math.max(f,maxValue) cannot be parameterized, because it has dependencies to/from statements that will be extracted