Bug 488350 - [Tests] Cannot Connect to VM failing on Mac

Change-Id: I34ee672eee58df44a1834362cc3e630bb85972c8
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMDebugger.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMDebugger.java
index 8ed1929..3b811ab 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMDebugger.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMDebugger.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
@@ -297,6 +297,7 @@
 				}
 				subMonitor.worked(1);
 				subMonitor.subTask(LaunchingMessages.StandardVMDebugger_Establishing_debug_connection____5); 
+				int retryCount = 0;
 				boolean retry= false;
 				do  {
 					try {
@@ -367,6 +368,12 @@
 						if (result instanceof Boolean) {
 							retry = ((Boolean)result).booleanValue();
 						}
+						if (!retry && retryCount < 5) {
+							retry = true;
+							retryCount++;
+							LaunchingPlugin.log("Retrying count: " + retryCount); //$NON-NLS-1$
+
+						}
 					}
 				} while (retry);
 			} finally {