double value = ((RubyFloat)RubyKernel.new_float(recv,x)).getDoubleValue(); double result = Math.acos(value); domainCheck(recv, result, "acos"); return RubyFloat.newFloat(recv.getRuntime(), result);
double value = ((RubyFloat)RubyKernel.new_float(recv,x)).getDoubleValue(); double result = Math.asin(value); domainCheck(recv, result, "asin"); return RubyFloat.newFloat(recv.getRuntime(),result);
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyMath.java File path: /jruby-1.4.0/src/org/jruby/RubyMath.java
Method name: RubyFloat acos(IRubyObject, IRubyObject) Method name: RubyFloat asin(IRubyObject, IRubyObject)
Number of AST nodes: 4 Number of AST nodes: 4
1
double value = ((RubyFloat)RubyKernel.new_float(recv,x)).getDoubleValue();
1
double value = ((RubyFloat)RubyKernel.new_float(recv,x)).getDoubleValue();
2
        double result = Math.acos(value);  
2
        double result = Math.asin(value);
3
        domainCheck(recv, result, "acos");
3
        domainCheck(recv, result, "asin");        
4
        return RubyFloat.newFloat(recv.getRuntime(), result);
4
        return RubyFloat.newFloat(recv.getRuntime(),result);
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.0
Clones locationClones are declared in the same class
Number of node comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    double value = ((RubyFloat)RubyKernel.new_float(recv, x)).getDoubleValue();
    1
    double value = ((RubyFloat)RubyKernel.new_float(recv, x)).getDoubleValue();
    2
    double result = Math.acos(value);
    2
    double result = Math.acos(value);
    2
    double result = Math.asin(value);
    Differences
    Expression1Expression2Difference
    acosasinMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression Math.acos(value) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression Math.asin(value) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    double result = Math.asin(value);
    3
    domainCheck(recv, result, "acos");
    3
    domainCheck(recv, result, "acos");
    3
    domainCheck(recv, result, "asin");
    Differences
    Expression1Expression2Difference
    "acos""asin"LITERAL_VALUE_MISMATCH
    3
    domainCheck(recv, result, "asin");
    4
    return RubyFloat.newFloat(recv.getRuntime(), result);
    4
    return RubyFloat.newFloat(recv.getRuntime(), result);
    Precondition Violations (2)
    Row Violation
    1Expression Math.acos(value) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression Math.asin(value) cannot be parameterized, because it has dependencies to/from statements that will be extracted