| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 29 | 2 | 3 | 0.995 | statement_sequence[10] |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 29 | 31 | plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AND_AND_Expression.java |
| 2 | 28 | 34 | plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/OR_OR_Expression.java |
| ||||
Constant cst = this.left.optimizedBooleanConstant();
boolean isLeftOptimizedTrue = cst != Constant.NotAConstant && cst.booleanValue() == true;
boolean isLeftOptimizedFalse = cst != Constant.NotAConstant && cst.booleanValue() == false;
if (isLeftOptimizedTrue) {
// TRUE && anything
// need to be careful of scenario:
// (x && y) && !z, if passing the left info to the right, it would
// be swapped by the !
FlowInfo mergedInfo = left.analyseCode(currentScope, flowContext, flowInfo)
.unconditionalInits();
mergedInfo = right.analyseCode(currentScope, flowContext, mergedInfo);
mergedInitStateIndex = currentScope.methodScope()
.recordInitializationStates(mergedInfo);
return mergedInfo;
}
FlowInfo leftInfo = left.analyseCode(currentScope, flowContext, flowInfo);
// need to be careful of scenario:
// (x && y) && !z, if passing the left info to the right, it would be
// swapped by the !
FlowInfo rightInfo = leftInfo.initsWhenTrue().unconditionalCopy();
rightInitStateIndex = currentScope.methodScope().recordInitializationStates(rightInfo);
int previousMode = rightInfo.reachMode();
if (isLeftOptimizedFalse) {
rightInfo.setReachMode(FlowInfo.UNREACHABLE);
}
rightInfo = right.analyseCode(currentScope, flowContext, rightInfo);
|
| ||||
Constant cst = this.left.optimizedBooleanConstant();
boolean isLeftOptimizedTrue = cst != Constant.NotAConstant && cst.booleanValue() == true;
boolean isLeftOptimizedFalse = cst != Constant.NotAConstant && cst.booleanValue() == false;
if (isLeftOptimizedFalse) {
// FALSE || anything
// need to be careful of scenario:
// (x || y) || !z, if passing the left info to the right, it would be swapped by the !
FlowInfo mergedInfo = left.analyseCode(currentScope, flowContext, flowInfo).unconditionalInits();
mergedInfo = right.analyseCode(currentScope, flowContext, mergedInfo);
mergedInitStateIndex =
currentScope.methodScope().recordInitializationStates(mergedInfo);
return mergedInfo;
}
FlowInfo leftInfo = left.analyseCode(currentScope, flowContext, flowInfo);
// need to be careful of scenario:
// (x || y) || !z, if passing the left info to the right, it would be swapped by the !
FlowInfo rightInfo = leftInfo.initsWhenFalse().unconditionalCopy();
rightInitStateIndex =
currentScope.methodScope().recordInitializationStates(rightInfo);
int previousMode = rightInfo.reachMode();
if (isLeftOptimizedTrue) {
rightInfo.setReachMode(FlowInfo.UNREACHABLE);
}
rightInfo = right.analyseCode(currentScope, flowContext, rightInfo);
|
| |||
Constant cst = this.left.optimizedBooleanConstant();
boolean isLeftOptimizedTrue = cst != Constant.NotAConstant && cst.booleanValue() == true;
boolean isLeftOptimizedFalse = cst != Constant.NotAConstant && cst.booleanValue() == false;
if ( [[#variableb9b3c7c0]]) {
// TRUE && anything
// FALSE || anything
// need to be careful of scenario:
// (x && y) && !z, if passing the left info to the right, it would
// be swapped by the !
// (x || y) || !z, if passing the left info to the right, it would be swapped by the !
FlowInfo mergedInfo = left.analyseCode(currentScope, flowContext, flowInfo).unconditionalInits();
mergedInfo = right.analyseCode(currentScope, flowContext, mergedInfo);
mergedInitStateIndex = currentScope.methodScope().recordInitializationStates(mergedInfo);
return mergedInfo;
}
FlowInfo leftInfo = left.analyseCode(currentScope, flowContext, flowInfo);
// need to be careful of scenario:
// (x && y) && !z, if passing the left info to the right, it would be
// swapped by the !
// (x || y) || !z, if passing the left info to the right, it would be swapped by the !
FlowInfo rightInfo = leftInfo. [[#variableb6886d00]]().unconditionalCopy();
rightInitStateIndex = currentScope.methodScope().recordInitializationStates(rightInfo);
int previousMode = rightInfo.reachMode();
if ( [[#variableb9b3c840]]) {
rightInfo.setReachMode(FlowInfo.UNREACHABLE);
}
rightInfo = right.analyseCode(currentScope, flowContext, rightInfo);
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#b9b3c7c0]] | isLeftOptimizedTrue |
| 1 | 2 | [[#b9b3c7c0]] | isLeftOptimizedFalse |
| 2 | 1 | [[#b6886d00]] | initsWhenTrue |
| 2 | 2 | [[#b6886d00]] | initsWhenFalse |
| 3 | 1 | [[#b9b3c840]] | isLeftOptimizedFalse |
| 3 | 2 | [[#b9b3c840]] | isLeftOptimizedTrue |