diff options
Diffstat (limited to 'org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/InstanceOfOperator.java')
-rw-r--r-- | org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/InstanceOfOperator.java | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/InstanceOfOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/InstanceOfOperator.java index d766fd5f7..341602248 100644 --- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/InstanceOfOperator.java +++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/InstanceOfOperator.java @@ -10,8 +10,6 @@ *******************************************************************************/ package org.eclipse.jdt.internal.debug.eval.ast.instructions; -import com.ibm.icu.text.MessageFormat; - import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; @@ -21,35 +19,48 @@ import org.eclipse.jdt.debug.core.IJavaValue; import org.eclipse.jdt.internal.debug.core.JDIDebugPlugin; import org.eclipse.jdt.internal.debug.core.model.JDINullValue; +import com.ibm.icu.text.MessageFormat; + public class InstanceOfOperator extends CompoundInstruction { - public static final String IS_INSTANCE= "isInstance"; //$NON-NLS-1$ - public static final String IS_INSTANCE_SIGNATURE= "(Ljava/lang/Object;)Z"; //$NON-NLS-1$ - + public static final String IS_INSTANCE = "isInstance"; //$NON-NLS-1$ + public static final String IS_INSTANCE_SIGNATURE = "(Ljava/lang/Object;)Z"; //$NON-NLS-1$ + public InstanceOfOperator(int start) { super(start); } - + /* * @see Instruction#execute() */ + @Override public void execute() throws CoreException { - IJavaType type= (IJavaType)pop(); - IJavaValue value= popValue(); + IJavaType type = (IJavaType) pop(); + IJavaValue value = popValue(); if (value instanceof JDINullValue) { pushNewValue(false); return; } - IJavaObject object= (IJavaObject)value; + IJavaObject object = (IJavaObject) value; - IJavaObject classObject= getClassObject(type); + IJavaObject classObject = getClassObject(type); if (classObject == null) { - throw new CoreException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK, MessageFormat.format(InstructionsEvaluationMessages.InstanceOfOperator_No_class_object, new String[]{type.getName()}), null)); + throw new CoreException( + new Status( + IStatus.ERROR, + JDIDebugPlugin.getUniqueIdentifier(), + IStatus.OK, + MessageFormat + .format(InstructionsEvaluationMessages.InstanceOfOperator_No_class_object, + new String[] { type.getName() }), + null)); } - push(classObject.sendMessage(IS_INSTANCE, IS_INSTANCE_SIGNATURE, new IJavaValue[] {object}, getContext().getThread(), false)); + push(classObject.sendMessage(IS_INSTANCE, IS_INSTANCE_SIGNATURE, + new IJavaValue[] { object }, getContext().getThread(), false)); } - + + @Override public String toString() { - return InstructionsEvaluationMessages.InstanceOfOperator__instanceof___operator_3; + return InstructionsEvaluationMessages.InstanceOfOperator__instanceof___operator_3; } } |