Merge remote-tracking branch 'origin/master' into BETA_JAVA9
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/test/stepping/StepResultTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/test/stepping/StepResultTests.java
index da83866..1c0fb56 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/test/stepping/StepResultTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/test/stepping/StepResultTests.java
@@ -75,7 +75,7 @@
 			stackFrame = (IJavaStackFrame) thread.getTopStackFrame();
 			assertEquals("main", stackFrame.getMethodName());
 			IVariable varInMain2 = stackFrame.getVariables()[0];
-			assertEquals("x", varInMain2.getName());
+			assertEquals("no method return value", varInMain2.getName());
 		}
 		finally {
 			terminateAndRemove(thread);
@@ -124,7 +124,7 @@
 			IVariable varInH = stackFrame.getVariables()[0];
 
 			// specifically no "i() returned" must be present
-			assertEquals("this", varInH.getName());
+			assertEquals("no method return value", varInH.getName());
 		}
 		finally {
 			terminateAndRemove(thread);
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 b417227..7f66bbd 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, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 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
@@ -471,4 +471,27 @@
 			removeAllBreakpoints();
 		}	
 	}
+
+	/**
+	 * Tests a breakpoint with a simple systrace Launch should don't suspend for simple systrace
+	 * 
+	 * @throws Exception
+	 */
+	public void testSystracelBreakpoint() throws Exception {
+		String typeName = "HitCountLooper";
+		IJavaLineBreakpoint bp = createConditionalLineBreakpoint(16, typeName, "System.out.println(\"enclosing_type.enclosing_method()\");", true);
+		IJavaLineBreakpoint bp1 = createConditionalLineBreakpoint(17, typeName, "return true", true);
+
+		IJavaThread thread = null;
+		try {
+			thread = launchToLineBreakpoint(typeName, bp1);
+
+		}
+		finally {
+			bp.delete();
+			assertNotNull(thread);
+			terminateAndRemove(thread);
+			removeAllBreakpoints();
+		}
+	}
 }
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/JarSourceLookupTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/JarSourceLookupTests.java
index cc62f61..30884a4 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/JarSourceLookupTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/JarSourceLookupTests.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
+ * Copyright (c) 2011, 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
diff --git a/org.eclipse.jdt.debug.ui/icons/full/obj16/methodresult_obj_disabled.png b/org.eclipse.jdt.debug.ui/icons/full/obj16/methodresult_obj_disabled.png
new file mode 100644
index 0000000..238a9d1
--- /dev/null
+++ b/org.eclipse.jdt.debug.ui/icons/full/obj16/methodresult_obj_disabled.png
Binary files differ
diff --git a/org.eclipse.jdt.debug.ui/icons/full/obj16/methodresult_obj_disabled@2x.png b/org.eclipse.jdt.debug.ui/icons/full/obj16/methodresult_obj_disabled@2x.png
new file mode 100644
index 0000000..f11687b
--- /dev/null
+++ b/org.eclipse.jdt.debug.ui/icons/full/obj16/methodresult_obj_disabled@2x.png
Binary files differ
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIModelPresentation.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIModelPresentation.java
index bb02b14..a632454 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIModelPresentation.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIModelPresentation.java
@@ -1105,6 +1105,11 @@
 			}
 		}
 		if (javaVariable instanceof JDIReturnValueVariable) {
+
+			JDIReturnValueVariable jdiReturnValueVariable = (JDIReturnValueVariable) javaVariable;
+			if (!jdiReturnValueVariable.hasResult) {
+				return JavaDebugImages.getImageDescriptor(JavaDebugImages.IMG_OBJS_METHOD_RESULT_DISABLED);
+			}
 			return JavaDebugImages.getImageDescriptor(JavaDebugImages.IMG_OBJS_METHOD_RESULT);
 		}
 		return JavaUI.getSharedImages().getImageDescriptor(ISharedImages.IMG_OBJS_DEFAULT);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaDebugImages.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaDebugImages.java
index d8cd786..9317aa7 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaDebugImages.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaDebugImages.java
@@ -42,6 +42,7 @@
 		
 	public static final String IMG_OBJS_LOCAL_VARIABLE = "IMG_OBJS_LOCAL_VARIABLE";	//$NON-NLS-1$
 	public static final String IMG_OBJS_METHOD_RESULT = "IMG_OBJS_METHOD_RESULT"; //$NON-NLS-1$
