Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
30 | 2 | 4 | 0.979 | statement_sequence[9] |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 30 | 101 | plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AND_AND_Expression.java |
2 | 30 | 104 | plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/OR_OR_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); } |
| ||||
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); } |
| |||
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 Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#b6886280]] | trueLabel |
1 | 2 | [[#b6886280]] | falseLabel |
2 | 1 | [[#b6886ce0]] | leftIsTrue |
2 | 2 | [[#b6886ce0]] | !leftIsTrue |
3 | 1 | [[#a37e94a0]] | trueLabel |
3 | 2 | [[#a37e94a0]] | null |
4 | 1 | [[#a37e9440]] | null |
4 | 2 | [[#a37e9440]] | falseLabel |