diff options
author | Sarika Sinha | 2016-07-13 04:43:58 +0000 |
---|---|---|
committer | Sarika Sinha | 2016-07-13 04:43:58 +0000 |
commit | efcf880f4223cacd869523673fef6bbc4e5b4dd9 (patch) | |
tree | 00472ebd76057fa14c0378b7654bfd1cecfe10d7 | |
parent | 407f0baaed04a33f2d3d1a7698334f54270156ad (diff) | |
download | eclipse.jdt.debug-efcf880f4223cacd869523673fef6bbc4e5b4dd9.tar.gz eclipse.jdt.debug-efcf880f4223cacd869523673fef6bbc4e5b4dd9.tar.xz eclipse.jdt.debug-efcf880f4223cacd869523673fef6bbc4e5b4dd9.zip |
Bug 497509 - Cannot execute "throw new Exception()" expression during
debug
Change-Id: I4e80af93f37e0d544275f2da6d7262d78a1a029a
2 files changed, 19 insertions, 1 deletions
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/eval/TestsBreakpointConditions.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/eval/TestsBreakpointConditions.java index 14b60463a..76efae8de 100644 --- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/eval/TestsBreakpointConditions.java +++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/eval/TestsBreakpointConditions.java @@ -1,5 +1,5 @@ /*******************************************************************************
- * Copyright (c) 2015 IBM Corporation and others.
+ * Copyright (c) 2015, 2016 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
@@ -64,4 +64,19 @@ public class TestsBreakpointConditions extends Tests { }
}
+ /*
+ * To test throw as a last statement
+ */
+ public void testCondition4() throws Throwable {
+ try {
+ init();
+ IValue value = eval("System.out.println(\"test\");throw new Exception(\"test\")");
+ System.out.println(value);
+
+ }
+ finally {
+ end();
+ }
+
+ }
}
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationSourceGenerator.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationSourceGenerator.java index 76cd0b0cd..9076ffd14 100644 --- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationSourceGenerator.java +++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationSourceGenerator.java @@ -178,6 +178,9 @@ public class EvaluationSourceGenerator { token == ITerminalSymbols.TokenNameprivate || token == ITerminalSymbols.TokenNameprotected || token == ITerminalSymbols.TokenNamepublic)){ token = scanner.getNextToken(); } + else if (count == 0 && (token == ITerminalSymbols.TokenNamethrow)){ + return false; + } else if (count ==1 && (token == ITerminalSymbols.TokenNameLBRACE || token == ITerminalSymbols.TokenNameEQUAL)){ return true; } |