try { if (o == null) { return defaultValue; } if (o instanceof Number) { return ((Number) o).doubleValue(); } return Double.parseDouble(o.toString()); } catch (NumberFormatException e) { return defaultValue; }
try { if (o == null) { return defaultValue; } if (o instanceof Number) { return ((Number) o).longValue(); } return Long.parseLong(o.toString()); } catch (NumberFormatException e) { return defaultValue; }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/util/Converter.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/util/Converter.java
Method name: double getDouble(Object, double) Method name: long getLong(Object, long)
Number of AST nodes: 6 Number of AST nodes: 6
1
try {
1
try {
2
			if (o == null) {
2
			if (o == null) {
3
				return defaultValue;
3
				return defaultValue;
4
			}
4
			}
5
			if (o instanceof Number) {
5
			if (o instanceof Number) {
6
				return ((Number) o).doubleValue();
6
				return ((Number) o).longValue();
7
			}
7
			}
8
			return Double.parseDouble(o.toString());
8
			return Long.parseLong(o.toString());
9
		} catch (NumberFormatException e) {
9
		} catch (NumberFormatException e) {
10
			return defaultValue;
10
			return defaultValue;
11
		}
11
		}
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.3
Clones locationClones are declared in the same class
Number of node comparisons14
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    if (o == null)
    2
    if (o == null)
                                                  
    3
    return defaultValue;
    Preondition Violations
    Unmatched return defaultValue;
    3
    return defaultValue;
    3
    return defaultValue;
    3
    return defaultValue;
    Preondition Violations
    Unmatched return defaultValue;
                                                  
    4
    if (o instanceof Number)
    4
    if (o instanceof Number)
                                                                        
    5
    return ((Number)o).longValue();
    Preondition Violations
    Unmatched statement return ((Number)o).longValue(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return ((Number)o).longValue();
    5
    return ((Number)o).longValue();
    5
    return ((Number)o).doubleValue();
    5
    return ((Number)o).doubleValue();
    Preondition Violations
    Unmatched statement return ((Number)o).doubleValue(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return ((Number)o).doubleValue();
                                                                            
    Precondition Violations (6)
    Row Violation
    1Unmatched return defaultValue;
    2Unmatched return defaultValue;
    3Unmatched statement return ((Number)o).longValue(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched return ((Number)o).longValue();
    5Unmatched statement return ((Number)o).doubleValue(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Unmatched return ((Number)o).doubleValue();