if (values.length >= PARAM_START) { start = ((CompoundVariable) values[PARAM_START - 1]).execute(); try { myStart = Integer.valueOf(start).intValue(); } catch (NumberFormatException e) { myStart = COUNT_UNUSED;// Don't process invalid numbers } }
if (values.length >= PARAM_END) { String tmp = ((CompoundVariable) values[PARAM_END - 1]).execute(); try { myEnd = Integer.valueOf(tmp).intValue(); } catch (NumberFormatException e) { myEnd = COUNT_UNUSED;// Don't process invalid numbers // (including "") } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/functions/StringFromFile.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/functions/StringFromFile.java
Method name: void openFile() Method name: void openFile()
Number of AST nodes: 4 Number of AST nodes: 4
1
if (values.length >= PARAM_START) {
1
if (values.length >= PARAM_END) {
2
			start = ((CompoundVariable) values[PARAM_START - 1]).execute();
2
			String tmp = ((CompoundVariable) values[PARAM_END - 1]).execute();
3
			try {
3
			try {
4
				myStart = Integer.valueOf(start).intValue();
4
				myEnd = Integer.valueOf(tmp).intValue();
5
			} catch (NumberFormatException e) {
5
			} catch (NumberFormatException e) {
6
				myStart = COUNT_UNUSED;// Don't process invalid numbers
6
				myEnd = COUNT_UNUSED;// Don't process invalid numbers
7
			}
7
										// (including "")
8
			}
8
		}
9
		}
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 the same method
Number of node comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    if (values.length >= PARAM_START)
    4
    if (values.length >= PARAM_START)
    10
    if (values.length >= PARAM_END)
    Differences
    Expression1Expression2Difference
    PARAM_STARTPARAM_ENDVARIABLE_NAME_MISMATCH
    10
    if (values.length >= PARAM_END)
    5
    start = ((CompoundVariable)values[PARAM_START - 1]).execute();
    5
    start = ((CompoundVariable)values[PARAM_START - 1]).execute();
    Preondition Violations
    Unmatched statement start=((CompoundVariable)values[PARAM_START - 1]).execute(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                  
                                                                                                                                          
    11
    String tmp = ((CompoundVariable)values[PARAM_END - 1]).execute();
    Preondition Violations
    Unmatched statement String tmp=((CompoundVariable)values[PARAM_END - 1]).execute(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    11
    String tmp = ((CompoundVariable)values[PARAM_END - 1]).execute();
    6
    try
    6
    try
    12
    try
    Differences
    Expression1Expression2Difference
    myStartmyEndVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression myStart cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression myEnd cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression myStart is a field being modified, and thus it cannot be parameterized
    Expression myEnd is a field being modified, and thus it cannot be parameterized
    12
    try
    7
    myStart = Integer.valueOf(start).intValue();
    7
    myStart = Integer.valueOf(start).intValue();
    13
    myEnd = Integer.valueOf(tmp).intValue();
    Differences
    Expression1Expression2Difference
    myStartmyEndVARIABLE_NAME_MISMATCH
    starttmpVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression myStart is a field being modified, and thus it cannot be parameterized
    Expression myEnd is a field being modified, and thus it cannot be parameterized
    13
    myEnd = Integer.valueOf(tmp).intValue();
    Precondition Violations (8)
    Row Violation
    1Unmatched statement start=((CompoundVariable)values[PARAM_START - 1]).execute(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement String tmp=((CompoundVariable)values[PARAM_END - 1]).execute(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Expression myStart cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression myEnd cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression myStart is a field being modified, and thus it cannot be parameterized
    6Expression myEnd is a field being modified, and thus it cannot be parameterized
    7Expression myStart is a field being modified, and thus it cannot be parameterized
    8Expression myEnd is a field being modified, and thus it cannot be parameterized