Ruby runtime = context.getRuntime(); if (runtime.isVerbose()) { runtime.getWarnings().warning(ID.DEPRECATED_METHOD, "StringScanner#matchedsize is obsolete; use #matched_size instead", "StringScanner#matchedize", "#matched_size"); } return matched_size();
Ruby runtime = context.getRuntime(); if (runtime.isVerbose()) { runtime.getWarnings().warning(ID.DEPRECATED_METHOD, "StringScanner#restsize is obsolete; use #rest_size instead", "StringScanner#restsize", "#rest_size"); } return rest_size();
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyStringScanner.java File path: /jruby-1.4.0/src/org/jruby/RubyStringScanner.java
Method name: IRubyObject matchedsize(ThreadContext) Method name: RubyFixnum restsize(ThreadContext)
Number of AST nodes: 4 Number of AST nodes: 4
1
Ruby runtime = context.getRuntime();
1
Ruby runtime = context.getRuntime();
2
        if (runtime.isVerbose()) {
2
        if (runtime.isVerbose()) {
3
            runtime.getWarnings().warning(ID.DEPRECATED_METHOD, "StringScanner#matchedsize is obsolete; use #matched_size instead", 
3
            runtime.getWarnings().warning(ID.DEPRECATED_METHOD, "StringScanner#restsize is obsolete; use #rest_size instead", 
4
                    "StringScanner#matchedize", "#matched_size");
4
"StringScanner#restsize", "#rest_size");
5
        }
5
        }
6
        return matched_size();
6
        return rest_size();
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 comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Ruby runtime = context.getRuntime();
    1
    Ruby runtime = context.getRuntime();
    2
    if (runtime.isVerbose())
    2
    if (runtime.isVerbose())
    3
    runtime.getWarnings().warning(ID.DEPRECATED_METHOD, "StringScanner#matchedsize is obsolete; use #matched_size instead", "StringScanner#matchedize", "#matched_size");
    3
    runtime.getWarnings().warning(ID.DEPRECATED_METHOD, "StringScanner#matchedsize is obsolete; use #matched_size instead", "StringScanner#matchedize", "#matched_size");
    3
    runtime.getWarnings().warning(ID.DEPRECATED_METHOD, "StringScanner#restsize is obsolete; use #rest_size instead", "StringScanner#restsize", "#rest_size");
    Differences
    Expression1Expression2Difference
    "StringScanner#matchedsize is obsolete; use #matched_size instead""StringScanner#restsize is obsolete; use #rest_size instead"LITERAL_VALUE_MISMATCH
    "StringScanner#matchedize""StringScanner#restsize"LITERAL_VALUE_MISMATCH
    "#matched_size""#rest_size"LITERAL_VALUE_MISMATCH
    3
    runtime.getWarnings().warning(ID.DEPRECATED_METHOD, "StringScanner#restsize is obsolete; use #rest_size instead", "StringScanner#restsize", "#rest_size");
                                                
    4
    return rest_size();
    Preondition Violations
    Unmatched return rest_size();
    4
    return rest_size();
    4
    return matched_size();
    4
    return matched_size();
    Preondition Violations
    Unmatched return matched_size();
                                                      
    Precondition Violations (2)
    Row Violation
    1Unmatched return rest_size();
    2Unmatched return matched_size();