### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java,v retrieving revision 1.68 diff -u -r1.68 AllocationExpression.java --- compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java 26 Apr 2007 21:03:26 -0000 1.68 +++ compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java 2 May 2007 03:17:35 -0000 @@ -84,7 +84,8 @@ ReferenceBinding allocatedType = this.codegenBinding.declaringClass; codeStream.new_(allocatedType); - if (valueRequired) { + boolean isUnboxing = (implicitConversion & TypeIds.UNBOXING) != 0; + if (valueRequired || isUnboxing) { codeStream.dup(); } // better highlight for allocation: display the type individually @@ -126,7 +127,17 @@ } codeStream.invokespecial(syntheticAccessor); } - codeStream.generateImplicitConversion(this.implicitConversion); + codeStream.generateImplicitConversion(implicitConversion); + if (!valueRequired && isUnboxing) { + switch (postConversionType(currentScope).id) { + case T_long : + case T_double : + codeStream.pop2(); + break; + default : + codeStream.pop(); + } + } codeStream.recordPositionsFrom(pc, this.sourceStart); }