RubyModule rubyClass = ASTInterpreter.getClassVariableBase(context, runtime); if (rubyClass == null) rubyClass = self.getMetaClass(); return rubyClass.fastGetClassVar(internedName);
RubyModule rubyClass = ASTInterpreter.getClassVariableBase(context, runtime); if (rubyClass == null) rubyClass = self.getMetaClass(); return rubyClass.getClassVar(name);
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/javasupport/util/RuntimeHelpers.java File path: /jruby-1.4.0/src/org/jruby/ast/ClassVarNode.java
Method name: IRubyObject fastFetchClassVariable(ThreadContext, Ruby, IRubyObject, String) Method name: IRubyObject interpret(Ruby, ThreadContext, IRubyObject, Block)
Number of AST nodes: 4 Number of AST nodes: 4
1
RubyModule rubyClass = ASTInterpreter.getClassVariableBase(context, runtime);
1
RubyModule rubyClass = ASTInterpreter.getClassVariableBase(context, runtime);
2
   
2
   
3
        if (rubyClass == null) rubyClass = self.getMetaClass();
3
        if (rubyClass == null) rubyClass = self.getMetaClass();
4
        return rubyClass.fastGetClassVar(internedName);
4
        return rubyClass.getClassVar(name);
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 in different classes
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)1.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    RubyModule rubyClass = ASTInterpreter.getClassVariableBase(context, runtime);
    1
    RubyModule rubyClass = ASTInterpreter.getClassVariableBase(context, runtime);
    2
    if (rubyClass == null)
    2
    if (rubyClass == null)
    3
    rubyClass = self.getMetaClass();
    3
    rubyClass = self.getMetaClass();
    4
    return rubyClass.fastGetClassVar(internedName);
    4
    return rubyClass.fastGetClassVar(internedName);
    4
    return rubyClass.getClassVar(name);
    Differences
    Expression1Expression2Difference
    fastGetClassVargetClassVarMETHOD_INVOCATION_NAME_MISMATCH
    internedNamenameVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression rubyClass.fastGetClassVar(internedName) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression rubyClass.getClassVar(name) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    return rubyClass.getClassVar(name);
    Precondition Violations (2)
    Row Violation
    1Expression rubyClass.fastGetClassVar(internedName) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression rubyClass.getClassVar(name) cannot be parameterized, because it has dependencies to/from statements that will be extracted