try { asSocket().shutdownInput(); } catch (IOException e) { throw runtime.newIOError(e.getMessage()); }
try { asSocket().shutdownOutput(); } catch (IOException e) { throw context.getRuntime().newIOError(e.getMessage()); }
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/ext/socket/RubyBasicSocket.java File path: /jruby-1.4.0/src/org/jruby/ext/socket/RubyBasicSocket.java
Method name: IRubyObject close_read(ThreadContext) Method name: IRubyObject close_write(ThreadContext)
Number of AST nodes: 2 Number of AST nodes: 2
1
try {
1
try {
2
                        asSocket().shutdownInput();
2
                    asSocket().shutdownOutput();
3
                    } catch (IOException e) {
3
                } catch (IOException e) {
4
                        throw runtime.newIOError(e.getMessage());
4
                    throw context.getRuntime().newIOError(e.getMessage());
5
                    }
5
                }
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.4
Clones locationClones are declared in the same class
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    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.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    9
    try
    9
    try
    9
    try
    Differences
    Expression1Expression2Difference
    runtimecontext.getRuntime()TYPE_COMPATIBLE_REPLACEMENT
    9
    try
    10
    asSocket().shutdownInput();
    10
    asSocket().shutdownInput();
    10
    asSocket().shutdownOutput();
    Differences
    Expression1Expression2Difference
    shutdownInputshutdownOutputMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression asSocket().shutdownInput() is a void method call, and thus it cannot be parameterized
    Expression asSocket().shutdownOutput() is a void method call, and thus it cannot be parameterized
    10
    asSocket().shutdownOutput();
    Precondition Violations (2)
    Row Violation
    1Expression asSocket().shutdownInput() is a void method call, and thus it cannot be parameterized
    2Expression asSocket().shutdownOutput() is a void method call, and thus it cannot be parameterized