Bug 560270 - Don't log VM disconnects in Interpreter.disableCollection()

This change adjusts Interpreter.disableCollection(IJavaValue) to log
exceptions similarly to Interpreter.releaseObjects() and
JDIDebugElement.logError(Exception). I.e. VMDisconnectedException
exceptions are ignored if the debug target is terminated or
disconnected.

This prevents reporting exceptions in the Error Log, for cases in which
no exceptions are expected.

Change-Id: I532d957ca31b0c1e9f8990f03d4381a2d6c94a6a
Signed-off-by: Simeon Andreev <simeon.danailov.andreev@gmail.com>
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/Interpreter.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/Interpreter.java
index d9d1460..51377b8 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/Interpreter.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/Interpreter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -121,6 +121,10 @@
 			value.disableCollection();
 			fPermStorage.add(value);
 		} catch (CoreException e) {
+			// don't worry about GC if the VM has terminated
+			if ((e.getStatus().getException() instanceof VMDisconnectedException)) {
+				return;
+			}
 			JDIDebugPlugin.log(e);
 		}
 	}