Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PostfixPlusPlusOperator.java')
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PostfixPlusPlusOperator.java57
1 files changed, 33 insertions, 24 deletions
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PostfixPlusPlusOperator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PostfixPlusPlusOperator.java
index af952d03a..515b6ab01 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PostfixPlusPlusOperator.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/PostfixPlusPlusOperator.java
@@ -15,7 +15,7 @@ import org.eclipse.jdt.debug.core.IJavaPrimitiveValue;
import org.eclipse.jdt.debug.core.IJavaVariable;
public class PostfixPlusPlusOperator extends XfixOperator {
-
+
public PostfixPlusPlusOperator(int variableTypeId, int start) {
super(variableTypeId, start);
}
@@ -23,37 +23,46 @@ public class PostfixPlusPlusOperator extends XfixOperator {
/*
* @see Instruction#execute()
*/
+ @Override
public void execute() throws CoreException {
IJavaVariable variable = (IJavaVariable) pop();
push(variable.getValue());
-
+
switch (fVariableTypeId) {
- case T_byte :
- variable.setValue(newValue((byte)(((IJavaPrimitiveValue)variable.getValue()).getByteValue() + 1)));
- break;
- case T_short :
- variable.setValue(newValue((short)(((IJavaPrimitiveValue)variable.getValue()).getShortValue() + 1)));
- break;
- case T_char :
- variable.setValue(newValue((char)(((IJavaPrimitiveValue)variable.getValue()).getCharValue() + 1)));
- break;
- case T_int :
- variable.setValue(newValue(((IJavaPrimitiveValue)variable.getValue()).getIntValue() + 1));
- break;
- case T_long :
- variable.setValue(newValue(((IJavaPrimitiveValue)variable.getValue()).getLongValue() + 1));
- break;
- case T_float :
- variable.setValue(newValue(((IJavaPrimitiveValue)variable.getValue()).getFloatValue() + 1));
- break;
- case T_double :
- variable.setValue(newValue(((IJavaPrimitiveValue)variable.getValue()).getDoubleValue() + 1));
- break;
+ case T_byte:
+ variable.setValue(newValue((byte) (((IJavaPrimitiveValue) variable
+ .getValue()).getByteValue() + 1)));
+ break;
+ case T_short:
+ variable.setValue(newValue((short) (((IJavaPrimitiveValue) variable
+ .getValue()).getShortValue() + 1)));
+ break;
+ case T_char:
+ variable.setValue(newValue((char) (((IJavaPrimitiveValue) variable
+ .getValue()).getCharValue() + 1)));
+ break;
+ case T_int:
+ variable.setValue(newValue(((IJavaPrimitiveValue) variable
+ .getValue()).getIntValue() + 1));
+ break;
+ case T_long:
+ variable.setValue(newValue(((IJavaPrimitiveValue) variable
+ .getValue()).getLongValue() + 1));
+ break;
+ case T_float:
+ variable.setValue(newValue(((IJavaPrimitiveValue) variable
+ .getValue()).getFloatValue() + 1));
+ break;
+ case T_double:
+ variable.setValue(newValue(((IJavaPrimitiveValue) variable
+ .getValue()).getDoubleValue() + 1));
+ break;
}
}
+ @Override
public String toString() {
- return InstructionsEvaluationMessages.PostfixPlusPlusOperator_postfix________operator_1;
+ return InstructionsEvaluationMessages.PostfixPlusPlusOperator_postfix________operator_1;
}
}

Back to the top