+	public static final String IMG_OBJS_METHOD_RESULT_DISABLED = "IMG_OBJS_METHOD_RESULT_DISABLED"; //$NON-NLS-1$
 	
 	public static final String IMG_OVR_METHOD_BREAKPOINT_ENTRY= "IMG_OBJS_METHOD_BREAKPOINT_ENTRY";	//$NON-NLS-1$
 	public static final String IMG_OVR_METHOD_BREAKPOINT_ENTRY_DISABLED= "IMG_OBJS_METHOD_BREAKPOINT_ENTRY_DISABLED";	//$NON-NLS-1$
@@ -158,6 +159,7 @@
 			
 		declareRegistryImage(IMG_OBJS_LOCAL_VARIABLE, T_OBJ + "localvariable_obj.png"); //$NON-NLS-1$
 		declareRegistryImage(IMG_OBJS_METHOD_RESULT, T_OBJ + "methodresult_obj.png"); //$NON-NLS-1$
+		declareRegistryImage(IMG_OBJS_METHOD_RESULT_DISABLED, T_OBJ + "methodresult_obj_disabled.png"); //$NON-NLS-1$
 		
 		declareRegistryImage(IMG_OVR_METHOD_BREAKPOINT_ENTRY, T_OVR + "entry_ovr.png"); //$NON-NLS-1$
 		declareRegistryImage(IMG_OVR_METHOD_BREAKPOINT_ENTRY_DISABLED, T_OVR + "entry_ovr_disabled.png"); //$NON-NLS-1$
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/BreakpointLocationVerifierJob.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/BreakpointLocationVerifierJob.java
index 4c469f7..81f4904 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/BreakpointLocationVerifierJob.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/BreakpointLocationVerifierJob.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- *  Copyright (c) 2003, 2015 IBM Corporation and others.
+ *  Copyright (c) 2003, 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
@@ -120,6 +120,9 @@
 		fCunit.accept(locator);
 		int lineNumber = locator.getLineLocation();		
 		String typeName = locator.getFullyQualifiedTypeName();
+		if (typeName == null) {
+			return new Status(IStatus.ERROR, JDIDebugUIPlugin.getUniqueIdentifier(), IStatus.ERROR, ActionMessages.BreakpointLocationVerifierJob_not_valid_location, null);
+		}
 		try {
 			switch (locator.getLocationType()) {
 				case ValidBreakpointLocationLocator.LOCATION_LINE:
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/RunToLineAdapter.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/RunToLineAdapter.java
index 97ce8b3..2042e28 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/RunToLineAdapter.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/RunToLineAdapter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- *  Copyright (c) 2000, 2015 IBM Corporation and others.
+ *  Copyright (c) 2000, 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
@@ -78,12 +78,15 @@
 							CompilationUnit compilationUnit= (CompilationUnit)parser.createAST(null);
 							ValidBreakpointLocationLocator locator= new ValidBreakpointLocationLocator(compilationUnit, lineNumber[0], false, false);
 							compilationUnit.accept(locator);
-							validLine[0]= locator.getLineLocation();		
+							validLine[0] = locator.getLineLocation();
 							typeName[0]= locator.getFullyQualifiedTypeName();
 						}
 					};
 					BusyIndicator.showWhile(JDIDebugUIPlugin.getStandardDisplay(), r);
 					if (validLine[0] == lineNumber[0]) {
+						if (typeName[0] == null) {
+							throw new CoreException(new Status(IStatus.ERROR, JDIDebugUIPlugin.getUniqueIdentifier(), IJavaDebugUIConstants.INTERNAL_ERROR, "Invalid Type Name", null)); //$NON-NLS-1$
+						}
 						IBreakpoint breakpoint= null;
 						Map<String, Object> attributes = new HashMap<String, Object>(4);
 						BreakpointUtils.addRunToLineAttributes(attributes);
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ToggleBreakpointAdapter.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ToggleBreakpointAdapter.java
index 572c616..003ac07 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ToggleBreakpointAdapter.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ToggleBreakpointAdapter.java
@@ -354,6 +354,9 @@
                 	} else {
                 		tname = locator.getFullyQualifiedTypeName();
                 	}
