compile(orNode.getFirstNode(), context,true); context.duplicateCurrentValue(); context.performBooleanBranch(new BranchCallback() { public void branch(BodyCompiler context) { //Do nothing } }, new BranchCallback() { public void branch(BodyCompiler context) { context.consumeCurrentValue(); compile(orNode.getSecondNode(), context,true); } });
compile(orNode.getFirstNode(), context,true); context.duplicateCurrentValue(); context.performBooleanBranch(new BranchCallback() { public void branch(BodyCompiler context) { //Do nothing } }, new BranchCallback() { public void branch(BodyCompiler context) { context.consumeCurrentValue(); compile(orNode.getSecondNode(), context,true); } });
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/compiler/ASTCompiler.java File path: /jruby-1.4.0/src/org/jruby/compiler/ASTCompiler.java
Method name: void compileOpAsgnOr(Node, BodyCompiler, boolean) Method name: void branch(BodyCompiler)
Number of AST nodes: 3 Number of AST nodes: 3
1
compile(orNode.getFirstNode(), context,true);
1
compile(orNode.getFirstNode(), context,true);
2
            context.duplicateCurrentValue();
2
                            context.duplicateCurrentValue();
3
            context.performBooleanBranch(new BranchCallback() {
3
                            context.performBooleanBranch(new BranchCallback() {
4
                public void branch(BodyCompiler context) {
4
                                        public void branch(BodyCompiler context) {
5
                //Do nothing
5
                                        //Do nothing
6
                }
6
                
7
            },
7
                        }
8
                                    },
8
            new BranchCallback() {
9
                                    new BranchCallback() {
9
                public void branch(BodyCompiler context) {
10
                                        public void branch(BodyCompiler context) {
10
                    context.consumeCurrentValue();
11
                                            context.consumeCurrentValue();
11
                    compile(orNode.getSecondNode(), context,true);
12
                                            compile(orNode.getSecondNode(), context,true);
12
                }
13
                              
14
          }
13
            });
15
                                    });
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are in the same java file
Number of node comparisons9
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements3
    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.0
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    5
    compile(orNode.getFirstNode(), context, true);
    1
    compile(orNode.getFirstNode(), context, true);
    6
    context.duplicateCurrentValue();
    2
    context.duplicateCurrentValue();
    7
    context.performBooleanBranch(new BranchCallback() {...}, new BranchCallback() {...});
    3
    context.performBooleanBranch(new BranchCallback() {...}, new BranchCallback() {...});
    Precondition Violations (0)
    Row Violation