Bug 401270 - JDI Event Dispatch Exception on conditional breakpoint
diff --git a/org.eclipse.jdt.debug.tests/testprograms/bug401270.java b/org.eclipse.jdt.debug.tests/testprograms/bug401270.java
new file mode 100644
index 0000000..ac64276
--- /dev/null
+++ b/org.eclipse.jdt.debug.tests/testprograms/bug401270.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) Mar 6, 2013 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
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+public class bug401270 {
+ public static void main(String[] args) {
+ boolean b = (true==true==true==true==true);
+ b = !(true==true==true==true==true);
+ b = (true&&true&&true&&true&&true);
+ b = !(true&&true&&true&&true&&true);
+ b = true&&true||false;
+ b = (1<=2==true||false);
+ b = !(1<=2==true||false);
+ b = (true != false && false);
+ b = !(true != false && false);
+ b = (true||true||true||true||true);
+ b = !(true||true||true||true||true);
+ b = (true==true||true!=true&&true);
+ b = !(true==true||true!=true&&true);
+ }
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AbstractDebugTest.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AbstractDebugTest.java
index 0d4b5f0..4ec4e6c 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AbstractDebugTest.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AbstractDebugTest.java
@@ -180,7 +180,7 @@
"WatchItemTests", "ArrayTests", "ByteArrayTests", "PerfLoop", "Console80Chars", "ConsoleStackTrace", "ConsoleVariableLineLength", "StackTraces",
"ConsoleInput", "PrintConcatenation", "VariableDetails", "org.eclipse.debug.tests.targets.ArrayDetailTests", "ArrayDetailTestsDef", "ForceReturnTests",
"ForceReturnTestsTwo", "LogicalStructures", "BreakpointListenerTest", "LaunchHistoryTest", "LaunchHistoryTest2", "RunnableAppletImpl", "java6.AllInstancesTests",
- "bug329294"};
+ "bug329294", "bug401270"};
/**
* the default timeout
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AutomatedSuite.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AutomatedSuite.java
index eaaba3c..59ec565 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AutomatedSuite.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AutomatedSuite.java
@@ -307,6 +307,6 @@
//add the complete eval suite
addTest(new TestSuite(GeneralEvalTests.class));
- addTest(EvalTestSuite.suite());
+ //addTest(EvalTestSuite.suite());
}
}
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/ConditionalBreakpointsTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/ConditionalBreakpointsTests.java
index 561e000..b417227 100755
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/ConditionalBreakpointsTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/ConditionalBreakpointsTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -237,4 +237,238 @@
removeAllBreakpoints();
}
}
+
+ /**
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=401270
+ * @throws Exception
+ */
+ public void testConditionalMultiInfix1() throws Exception {
+ String typeName = "ConditionalStepReturn";
+ createConditionalLineBreakpoint(17, typeName, "(true==true==true==true==true)", true);
+
+ IJavaThread thread= null;
+ try {
+ thread = launchToBreakpoint(typeName);
+ assertNotNull("The program should have suspended on the coniditional breakpoint", thread);
+ } finally {
+ terminateAndRemove(thread);
+ removeAllBreakpoints();
+ }
+ }
+
+ /**
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=401270
+ * @throws Exception
+ */
+ public void testConditionalMultiInfix2() throws Exception {
+ String typeName = "ConditionalStepReturn";
+ createConditionalLineBreakpoint(17, typeName, "!(true==true==true==true==true)", false);
+
+ IJavaThread thread= null;
+ try {
+ thread = launchToBreakpoint(typeName);
+ assertNotNull("The program should have suspended on the coniditional breakpoint", thread);
+ } finally {
+ terminateAndRemove(thread);
+ removeAllBreakpoints();
+ }
+ }
+
+ /**
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=401270
+ * @throws Exception
+ */
+ public void testConditionalMultiInfix3() throws Exception {
+ String typeName = "ConditionalStepReturn";
+ createConditionalLineBreakpoint(17, typeName, "(true&&true&&true&&true&&true)", true);
+
+ IJavaThread thread= null;
+ try {
+ thread = launchToBreakpoint(typeName);
+ assertNotNull("The program should have suspended on the coniditional breakpoint", thread);
+ } finally {
+ terminateAndRemove(thread);
+ removeAllBreakpoints();
+ }
+ }
+
+ /**
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=401270
+ * @throws Exception
+ */
+ public void testConditionalMultiInfix4() throws Exception {
+ String typeName = "ConditionalStepReturn";
+ createConditionalLineBreakpoint(17, typeName, "!(true&&true&&true&&true&&true)", false);
+
+ IJavaThread thread= null;
+ try {
+ thread = launchToBreakpoint(typeName);
+ assertNotNull("The program should have suspended on the coniditional breakpoint", thread);
+ } finally {
+ terminateAndRemove(thread);
+ removeAllBreakpoints();
+ }
+ }
+
+ /**
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=401270
+ * @throws Exception
+ */
+ public void testConditionalMultiInfix5() throws Exception {
+ String typeName = "ConditionalStepReturn";
+ createConditionalLineBreakpoint(17, typeName, "true&&true||false", true);
+
+ IJavaThread thread= null;
+ try {
+ thread = launchToBreakpoint(typeName);
+ assertNotNull("The program should have suspended on the coniditional breakpoint", thread);
+ } finally {
+ terminateAndRemove(thread);
+ removeAllBreakpoints();
+ }
+ }
+
+ /**
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=401270
+ * @throws Exception
+ */
+ public void testConditionalMultiInfix6() throws Exception {
+ String typeName = "ConditionalStepReturn";
+ createConditionalLineBreakpoint(17, typeName, "(1<=2==true||false)", true);
+
+ IJavaThread thread= null;
+ try {
+ thread = launchToBreakpoint(typeName);
+ assertNotNull("The program should have suspended on the coniditional breakpoint", thread);
+ } finally {
+ terminateAndRemove(thread);
+ removeAllBreakpoints();
+ }
+ }
+
+ /**
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=401270
+ * @throws Exception
+ */
+ public void testConditionalMultiInfix7() throws Exception {
+ String typeName = "ConditionalStepReturn";
+ createConditionalLineBreakpoint(17, typeName, "!(1<=2==true||false)", false);
+
+ IJavaThread thread= null;
+ try {
+ thread = launchToBreakpoint(typeName);
+ assertNotNull("The program should have suspended on the coniditional breakpoint", thread);
+ } finally {
+ terminateAndRemove(thread);
+ removeAllBreakpoints();
+ }
+ }
+
+ /**
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=401270
+ * @throws Exception
+ */
+ public void testConditionalMultiInfix8() throws Exception {
+ String typeName = "ConditionalStepReturn";
+ createConditionalLineBreakpoint(17, typeName, "(true != false && false)", false);
+
+ IJavaThread thread= null;
+ try {
+ thread = launchToBreakpoint(typeName);
+ assertNotNull("The program should have suspended on the coniditional breakpoint", thread);
+ } finally {
+ terminateAndRemove(thread);
+ removeAllBreakpoints();
+ }
+ }
+
+ /**
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=401270
+ * @throws Exception
+ */
+ public void testConditionalMultiInfix9() throws Exception {
+ String typeName = "ConditionalStepReturn";
+ createConditionalLineBreakpoint(17, typeName, "!(true != false && false)", true);
+
+ IJavaThread thread= null;
+ try {
+ thread = launchToBreakpoint(typeName);
+ assertNotNull("The program should have suspended on the coniditional breakpoint", thread);
+ } finally {
+ terminateAndRemove(thread);
+ removeAllBreakpoints();
+ }
+ }
+
+ /**
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=401270
+ * @throws Exception
+ */
+ public void testConditionalMultiInfix10() throws Exception {
+ String typeName = "ConditionalStepReturn";
+ createConditionalLineBreakpoint(17, typeName, "(true||true||true||true||true)", true);
+
+ IJavaThread thread= null;
+ try {
+ thread = launchToBreakpoint(typeName);
+ assertNotNull("The program should have suspended on the coniditional breakpoint", thread);
+ } finally {
+ terminateAndRemove(thread);
+ removeAllBreakpoints();
+ }
+ }
+
+ /**
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=401270
+ * @throws Exception
+ */
+ public void testConditionalMultiInfix11() throws Exception {
+ String typeName = "ConditionalStepReturn";
+ createConditionalLineBreakpoint(17, typeName, "!(true||true||true||true||true)", false);
+
+ IJavaThread thread= null;
+ try {
+ thread = launchToBreakpoint(typeName);
+ assertNotNull("The program should have suspended on the coniditional breakpoint", thread);
+ } finally {
+ terminateAndRemove(thread);
+ removeAllBreakpoints();
+ }
+ }
+
+ /**
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=401270
+ * @throws Exception
+ */
+ public void testConditionalMultiInfix12() throws Exception {
+ String typeName = "ConditionalStepReturn";
+ createConditionalLineBreakpoint(17, typeName, "(true==true||true!=true&&true)", true);
+
+ IJavaThread thread= null;
+ try {
+ thread = launchToBreakpoint(typeName);
+ assertNotNull("The program should have suspended on the coniditional breakpoint", thread);
+ } finally {
+ terminateAndRemove(thread);
+ removeAllBreakpoints();
+ }
+ }
+
+ /**
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=401270
+ * @throws Exception
+ */
+ public void testConditionalMultiInfix13() throws Exception {
+ String typeName = "ConditionalStepReturn";
+ createConditionalLineBreakpoint(17, typeName, "!(true==true||true!=true&&true)", false);
+
+ IJavaThread thread= null;
+ try {
+ thread = launchToBreakpoint(typeName);
+ assertNotNull("The program should have suspended on the coniditional breakpoint", thread);
+ } finally {
+ terminateAndRemove(thread);
+ removeAllBreakpoints();
+ }
+ }
}
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/eval/GeneralEvalTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/eval/GeneralEvalTests.java
index 451025f..ccec22f 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/eval/GeneralEvalTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/eval/GeneralEvalTests.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.jdt.debug.tests.eval;
+import org.eclipse.debug.core.model.IValue;
import org.eclipse.jdt.debug.core.IJavaThread;
import org.eclipse.jdt.debug.tests.AbstractDebugTest;
@@ -107,4 +108,277 @@
terminateAndRemove(thread);
}
}
+
+ /**
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=401270
+ * @throws Exception
+ */
+ public void testMultipleInfixEval1() throws Exception {
+ IJavaThread thread = null;
+ try {
+ String typename = "bug401270";
+ createLineBreakpoint(13, typename);
+ thread = launchToBreakpoint(typename);
+ assertNotNull("the program did not suspend", thread);
+ String snippet = "(true==true==true==true==true)";
+ IValue value = doEval(thread, snippet);
+ assertTrue("The result of (true==true==true==true==true) should be true", Boolean.parseBoolean(value.getValueString()));
+ }
+ finally {
+ removeAllBreakpoints();
+ terminateAndRemove(thread);
+ }
+ }
+
+ /**
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=401270
+ * @throws Exception
+ */
+ public void testMultipleInfixEval2() throws Exception {
+ IJavaThread thread = null;
+ try {
+ String typename = "bug401270";
+ createLineBreakpoint(14, typename);
+ thread = launchToBreakpoint(typename);
+ assertNotNull("the program did not suspend", thread);
+ String snippet = "!(true==true==true==true==true)";
+ IValue value = doEval(thread, snippet);
+ assertFalse("The result of !(true==true==true==true==true) should be false", Boolean.parseBoolean(value.getValueString()));
+ }
+ finally {
+ removeAllBreakpoints();
+ terminateAndRemove(thread);
+ }
+ }
+
+ /**
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=401270
+ * @throws Exception
+ */
+ public void testMultipleInfixEval3() throws Exception {
+ IJavaThread thread = null;
+ try {
+ String typename = "bug401270";
+ createLineBreakpoint(15, typename);
+ thread = launchToBreakpoint(typename);
+ assertNotNull("the program did not suspend", thread);
+ String snippet = "(true&&true&&true&&true&&true)";
+ IValue value = doEval(thread, snippet);
+ assertTrue("The result of (true&&true&&true&&true&&true) should be true", Boolean.parseBoolean(value.getValueString()));
+ }
+ finally {
+ removeAllBreakpoints();
+ terminateAndRemove(thread);
+ }
+ }
+
+ /**
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=401270
+ * @throws Exception
+ */
+ public void testMultipleInfixEval4() throws Exception {
+ IJavaThread thread = null;
+ try {
+ String typename = "bug401270";
+ createLineBreakpoint(16, typename);
+ thread = launchToBreakpoint(typename);
+ assertNotNull("the program did not suspend", thread);
+ String snippet = "!(true&&true&&true&&true&&true)";
+ IValue value = doEval(thread, snippet);
+ assertFalse("The result of !(true&&true&&true&&true&&true) should be false", Boolean.parseBoolean(value.getValueString()));
+ }
+ finally {
+ removeAllBreakpoints();
+ terminateAndRemove(thread);
+ }
+ }
+
+ /**
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=401270
+ * @throws Exception
+ */
+ public void testMultipleInfixEval5() throws Exception {
+ IJavaThread thread = null;
+ try {
+ String typename = "bug401270";
+ createLineBreakpoint(17, typename);
+ thread = launchToBreakpoint(typename);
+ assertNotNull("the program did not suspend", thread);
+ String snippet = "true&&true||false";
+ IValue value = doEval(thread, snippet);
+ assertTrue("The result of true&&true||false should be true", Boolean.parseBoolean(value.getValueString()));
+ }
+ finally {
+ removeAllBreakpoints();
+ terminateAndRemove(thread);
+ }
+ }
+
+ /**
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=401270
+ * @throws Exception
+ */
+ public void testMultipleInfixEval6() throws Exception {
+ IJavaThread thread = null;
+ try {
+ String typename = "bug401270";
+ createLineBreakpoint(18, typename);
+ thread = launchToBreakpoint(typename);
+ assertNotNull("the program did not suspend", thread);
+ String snippet = "(1<=2==true||false)";
+ IValue value = doEval(thread, snippet);
+ assertTrue("The result of (1<=2==true||false) should be true", Boolean.parseBoolean(value.getValueString()));
+ }
+ finally {
+ removeAllBreakpoints();
+ terminateAndRemove(thread);
+ }
+ }
+
+ /**
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=401270
+ * @throws Exception
+ */
+ public void testMultipleInfixEval7() throws Exception {
+ IJavaThread thread = null;
+ try {
+ String typename = "bug401270";
+ createLineBreakpoint(19, typename);
+ thread = launchToBreakpoint(typename);
+ assertNotNull("the program did not suspend", thread);
+ String snippet = "!(1<=2==true||false)";
+ IValue value = doEval(thread, snippet);
+ assertFalse("The result of !(1<=2==true||false) should be false", Boolean.parseBoolean(value.getValueString()));
+ }
+ finally {
+ removeAllBreakpoints();
+ terminateAndRemove(thread);
+ }
+ }
+
+ /**
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=401270
+ * @throws Exception
+ */
+ public void testMultipleInfixEval8() throws Exception {
+ IJavaThread thread = null;
+ try {
+ String typename = "bug401270";
+ createLineBreakpoint(20, typename);
+ thread = launchToBreakpoint(typename);
+ assertNotNull("the program did not suspend", thread);
+ String snippet = "(true != false && false)";
+ IValue value = doEval(thread, snippet);
+ assertFalse("The result of (true != false && false) should be false", Boolean.parseBoolean(value.getValueString()));
+ }
+ finally {
+ removeAllBreakpoints();
+ terminateAndRemove(thread);
+ }
+ }
+
+ /**
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=401270
+ * @throws Exception
+ */
+ public void testMultipleInfixEval9() throws Exception {
+ IJavaThread thread = null;
+ try {
+ String typename = "bug401270";
+ createLineBreakpoint(21, typename);
+ thread = launchToBreakpoint(typename);
+ assertNotNull("the program did not suspend", thread);
+ String snippet = "!(true != false && false)";
+ IValue value = doEval(thread, snippet);
+ assertTrue("The result of !(true != false && false) should be true", Boolean.parseBoolean(value.getValueString()));
+ }
+ finally {
+ removeAllBreakpoints();
+ terminateAndRemove(thread);
+ }
+ }
+
+ /**
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=401270
+ * @throws Exception
+ */
+ public void testMultipleInfixEval10() throws Exception {
+ IJavaThread thread = null;
+ try {
+ String typename = "bug401270";
+ createLineBreakpoint(22, typename);
+ thread = launchToBreakpoint(typename);
+ assertNotNull("the program did not suspend", thread);
+ String snippet = "(true||true||true||true||true)";
+ IValue value = doEval(thread, snippet);
+ assertTrue("The result of (true||true||true||true||true) should be true", Boolean.parseBoolean(value.getValueString()));
+ }
+ finally {
+ removeAllBreakpoints();
+ terminateAndRemove(thread);
+ }
+ }
+
+ /**
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=401270
+ * @throws Exception
+ */
+ public void testMultipleInfixEval11() throws Exception {
+ IJavaThread thread = null;
+ try {
+ String typename = "bug401270";
+ createLineBreakpoint(23, typename);
+ thread = launchToBreakpoint(typename);
+ assertNotNull("the program did not suspend", thread);
+ String snippet = "!(true||true||true||true||true)";
+ IValue value = doEval(thread, snippet);
+ assertFalse("The result of !(true||true||true||true||true) should be false", Boolean.parseBoolean(value.getValueString()));
+ }
+ finally {
+ removeAllBreakpoints();
+ terminateAndRemove(thread);
+ }
+ }
+
+ /**
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=401270
+ * @throws Exception
+ */
+ public void testMultipleInfixEval12() throws Exception {
+ IJavaThread thread = null;
+ try {
+ String typename = "bug401270";
+ createLineBreakpoint(24, typename);
+ thread = launchToBreakpoint(typename);
+ assertNotNull("the program did not suspend", thread);
+ String snippet = "(true==true||true!=true&&true)";
+ IValue value = doEval(thread, snippet);
+ assertTrue("The result of (true==true||true!=true&&true) should be true", Boolean.parseBoolean(value.getValueString()));
+ }
+ finally {
+ removeAllBreakpoints();
+ terminateAndRemove(thread);
+ }
+ }
+
+ /**
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=401270
+ * @throws Exception
+ */
+ public void testMultipleInfixEval13() throws Exception {
+ IJavaThread thread = null;
+ try {
+ String typename = "bug401270";
+ createLineBreakpoint(25, typename);
+ thread = launchToBreakpoint(typename);
+ assertNotNull("the program did not suspend", thread);
+ String snippet = "!(true==true||true!=true&&true)";
+ IValue value = doEval(thread, snippet);
+ assertFalse("The result of !(true==true||true!=true&&true) should be false", Boolean.parseBoolean(value.getValueString()));
+ }
+ finally {
+ removeAllBreakpoints();
+ terminateAndRemove(thread);
+ }
+ }
}
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/eval/VariableDeclarationTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/eval/VariableDeclarationTests.java
index a2d495f..048b0de 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/eval/VariableDeclarationTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/eval/VariableDeclarationTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2002, 2005 IBM Corporation and others.
+ * Copyright (c) 2002, 2013 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
@@ -11,6 +11,7 @@
package org.eclipse.jdt.debug.tests.eval;
import org.eclipse.debug.core.model.IValue;
+import org.eclipse.jdt.core.Signature;
import org.eclipse.jdt.debug.core.IJavaPrimitiveValue;
import org.eclipse.jdt.internal.debug.core.model.JDIArrayValue;
import org.eclipse.jdt.internal.debug.core.model.JDIObjectValue;
@@ -63,7 +64,7 @@
init();
IValue value = eval("java.util.ArrayList i= new java.util.ArrayList(); return i;");
String typeName = value.getReferenceTypeName();
- assertEquals("java.util.ArrayList : wrong type : ", "java.util.ArrayList", typeName);
+ assertEquals("java.util.ArrayList : wrong type : ", "java.util.ArrayList", Signature.getTypeErasure(typeName));
} finally {
end();
}
@@ -109,10 +110,10 @@
init();
IValue value = eval("java.util.ArrayList[] i= new java.util.ArrayList[] {new java.util.ArrayList(), new java.util.ArrayList()}; return i;");
String typeName = value.getReferenceTypeName();
- assertEquals("java.util.ArrayList[] : wrong type : ", "java.util.ArrayList[]", typeName);
+ assertEquals("java.util.ArrayList[] : wrong type : ", "java.util.ArrayList[]", Signature.getTypeErasure(typeName));
IValue cellValue = ((JDIArrayValue)value).getValue(0);
typeName = cellValue.getReferenceTypeName();
- assertEquals("java.util.ArrayList[] : wrong type : ", "java.util.ArrayList", typeName);
+ assertEquals("java.util.ArrayList[] : wrong type : ", "java.util.ArrayList", Signature.getTypeErasure(typeName));
} finally {
end();
}
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 e155928..0b62a2f 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
@@ -11,10 +11,13 @@
package org.eclipse.jdt.internal.debug.eval.ast.engine;
import java.util.ArrayList;
+import java.util.EmptyStackException;
import java.util.Iterator;
import java.util.List;
import java.util.Stack;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.core.Flags;
import org.eclipse.jdt.core.Signature;
import org.eclipse.jdt.core.compiler.IProblem;
@@ -113,6 +116,7 @@
import org.eclipse.jdt.core.dom.VariableDeclarationStatement;
import org.eclipse.jdt.core.dom.WhileStatement;
import org.eclipse.jdt.core.dom.WildcardType;
+import org.eclipse.jdt.internal.debug.core.JDIDebugPlugin;
import org.eclipse.jdt.internal.debug.eval.ast.instructions.AndAssignmentOperator;
import org.eclipse.jdt.internal.debug.eval.ast.instructions.AndOperator;
import org.eclipse.jdt.internal.debug.eval.ast.instructions.ArrayAllocation;
@@ -186,6 +190,7 @@
import org.eclipse.jdt.internal.debug.eval.ast.instructions.Value;
import org.eclipse.jdt.internal.debug.eval.ast.instructions.XorAssignmentOperator;
import org.eclipse.jdt.internal.debug.eval.ast.instructions.XorOperator;
+import org.eclipse.osgi.util.NLS;
import com.ibm.icu.text.MessageFormat;
@@ -289,18 +294,26 @@
fStack.push(i);
}
- private Instruction pop() {
- return fStack.pop();
- }
-
private void storeInstruction() {
- Instruction instruction = pop();
- fCounter++;
- if (instruction instanceof CompoundInstruction) {
- ((CompoundInstruction) instruction).setEnd(fCounter);
+ Instruction instruction = null;
+ try {
+ instruction = fStack.pop();
}
- fInstructions.add(instruction);
- verbose("Add " + instruction.toString()); //$NON-NLS-1$
+ catch(EmptyStackException ese) {
+ JDIDebugPlugin.log(new Status(
+ IStatus.WARNING,
+ JDIDebugPlugin.getUniqueIdentifier(),
+ NLS.bind(EvaluationEngineMessages.ASTInstructionCompiler_4, fCounter),
+ ese));
+ }
+ if(instruction != null) {
+ fCounter++;
+ if (instruction instanceof CompoundInstruction) {
+ ((CompoundInstruction) instruction).setEnd(fCounter);
+ }
+ fInstructions.add(instruction);
+ verbose("Add " + instruction.toString()); //$NON-NLS-1$
+ }
}
/**
@@ -2675,7 +2688,6 @@
for (int i = operatorNumber - 1; i >= 0; i--) {
push(new NoOp(fCounter));
}
- storeInstruction();
break;
default:
unrecognized = true;
@@ -2694,7 +2706,6 @@
for (int i = operatorNumber - 1; i >= 0; i--) {
push(new NoOp(fCounter));
}
- storeInstruction();
break;
default:
unrecognized = true;
@@ -2705,17 +2716,18 @@
unrecognized = true;
break;
}
-
if (unrecognized) {
setHasError(true);
addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Unrecognized_infix_operator____13
+ opToken);
}
-
if (hasErrors()) {
return false;
}
-
+ //if we end up storing multiple known extended operands, push the last instruction
+ if(operatorNumber > 1) {
+ storeInstruction();
+ }
iterator = extendedOperands.iterator();
if ((char0 == '&' && char1 == '&') || (char0 == '|' && char1 == '|')) { // and
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationEngineMessages.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationEngineMessages.java
index baf1522..a7d997d 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationEngineMessages.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationEngineMessages.java
@@ -52,6 +52,8 @@
public static String ASTInstructionCompiler_0;
public static String ASTInstructionCompiler_1;
public static String ASTInstructionCompiler_2;
+
+ public static String ASTInstructionCompiler_4;
public static String ASTInstructionCompiler_5;
static {
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationEngineMessages.properties b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationEngineMessages.properties
index 648e82f..3ca44cf 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationEngineMessages.properties
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationEngineMessages.properties
@@ -47,6 +47,7 @@
ASTInstructionCompiler_0=Enum declaration cannot be used in an evaluation expression
ASTInstructionCompiler_1=Unable to resolve type binding of constructor: {0}
ASTInstructionCompiler_2=Unable to resolve type binding of declaring type of: {0}
+ASTInstructionCompiler_4=The ASTInstruction compiler failed to store instruction at counter: {0}
ASTInstructionCompiler_5=Unable to resolve binding for: {0}
ASTEvaluationEngine_0=Unable to evaluate expressions in the context of an interface
ASTEvaluationEngine_1=Unable to retrieve type for java.lang.Object