+					if (tname == null) {
+						return Status.CANCEL_STATUS;
+					}
                 	IResource resource = BreakpointUtils.getBreakpointResource(type);
 					int lnumber = locator == null ? tsel.getStartLine() + 1 : locator.getLineLocation();
 					IJavaLineBreakpoint existingBreakpoint = JDIDebugModel.lineBreakpointExists(resource, tname, lnumber);
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/ConditionalBreakpointHandler.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/ConditionalBreakpointHandler.java
index 703f298..ee90a07 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/ConditionalBreakpointHandler.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/ConditionalBreakpointHandler.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009, 2012 IBM Corporation and others.
+ * Copyright (c) 2009, 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
@@ -34,6 +34,7 @@
 import org.eclipse.jdt.internal.debug.core.JDIDebugPlugin;
 import org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget;
 import org.eclipse.jdt.internal.debug.core.model.JDIThread;
+import org.eclipse.jdt.internal.debug.core.model.JDIValue;
 
 import com.ibm.icu.text.MessageFormat;
 import com.sun.jdi.VMDisconnectedException;
@@ -123,6 +124,12 @@
 							return DONT_SUSPEND;
 						}
 					}
+					if (value instanceof JDIValue) {
+						JDIValue jdiValue = (JDIValue)value;
+						// If return is void, don't suspend (no error dialog)
+						if (jdiValue.getJavaType().getName().equals("void")) //$NON-NLS-1$
+							return DONT_SUSPEND;
+					}
 					IStatus status = new Status(
 							IStatus.ERROR,
 							JDIDebugPlugin.getUniqueIdentifier(),
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaBreakpointImportParticipant.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaBreakpointImportParticipant.java
index 881b4cf..f8f0064 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaBreakpointImportParticipant.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaBreakpointImportParticipant.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008, 2013 IBM Corporation and others.
+ * Copyright (c) 2008, 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
@@ -561,6 +561,8 @@
 				int newline = locator.getLineLocation();
 				if (locator.getLocationType() == ValidBreakpointLocationLocator.LOCATION_LINE) {
 					if (currentline != newline) {
+						if (locator.getFullyQualifiedTypeName() == null)
+							throw new CoreException(Status.CANCEL_STATUS);
 						bp.getMarker().setAttribute(JavaBreakpoint.TYPE_NAME,
 								locator.getFullyQualifiedTypeName());
 						bp.getMarker().setAttribute(IMarker.LINE_NUMBER,
@@ -594,6 +596,9 @@
 		if (attr1 == null) {
 			return attr2 == null;
 		}
+		if (attr2 == null) {
+			return false;
+		}
 		return attr1.equals(attr2);
 	}
 
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JDIReturnValueVariable.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JDIReturnValueVariable.java
index cb7376c..562b01f 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JDIReturnValueVariable.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JDIReturnValueVariable.java
@@ -16,8 +16,10 @@
  * Represents the return value after a "step-return".
  */
 public class JDIReturnValueVariable extends JDIPlaceholderVariable {
+	public final boolean hasResult;
 
-	public JDIReturnValueVariable(String name, IJavaValue value) {
+	public JDIReturnValueVariable(String name, IJavaValue value, boolean hasResult) {
 		super(name, value);
+		this.hasResult = hasResult;
 	}
 }
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIDebugModelMessages.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIDebugModelMessages.java
index 50e19d0..67040ba 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIDebugModelMessages.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIDebugModelMessages.java
@@ -125,6 +125,7 @@
 	public static String JDIStackFrame_Variable_information_unavailable_for_native_methods;
 	public static String JDIStackFrame_ReturnValue;
 	public static String JDIStackFrame_ExceptionThrown;
+	public static String JDIStackFrame_NoMethodReturnValue;
 
 	public static String JDIThisVariable_exception_while_retrieving_type_this;
 	public static String JDIThisVariableexception_retrieving_reference_type_name;
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIDebugModelMessages.properties b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIDebugModelMessages.properties
index a3d5bb5..3b8f5f6 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIDebugModelMessages.properties
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIDebugModelMessages.properties
@@ -93,6 +93,7 @@
 JDIStackFrame_Variable_information_unavailable_for_native_methods=Variable information unavailable for native methods
 JDIStackFrame_ReturnValue={0}() returned
 JDIStackFrame_ExceptionThrown={0}() threw
+JDIStackFrame_NoMethodReturnValue=no method return value
 
 JDIThisVariable_exception_while_retrieving_type_this={0} occurred while retrieving type ''this''.
 JDIThisVariableexception_retrieving_reference_type_name={0} occurred retrieving reference type name.
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIStackFrame.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIStackFrame.java
index c03279d..a6b8275 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIStackFrame.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIStackFrame.java
@@ -392,15 +392,17 @@
 						return;
 					}
 					String name = MessageFormat.format(JDIDebugModelMessages.JDIStackFrame_ReturnValue, stepResult.fMethod.name());
-					variables.add(0, new JDIReturnValueVariable(name, JDIValue.createValue(getJavaDebugTarget(), stepResult.fValue)));
+					variables.add(0, new JDIReturnValueVariable(name, JDIValue.createValue(getJavaDebugTarget(), stepResult.fValue), true));
 				} else {
 					if (fDepth + 1 > stepResult.fTargetFrameCount) {
 						// don't know if this really can happen, but other jvm suprises were not expected either
 						return;
 					}
 					String name = MessageFormat.format(JDIDebugModelMessages.JDIStackFrame_ExceptionThrown, stepResult.fMethod.name());
-					variables.add(0, new JDIReturnValueVariable(name, JDIValue.createValue(getJavaDebugTarget(), stepResult.fValue)));
+					variables.add(0, new JDIReturnValueVariable(name, JDIValue.createValue(getJavaDebugTarget(), stepResult.fValue), true));
 				}
+			} else if(JDIThread.showStepResultIsEnabled()) {
+				variables.add(0, new JDIReturnValueVariable(JDIDebugModelMessages.JDIStackFrame_NoMethodReturnValue, new JDIPlaceholderValue(getJavaDebugTarget(), ""), false)); //$NON-NLS-1$
 			}
 		}
 	}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIThread.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIThread.java
