for (int i=0,j=args.length;i<j;i++) { append(context, args[i]); }
if (args.length != 0) { for (int i = 0, j = args.length; i < j; i++) { write(args[i]); } }
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyStringIO.java File path: /jruby-1.4.0/src/org/jruby/RubyZlib.java
Method name: IRubyObject print(ThreadContext, IRubyObject[]) Method name: IRubyObject print(IRubyObject[])
Number of AST nodes: 2 Number of AST nodes: 3
1
if (args.length != 0) {
1
for (int i=0,j=args.length;i<j;i++) {
2
                for (int i = 0, j = args.length; i < j; i++) {
2
                append(context, args[i]);
3
                    write(args[i]);
4
                }
3
            }
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.3
Clones locationClones are in different classes having the same super 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.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    for (int i = 0, j = args.length; i < j; i++)
    2
    for (int i = 0, j = args.length; i < j; i++)
    4
    append(context, args[i]);
    4
    append(context, args[i]);
    3
    write(args[i]);
    Differences
    Expression1Expression2Difference
    appendwriteMETHOD_INVOCATION_NAME_MISMATCH
    append(context,args[i])write(args[i])ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression append(context,args[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression write(args[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression append(context,args[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression write(args[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    write(args[i]);
    Precondition Violations (4)
    Row Violation
    1Expression append(context,args[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression write(args[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression append(context,args[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression write(args[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted