Ruby runtime = recv.getRuntime(); try { runtime.getPosix().endpwent(); } catch (Exception e) { if (runtime.getDebug().isTrue()) { runtime.getWarnings().warn(ID.NOT_IMPLEMENTED, "Etc.endpwent is not supported by JRuby on this platform", e); } } return runtime.getNil();
Ruby runtime = recv.getRuntime(); try { runtime.getPosix().setpwent(); } catch (Exception e) { if (runtime.getDebug().isTrue()) { runtime.getWarnings().warn(ID.NOT_IMPLEMENTED, "Etc.setpwent is not supported by JRuby on this platform", e); } } return runtime.getNil();
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 endpwent(IRubyObject) Method name: IRubyObject setpwent(IRubyObject)
Number of AST nodes: 4 Number of AST nodes: 4
1
Ruby runtime = recv.getRuntime();
1
Ruby runtime = recv.getRuntime();
2
        try {
2
        try {
3
            runtime.getPosix().endpwent();
3
            runtime.getPosix().setpwent();
4
        } catch (Exception e) {
4
        } catch (Exception e) {
5
            if (runtime.getDebug().isTrue()) {
5
            if (runtime.getDebug().isTrue()) {
6
                runtime.getWarnings().warn(ID.NOT_IMPLEMENTED, "Etc.endpwent is not supported by JRuby on this platform", e);
6
                runtime.getWarnings().warn(ID.NOT_IMPLEMENTED, "Etc.setpwent is not supported by JRuby on this platform", e);
7
            }
7
            }
8
        }
8
        }
9
        return runtime.getNil();
9
        return runtime.getNil();
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.5
Clones locationClones are declared in the same class
Number of node comparisons8
  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.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Ruby runtime = recv.getRuntime();
    1
    Ruby runtime = recv.getRuntime();
    2
    try
    2
    try
    2
    try
    Differences
    Expression1Expression2Difference
    "Etc.endpwent is not supported by JRuby on this platform""Etc.setpwent is not supported by JRuby on this platform"LITERAL_VALUE_MISMATCH
    2
    try
    3
    runtime.getPosix().endpwent();
    3
    runtime.getPosix().endpwent();
    3
    runtime.getPosix().setpwent();
    Differences
    Expression1Expression2Difference
    endpwentsetpwentMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression runtime.getPosix().endpwent() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression runtime.getPosix().setpwent() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    runtime.getPosix().setpwent();
    4
    return runtime.getNil();
    4
    return runtime.getNil();
    Precondition Violations (2)
    Row Violation
    1Expression runtime.getPosix().endpwent() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression runtime.getPosix().setpwent() cannot be parameterized, because it has dependencies to/from statements that will be extracted