index a9231e9..19216a9 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIThread.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIThread.java
@@ -2618,10 +2618,6 @@
 
 		}
 
-		private boolean showStepResultIsEnabled() {
-			return Platform.getPreferencesService().getBoolean(JDIDebugPlugin.getUniqueIdentifier(), JDIDebugModel.PREF_SHOW_STEP_RESULT, true, null);
-		}
-
 		/**
 		 * Returns the kind of step this handler implements.
 		 * 
@@ -3734,5 +3730,8 @@
     protected DropToFrameHandler createDropToFrameHandler(IStackFrame stackFrame) throws DebugException {
         return new DropToFrameHandler(stackFrame);
     }
+	public static boolean showStepResultIsEnabled() {
+		return Platform.getPreferencesService().getBoolean(JDIDebugPlugin.getUniqueIdentifier(), JDIDebugModel.PREF_SHOW_STEP_RESULT, true, null);
+	}
    
 }
\ No newline at end of file
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/SocketListenConnectorProcess.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/SocketListenConnectorProcess.java
index 15f8c7f..75c539c 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/SocketListenConnectorProcess.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/SocketListenConnectorProcess.java
@@ -145,7 +145,8 @@
 	 * Return true if this connector should continue listening for further connections.
 	 */
 	protected boolean continueListening() {
-		return !isTerminated() && (fConnectionLimit <= 0 || fConnectionLimit - fAccepted > 0);
+		return !isTerminated() && (fWaitForConnectionJob != null && !fWaitForConnectionJob.fListeningStopped)
+				&& (fConnectionLimit <= 0 || fConnectionLimit - fAccepted > 0);
 	}
 
 	/**
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/AbstractVMInstallType.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/AbstractVMInstallType.java
index d475501..aba3884 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/AbstractVMInstallType.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/AbstractVMInstallType.java
@@ -98,16 +98,13 @@
 	 * @see IVMType#createVM(String)
 	 */
 	@Override
-	public IVMInstall createVMInstall(String id) throws IllegalArgumentException {
+	public synchronized IVMInstall createVMInstall(String id) throws IllegalArgumentException {
 		if (findVMInstall(id) != null) {
 			String format= LaunchingMessages.vmInstallType_duplicateVM; 
 			throw new IllegalArgumentException(NLS.bind(format, new String[] { id }));
 		}
-		IVMInstall vm = null;
-		synchronized (this) {
-			vm = doCreateVMInstall(id);
-			fVMs.add(vm);
-		}
+		IVMInstall vm = doCreateVMInstall(id);
+		fVMs.add(vm);
 		return vm;
 	}