### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.debug Index: eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTInstructionCompiler.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTInstructionCompiler.java,v retrieving revision 1.84.2.2 diff -u -r1.84.2.2 ASTInstructionCompiler.java --- eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTInstructionCompiler.java 29 Jun 2011 17:54:57 -0000 1.84.2.2 +++ eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTInstructionCompiler.java 29 Jun 2011 20:57:04 -0000 @@ -5,6 +5,10 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * + * This is an implementation of an early-draft specification developed under the Java + * Community Process (JCP) and is made available for testing and evaluation purposes + * only. The code is not compatible with any specification of the JCP. + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -2752,6 +2756,9 @@ addPopInstruction(); } } else { + if(methodBinding.isVarargs() && paramCount == 1 && node.arguments().size() < 1) { + paramCount = 0; + } push(new SendMessage(selector, signature, paramCount, null, fCounter)); if (expression == null) { push(new PushThis(getEnclosingLevel(node, methodBinding.getDeclaringClass()))); @@ -2780,7 +2787,10 @@ int paramCount = parameterTypes.length; ITypeBinding lastArgBinding = null; if (methodBinding.isVarargs()) { - Expression lastArg = (Expression)arguments.get(argCount - 1); + if(argCount == 0) { + return; + } + Expression lastArg = (Expression)arguments.get(argCount-1); lastArgBinding = resolveTypeBinding(lastArg); if (lastArgBinding == null) { return; Index: eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/SendMessage.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/SendMessage.java,v retrieving revision 1.18 diff -u -r1.18 SendMessage.java --- eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/SendMessage.java 8 May 2006 20:23:01 -0000 1.18 +++ eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/SendMessage.java 29 Jun 2011 20:57:04 -0000 @@ -1,10 +1,14 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * + * This is an implementation of an early-draft specification developed under the Java + * Community Process (JCP) and is made available for testing and evaluation purposes + * only. The code is not compatible with any specification of the JCP. + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -16,6 +20,7 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; +import org.eclipse.jdt.core.Signature; import org.eclipse.jdt.debug.core.IJavaObject; import org.eclipse.jdt.debug.core.IJavaValue; import org.eclipse.jdt.debug.core.IJavaVariable; @@ -60,7 +65,7 @@ throw new CoreException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK, InstructionsEvaluationMessages.SendMessage_Attempt_to_send_a_message_to_a_non_object_value_1, null)); } setLastValue(result); - if (!fSignature.endsWith(")V")) { //$NON-NLS-1$ + if (!Signature.getReturnType(fSignature).equals("V")) { //$NON-NLS-1$ // only push the result if not a void method push(result); }