diff options
Diffstat (limited to 'org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushStaticFieldVariable.java')
-rw-r--r-- | org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushStaticFieldVariable.java | 52 |
1 files changed, 29 insertions, 23 deletions
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushStaticFieldVariable.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushStaticFieldVariable.java index 1b662e8a6..e6f0ce349 100644 --- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushStaticFieldVariable.java +++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PushStaticFieldVariable.java @@ -10,9 +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,43 +18,52 @@ import org.eclipse.jdt.debug.core.IJavaInterfaceType; import org.eclipse.jdt.debug.core.IJavaType; import org.eclipse.jdt.debug.core.IJavaVariable; import org.eclipse.jdt.internal.debug.core.JDIDebugPlugin; - + +import com.ibm.icu.text.MessageFormat; + /** - * Pushes the value of the static fields of the given type - * onto the stack. + * Pushes the value of the static fields of the given type onto the stack. */ public class PushStaticFieldVariable extends CompoundInstruction { - + private String fFieldName; - + private String fQualifiedTypeName; - - public PushStaticFieldVariable(String fieldName, String qualifiedTypeName, int start) { + + public PushStaticFieldVariable(String fieldName, String qualifiedTypeName, + int start) { super(start); - fFieldName= fieldName; - fQualifiedTypeName= qualifiedTypeName; + fFieldName = fieldName; + fQualifiedTypeName = qualifiedTypeName; } - + + @Override public void execute() throws CoreException { - IJavaType receiver= getType(fQualifiedTypeName); - - IJavaVariable field= null; + IJavaType receiver = getType(fQualifiedTypeName); + + IJavaVariable field = null; if (receiver instanceof IJavaInterfaceType) { - field= ((IJavaInterfaceType)receiver).getField(fFieldName); + field = ((IJavaInterfaceType) receiver).getField(fFieldName); } else if (receiver instanceof IJavaClassType) { - field= ((IJavaClassType)receiver).getField(fFieldName); + field = ((IJavaClassType) receiver).getField(fFieldName); } if (field == null) { - String message= MessageFormat.format(InstructionsEvaluationMessages.PushStaticFieldVariable_Cannot_find_the_field__0__in__1__1, new String[]{fFieldName, fQualifiedTypeName}); - throw new CoreException(new Status(IStatus.ERROR, JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK, message, null)); // couldn't find the field + String message = MessageFormat + .format(InstructionsEvaluationMessages.PushStaticFieldVariable_Cannot_find_the_field__0__in__1__1, + new String[] { fFieldName, fQualifiedTypeName }); + throw new CoreException(new Status(IStatus.ERROR, + JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK, message, + null)); // couldn't find the field } push(field); } - + + @Override public String toString() { - return MessageFormat.format(InstructionsEvaluationMessages.PushStaticFieldVariable_push_static_field__0__2, new String[]{fFieldName}); + return MessageFormat + .format(InstructionsEvaluationMessages.PushStaticFieldVariable_push_static_field__0__2, + new String[] { fFieldName }); } } - |