| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 35 | 2 | 0 | 1.000 | switch_group |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 35 | 464 | plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java |
| 2 | 35 | 337 | plugins/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetSingleNameReference.java |
| ||||
case Binding.LOCAL: // assigning to a local variable (cannot assign to outer local)
LocalVariableBinding localBinding = (LocalVariableBinding) this.codegenBinding;
Constant assignConstant;
int increment;
// using incr bytecode if possible
switch (localBinding.type.id) {
case T_JavaLangString:
codeStream.generateStringConcatenationAppend(currentScope, this, expression);
if (valueRequired) {
codeStream.dup();
}
codeStream.store(localBinding, false);
return;
case T_int:
if (((assignConstant = expression.constant) != Constant.NotAConstant) &&
(assignConstant.typeID() != T_float) // only for integral types
&& (assignConstant.typeID() != T_double) &&
((increment = assignConstant.intValue()) == (short) increment)) { // 16 bits value
switch (operator) {
case PLUS:
codeStream.iinc(localBinding.resolvedPosition, increment);
if (valueRequired) {
codeStream.load(localBinding);
}
return;
case MINUS:
codeStream.iinc(localBinding.resolvedPosition, -increment);
if (valueRequired) {
codeStream.load(localBinding);
}
return;
}
}
default:
codeStream.load(localBinding);
}
|
| ||||
case Binding.LOCAL: // assigning to a local variable (cannot assign to outer local)
LocalVariableBinding localBinding = (LocalVariableBinding) this.codegenBinding;
Constant assignConstant;
int increment;
// using incr bytecode if possible
switch (localBinding.type.id) {
case T_JavaLangString:
codeStream.generateStringConcatenationAppend(currentScope, this, expression);
if (valueRequired) {
codeStream.dup();
}
codeStream.store(localBinding, false);
return;
case T_int:
if (((assignConstant = expression.constant) != Constant.NotAConstant) &&
(assignConstant.typeID() != T_float) // only for integral types
&& (assignConstant.typeID() != T_double) &&
((increment = assignConstant.intValue()) == (short) increment)) { // 16 bits value
switch (operator) {
case PLUS:
codeStream.iinc(localBinding.resolvedPosition, increment);
if (valueRequired) {
codeStream.load(localBinding);
}
return;
case MINUS:
codeStream.iinc(localBinding.resolvedPosition, -increment);
if (valueRequired) {
codeStream.load(localBinding);
}
return;
}
}
default:
codeStream.load(localBinding);
}
|
| |||
case Binding.LOCAL: // assigning to a local variable (cannot assign to outer local)
LocalVariableBinding localBinding = (LocalVariableBinding) this.codegenBinding;
Constant assignConstant;
int increment;
// using incr bytecode if possible
switch (localBinding.type.id) {
case T_JavaLangString:
codeStream.generateStringConcatenationAppend(currentScope, this, expression);
if (valueRequired) {
codeStream.dup();
}
codeStream.store(localBinding, false);
return;
case T_int:
if (((assignConstant = expression.constant) != Constant.NotAConstant) && (assignConstant.typeID() != T_float) // only for integral types
&& (assignConstant.typeID() != T_double) && ((increment = assignConstant.intValue()) == (short) increment)) { // 16 bits value
switch (operator) {
case PLUS:
codeStream.iinc(localBinding.resolvedPosition, increment);
if (valueRequired) {
codeStream.load(localBinding);
}
return;
case MINUS:
codeStream.iinc(localBinding.resolvedPosition, -increment);
if (valueRequired) {
codeStream.load(localBinding);
}
return;
}
}
default:
codeStream.load(localBinding);
}
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| None | |||