method.getstatic(p(Visibility.class), "PROTECTED", ci(Visibility.class)); Label temp = new Label(); method.if_acmpeq(temp); while ((toConsume--) > 0) { method.pop(); } method.go_to((Label) gotoToken); method.label(temp);
method.getstatic(p(Visibility.class), "PRIVATE", ci(Visibility.class)); Label temp = new Label(); method.if_acmpne(temp); while ((toConsume--) > 0) { method.pop(); } method.go_to((Label) gotoToken); method.label(temp);
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/compiler/impl/BaseBodyCompiler.java File path: /jruby-1.4.0/src/org/jruby/compiler/impl/BaseBodyCompiler.java
Method name: void isNotProtected(Object, int) Method name: void isPrivate(Object, int)
Number of AST nodes: 7 Number of AST nodes: 7
1
method.getstatic(p(Visibility.class), "PROTECTED", ci(Visibility.class));
1
method.getstatic(p(Visibility.class), "PRIVATE", ci(Visibility.class));
2
        Label temp = new Label();
2
        Label temp = new Label();
3
        method.if_acmpeq(temp);
3
        method.if_acmpne(temp);
4
        while ((toConsume--) > 0) {
4
        while ((toConsume--) > 0) {
5
            method.pop();
5
            method.pop();
6
        }
6
        }
7
        method.go_to((Label) gotoToken);
7
        method.go_to((Label) gotoToken);
8
        method.label(temp);
8
        method.label(temp);
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.2
Clones locationClones are declared in the same class
Number of node comparisons21
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    method.getstatic(p(Visibility.class), "PROTECTED", ci(Visibility.class));
    1
    method.getstatic(p(Visibility.class), "PROTECTED", ci(Visibility.class));
    1
    method.getstatic(p(Visibility.class), "PRIVATE", ci(Visibility.class));
    Differences
    Expression1Expression2Difference
    "PROTECTED""PRIVATE"LITERAL_VALUE_MISMATCH
    1
    method.getstatic(p(Visibility.class), "PRIVATE", ci(Visibility.class));
    2
    Label temp = new Label();
    2
    Label temp = new Label();
    3
    method.if_acmpeq(temp);
    3
    method.if_acmpeq(temp);
    3
    method.if_acmpne(temp);
    Differences
    Expression1Expression2Difference
    if_acmpeqif_acmpneMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression method.if_acmpeq(temp) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression method.if_acmpne(temp) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression method.if_acmpeq(temp) is a void method call, and thus it cannot be parameterized
    Expression method.if_acmpne(temp) is a void method call, and thus it cannot be parameterized
    3
    method.if_acmpne(temp);
    4
    while ((toConsume--) > 0)
    4
    while ((toConsume--) > 0)
    5
    method.pop();
    5
    method.pop();
    6
    method.go_to((Label)gotoToken);
    6
    method.go_to((Label)gotoToken);
    7
    method.label(temp);
    7
    method.label(temp);
    Precondition Violations (4)
    Row Violation
    1Expression method.if_acmpeq(temp) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression method.if_acmpne(temp) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression method.if_acmpeq(temp) is a void method call, and thus it cannot be parameterized
    4Expression method.if_acmpne(temp) is a void method call, and thus it cannot be parameterized