| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 47 | 2 | 4 | 0.997 | switch_group |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 47 | 294 | plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/BinaryExpression.java |
| 2 | 47 | 341 | plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/BinaryExpression.java |
| ||||
case OR:
switch (this.bits& ASTNode.ReturnTypeIDMASK) {
case T_int:
// 0 | x
if ((this.left.constant != Constant.NotAConstant) &&
(this.left.constant.typeID() == TypeIds.T_int) &&
(this.left.constant.intValue() == 0)) {
this.right.generateCode(currentScope, codeStream, valueRequired);
}
else {
// x | 0
if ((this.right.constant != Constant.NotAConstant) &&
(this.right.constant.typeID() == TypeIds.T_int) &&
(this.right.constant.intValue() == 0)) {
this.left.generateCode(currentScope, codeStream, valueRequired);
}
else {
this.left.generateCode(currentScope, codeStream, valueRequired);
this.right.generateCode(currentScope, codeStream, valueRequired);
if (valueRequired)
codeStream.ior();
}
}
break;
case T_long:
// 0 | x
if ((this.left.constant != Constant.NotAConstant) &&
(this.left.constant.typeID() == TypeIds.T_long) &&
(this.left.constant.longValue() == 0L)) {
this.right.generateCode(currentScope, codeStream, valueRequired);
}
else {
// x | 0
if ((this.right.constant != Constant.NotAConstant) &&
(this.right.constant.typeID() == TypeIds.T_long) &&
(this.right.constant.longValue() == 0L)) {
this.left.generateCode(currentScope, codeStream, valueRequired);
}
else {
this.left.generateCode(currentScope, codeStream, valueRequired);
this.right.generateCode(currentScope, codeStream, valueRequired);
if (valueRequired)
codeStream.lor();
}
}
break;
case T_boolean: // logical or
generateLogicalOr(currentScope, codeStream, valueRequired);
break;
}
break;
|
| ||||
case XOR:
switch (this.bits& ASTNode.ReturnTypeIDMASK) {
case T_int:
// 0 ^ x
if ((this.left.constant != Constant.NotAConstant) &&
(this.left.constant.typeID() == TypeIds.T_int) &&
(this.left.constant.intValue() == 0)) {
this.right.generateCode(currentScope, codeStream, valueRequired);
}
else {
// x ^ 0
if ((this.right.constant != Constant.NotAConstant) &&
(this.right.constant.typeID() == TypeIds.T_int) &&
(this.right.constant.intValue() == 0)) {
this.left.generateCode(currentScope, codeStream, valueRequired);
}
else {
this.left.generateCode(currentScope, codeStream, valueRequired);
this.right.generateCode(currentScope, codeStream, valueRequired);
if (valueRequired)
codeStream.ixor();
}
}
break;
case T_long:
// 0 ^ x
if ((this.left.constant != Constant.NotAConstant) &&
(this.left.constant.typeID() == TypeIds.T_long) &&
(this.left.constant.longValue() == 0L)) {
this.right.generateCode(currentScope, codeStream, valueRequired);
}
else {
// x ^ 0
if ((this.right.constant != Constant.NotAConstant) &&
(this.right.constant.typeID() == TypeIds.T_long) &&
(this.right.constant.longValue() == 0L)) {
this.left.generateCode(currentScope, codeStream, valueRequired);
}
else {
this.left.generateCode(currentScope, codeStream, valueRequired);
this.right.generateCode(currentScope, codeStream, valueRequired);
if (valueRequired)
codeStream.lxor();
}
}
break;
case T_boolean:
generateLogicalXor(currentScope, codeStream, valueRequired);
break;
}
break;
|
| |||
case [[#variable5e6461a0]]:
switch (this.bits&ASTNode.ReturnTypeIDMASK) {
case T_int:
// 0 | x
// 0 ^ x
if ((this.left.constant != Constant.NotAConstant) && (this.left.constant.typeID() == TypeIds.T_int) && (this.left.constant.intValue() == 0)) {
this.right.generateCode(currentScope, codeStream, valueRequired);
}
else {
// x | 0
// x ^ 0
if ((this.right.constant != Constant.NotAConstant) && (this.right.constant.typeID() == TypeIds.T_int) && (this.right.constant.intValue() == 0)) {
this.left.generateCode(currentScope, codeStream, valueRequired);
}
else {
this.left.generateCode(currentScope, codeStream, valueRequired);
this.right.generateCode(currentScope, codeStream, valueRequired);
if (valueRequired)
codeStream. [[#variable5e6460e0]]();
}
}
break;
case T_long:
// 0 | x
// 0 ^ x
if ((this.left.constant != Constant.NotAConstant) && (this.left.constant.typeID() == TypeIds.T_long) && (this.left.constant.longValue() == 0L)) {
this.right.generateCode(currentScope, codeStream, valueRequired);
}
else {
// x | 0
// x ^ 0
if ((this.right.constant != Constant.NotAConstant) && (this.right.constant.typeID() == TypeIds.T_long) && (this.right.constant.longValue() == 0L)) {
this.left.generateCode(currentScope, codeStream, valueRequired);
}
else {
this.left.generateCode(currentScope, codeStream, valueRequired);
this.right.generateCode(currentScope, codeStream, valueRequired);
if (valueRequired)
codeStream. [[#variable5e646180]]();
}
}
break;
case T_boolean: // logical or
[[#variable5e646120]](currentScope, codeStream, valueRequired);
break;
}
break;
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#5e6461a0]] | OR |
| 1 | 2 | [[#5e6461a0]] | XOR |
| 2 | 1 | [[#5e6460e0]] | ior |
| 2 | 2 | [[#5e6460e0]] | ixor |
| 3 | 1 | [[#5e646180]] | lor |
| 3 | 2 | [[#5e646180]] | lxor |
| 4 | 1 | [[#5e646120]] | generateLogicalOr |
| 4 | 2 | [[#5e646120]] | generateLogicalXor |