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);
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);
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 getMax() Method name: float getMin()
Number of AST nodes: 8 Number of AST nodes: 8
1
float maxValue = 0;
1
float minValue = 9999999;
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
				maxValue = Math.max(f, maxValue);
7
				minValue = Math.min(f, minValue);
8
			}
8
			}
9
		}
9
		}
10
		return (float) (maxValue + maxValue * 0.1);
10
		return (float) (minValue - minValue * 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.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    float maxValue = 0;
    1
    float maxValue = 0;
    1
    float minValue = 9999999;
    Differences
    Expression1Expression2Difference
    maxValueminValueVARIABLE_NAME_MISMATCH
    09999999LITERAL_VALUE_MISMATCH
    1
    float minValue = 9999999;
    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
    maxValue = Math.max(f, maxValue);
    7
    maxValue = Math.max(f, maxValue);
    7
    minValue = Math.min(f, minValue);
    Differences
    Expression1Expression2Difference
    maxValueminValueVARIABLE_NAME_MISMATCH
    maxminMETHOD_INVOCATION_NAME_MISMATCH
    maxValueminValueVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression Math.max(f,maxValue) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression Math.min(f,minValue) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7
    minValue = Math.min(f, minValue);
                                                                                              
    8
    return (float)(minValue - minValue * 0.1);
    8
    return (float)(maxValue + maxValue * 0.1);
                                                                                              
    Precondition Violations (2)
    Row Violation
    1Expression Math.max(f,maxValue) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression Math.min(f,minValue) cannot be parameterized, because it has dependencies to/from statements that will be extracted