if(gr == null) { if (Platform.IS_WINDOWS) { // MRI behavior return runtime.getNil(); } throw runtime.newArgumentError("can't find group for " + gid); }
if(grp == null) { if (Platform.IS_WINDOWS) { // MRI behavior return runtime.getNil(); } throw runtime.newArgumentError("can't find group for " + nam); }
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyEtc.java File path: /jruby-1.4.0/src/org/jruby/RubyEtc.java
Method name: IRubyObject getgrgid(IRubyObject, IRubyObject[]) Method name: IRubyObject getgrnam(IRubyObject, IRubyObject)
Number of AST nodes: 4 Number of AST nodes: 4
1
if(gr == null) {
1
if(grp == null) {
2
                if (Platform.IS_WINDOWS) {  // MRI behavior
2
                if (Platform.IS_WINDOWS) {  // MRI behavior
3
                    return runtime.getNil();
3
                    return runtime.getNil();
4
                }
4
                }
5
                throw runtime.newArgumentError("can't find group for " + gid);
5
                throw runtime.newArgumentError("can't find group for " + nam);
6
            }
6
            }
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.1
Clones locationClones are declared in the same class
Number of node comparisons9
  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.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    6
    if (gr == null)
    6
    if (gr == null)
    5
    if (grp == null)
    Differences
    Expression1Expression2Difference
    grgrpVARIABLE_NAME_MISMATCH
    5
    if (grp == null)
    7
    if (Platform.IS_WINDOWS)
    6
    if (Platform.IS_WINDOWS)
    8
    return runtime.getNil();
    7
    return runtime.getNil();
    9
    throw runtime.newArgumentError("can't find group for " + gid);
    9
    throw runtime.newArgumentError("can't find group for " + gid);
    8
    throw runtime.newArgumentError("can't find group for " + nam);
    Differences
    Expression1Expression2Difference
    gidnamVARIABLE_NAME_MISMATCH
    intjava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable gid does not match with type java.lang.String of variable nam
    8
    throw runtime.newArgumentError("can't find group for " + nam);
    Precondition Violations (1)
    Row Violation
    1Type int of variable gid does not match with type java.lang.String of variable nam