}
switch ((bits & OperatorMASK) >> OperatorSHIFT) {
case NOT :
- switch (this.expression.implicitConversion >> 4) /* runtime type */ {
+ switch ((this.expression.implicitConversion & IMPLICIT_CONVERSION_MASK) >> 4) /* runtime type */ {
case T_boolean :
// ! <boolean>
// Generate code for the condition
}
break;
case TWIDDLE :
- switch (this.expression.implicitConversion >> 4 /* runtime */
- ) {
+ switch ((this.expression.implicitConversion & IMPLICIT_CONVERSION_MASK) >> 4 /* runtime */) {
case T_int :
// ~int
this.expression.generateCode(currentScope, codeStream, valueRequired);
// - <num>
if (this.constant != NotAConstant) {
if (valueRequired) {
- switch (this.expression.implicitConversion >> 4){ /* runtime */
+ switch ((this.expression.implicitConversion & IMPLICIT_CONVERSION_MASK) >> 4){ /* runtime */
case T_int :
codeStream.generateInlinedValue(this.constant.intValue() * -1);
break;
} else {
this.expression.generateCode(currentScope, codeStream, valueRequired);
if (valueRequired) {
- switch (expression.implicitConversion >> 4){ /* runtime type */
+ switch ((expression.implicitConversion & IMPLICIT_CONVERSION_MASK) >> 4){ /* runtime type */
case T_int :
codeStream.ineg();
break;
this.constant = NotAConstant;
return null;
}
- int expressionTypeId = expressionType.id;
- if (expressionTypeId > 15) {
+ int expressionTypeID = expressionType.id;
+ // autoboxing support
+ LookupEnvironment env = scope.environment();
+ boolean use15specifics = env.options.sourceLevel >= JDK1_5;
+ if (use15specifics) {
+ if (!expressionType.isBaseType()) {
+ expressionTypeID = env.computeBoxingType(expressionType).id;
+ }
+ }
+ if (expressionTypeID > 15) {
this.constant = NotAConstant;
scope.problemReporter().invalidOperator(this, expressionType);
return null;
// (cast) left Op (cast) rigth --> result
// 0000 0000 0000 0000 0000
// <<16 <<12 <<8 <<4 <<0
- int operatorSignature = OperatorSignatures[tableId][(expressionTypeId << 4) + expressionTypeId];
- this.expression.implicitConversion = operatorSignature >>> 12;
+ int operatorSignature = OperatorSignatures[tableId][(expressionTypeID << 4) + expressionTypeID];
+ this.expression.computeConversion(scope, TypeBinding.wellKnownType(scope, (operatorSignature >>> 16) & 0x0000F), expressionType);
this.bits |= operatorSignature & 0xF;
switch (operatorSignature & 0xF) { // only switch on possible result type.....
case T_boolean :
break;
default : //error........
this.constant = Constant.NotAConstant;
- if (expressionTypeId != T_undefined)
+ if (expressionTypeID != T_undefined)
scope.problemReporter().invalidOperator(this, expressionType);
return null;
}
this.constant =
Constant.computeConstantOperation(
this.expression.constant,
- expressionTypeId,
+ expressionTypeID,
(bits & OperatorMASK) >> OperatorSHIFT);
} else {
this.constant = Constant.NotAConstant;
}
if (expressionIsCast) {
// check need for operand cast
- CastExpression.checkNeedForArgumentCast(scope, tableId, operatorSignature, this.expression, expressionTypeId);
+ CastExpression.checkNeedForArgumentCast(scope, tableId, operatorSignature, this.expression, expressionTypeID);
}
return this.resolvedType;
}