Bug 244263 - [evaluations] NPE in primitiveWrapper != null
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTInstructionCompiler.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTInstructionCompiler.java
index 119f903..b834e1c 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTInstructionCompiler.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTInstructionCompiler.java
@@ -2310,8 +2310,13 @@
 		Expression rightOperand= node.getRightOperand();
 		int leftTypeId;
 		int rightTypeId;
-		// == case, do not un-box, if the two operands are objects
-		boolean unbox= char0 != '=' || leftOperand.resolveTypeBinding().isPrimitive() || rightOperand.resolveTypeBinding().isPrimitive();
+		boolean unbox = false;
+		// for == and != un-box when at least operand is primitive (otherwise compare the objects)
+		if ((char0 == '=' || char0 == '!') && char1 == '=') {
+			unbox = leftOperand.resolveTypeBinding().isPrimitive() || rightOperand.resolveTypeBinding().isPrimitive();
+		} else {
+			unbox = true;
+		}
 		if (unbox) {
 			leftTypeId= getUnBoxedTypeId(leftOperand);
 			rightTypeId = getUnBoxedTypeId(rightOperand);