Bug 522347 - [Evaluation] a bug in ASTEvaluationEngine.java

- avoid infinite wait by adding check in
  JavaObjectValueEditor.evaluate() method to ensure
  that the results array contains a null before waiting in case
  the call to engine.evaluate() came back immediately without
  creating a new thread and has already notified all waiters

Change-Id: I55bf1382b994cabfbd0566f3a6a895221f911f1e
Signed-off-by: Jeff Johnston <jjohnstn@redhat.com>
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/JavaObjectValueEditor.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/JavaObjectValueEditor.java
index 32acdaf..1a8646c 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/JavaObjectValueEditor.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/JavaObjectValueEditor.java
@@ -174,7 +174,9 @@
     			synchronized(this) {
                     engine.evaluate(stringValue, frame, listener, DebugEvent.EVALUATION_IMPLICIT, false);
     				try {
-    					this.wait();
+						if (results[0] == null) {
+							this.wait();
+						}
     				} catch (InterruptedException e) {
     					if (results[0] == null){
 	    					IStatus status= new Status(IStatus.ERROR, JDIDebugUIPlugin.getUniqueIdentifier(), IStatus.ERROR, ActionMessages.JavaObjectValueEditor_0, e);