CloneSet479


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
30240.979statement_sequence[9]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
130101
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AND_AND_Expression.java
230104
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/OR_OR_Expression.java
Clone Instance
1
Line Count
30
Source Line
101
Source File
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AND_AND_Expression.java

                BranchLabel falseLabel = new BranchLabel(codeStream), endLabel;
                cst = left.optimizedBooleanConstant();
                boolean leftIsConst = cst != Constant.NotAConstant;
                boolean leftIsTrue = leftIsConst && cst.booleanValue() == true;

                cst = right.optimizedBooleanConstant();
                boolean rightIsConst = cst != Constant.NotAConstant;
                boolean rightIsTrue = rightIsConst && cst.booleanValue() == true;

                generateOperands:  {
                        if (leftIsConst) {
                                left.generateCode(currentScope, codeStream, false);
                                if ( !leftIsTrue) {
                                        break generateOperands; // no need to generate right operand
                                }
                        }
                        else   {
                                left.generateOptimizedBoolean(currentScope, codeStream, null, falseLabel, true);
                                // need value, e.g. if (a == 1 && ((b = 2) > 0)) {} -> shouldn't initialize 'b' if a!=1 
                        }
                        if (rightInitStateIndex != -1) {
                                codeStream.addDefinitelyAssignedVariables(currentScope, rightInitStateIndex);
                        }
                        if (rightIsConst) {
                                right.generateCode(currentScope, codeStream, false);
                        }
                        else   {
                                right.generateOptimizedBoolean(currentScope, codeStream, null, falseLabel, valueRequired);
                        }
                }
                if (mergedInitStateIndex != -1) {
                        codeStream.removeNotDefinitelyAssignedVariables(currentScope, mergedInitStateIndex);
                }


Clone Instance
2
Line Count
30
Source Line
104
Source File
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/OR_OR_Expression.java

                BranchLabel trueLabel = new BranchLabel(codeStream), endLabel;
                cst = left.optimizedBooleanConstant();
                boolean leftIsConst = cst != Constant.NotAConstant;
                boolean leftIsTrue = leftIsConst && cst.booleanValue() == true;

                cst = right.optimizedBooleanConstant();
                boolean rightIsConst = cst != Constant.NotAConstant;
                boolean rightIsTrue = rightIsConst && cst.booleanValue() == true;

                generateOperands:  {
                        if (leftIsConst) {
                                left.generateCode(currentScope, codeStream, false);
                                if (leftIsTrue) {
                                        break generateOperands; // no need to generate right operand
                                }
                        }
                        else   {
                                left.generateOptimizedBoolean(currentScope, codeStream, trueLabel, null, true);
                                // need value, e.g. if (a == 1 || ((b = 2) > 0)) {} -> shouldn't initialize 'b' if a==1 
                        }
                        if (rightInitStateIndex != -1) {
                                codeStream.addDefinitelyAssignedVariables(currentScope, rightInitStateIndex);
                        }
                        if (rightIsConst) {
                                right.generateCode(currentScope, codeStream, false);
                        }
                        else   {
                                right.generateOptimizedBoolean(currentScope, codeStream, trueLabel, null, valueRequired);
                        }
                }
                if (mergedInitStateIndex != -1) {
                        codeStream.removeNotDefinitelyAssignedVariables(currentScope, mergedInitStateIndex);
                }


Clone AbstractionParameter Count: 4Parameter Bindings

BranchLabel  [[#variableb6886280]]= new BranchLabel(codeStream), endLabel;
cst = left.optimizedBooleanConstant();
boolean leftIsConst = cst != Constant.NotAConstant;
boolean leftIsTrue = leftIsConst && cst.booleanValue() == true;
cst = right.optimizedBooleanConstant();
boolean rightIsConst = cst != Constant.NotAConstant;
boolean rightIsTrue = rightIsConst && cst.booleanValue() == true;
generateOperands: {
  if (leftIsConst) {
    left.generateCode(currentScope, codeStream, false);
    if ( [[#variableb6886ce0]]) {
      break generateOperands; // no need to generate right operand
    }
  }
  else {
    left.generateOptimizedBoolean(currentScope, codeStream,  [[#variablea37e94a0]],  [[#variablea37e9440]], true);
  // need value, e.g. if (a == 1 || ((b = 2) > 0)) {} -> shouldn't initialize 'b' if a==1 
  // need value, e.g. if (a == 1 && ((b = 2) > 0)) {} -> shouldn't initialize 'b' if a!=1 
  }
  if (rightInitStateIndex != -1) {
    codeStream.addDefinitelyAssignedVariables(currentScope, rightInitStateIndex);
  }
  if (rightIsConst) {
    right.generateCode(currentScope, codeStream, false);
  }
  else {
    right.generateOptimizedBoolean(currentScope, codeStream,  [[#variablea37e94a0]],  [[#variablea37e9440]], valueRequired);
  }
}
if (mergedInitStateIndex != -1) {
  codeStream.removeNotDefinitelyAssignedVariables(currentScope, mergedInitStateIndex);
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#b6886280]]
trueLabel 
12[[#b6886280]]
falseLabel 
21[[#b6886ce0]]
leftIsTrue 
22[[#b6886ce0]]
!leftIsTrue 
31[[#a37e94a0]]
trueLabel 
32[[#a37e94a0]]
null 
41[[#a37e9440]]
null 
42[[#a37e9440]]
falseLabel