Bug 5791 NPE in SocketUtil
Launch Eclipse using JDK 1.4 as JRE. From the launched eclispe, launch another program in debug mode, using JDK 1.4. This produces an NPE in SocketUtil: java.lang.reflect.InvocationTargetException at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:277) at org.eclipse.jface.dialogs.ProgressMonitorDialog.run (ProgressMonitorDialog.java:335) at org.eclipse.jdt.internal.ui.launcher.JavaApplicationLauncherDelegate.doLaunch (JavaApplicationLauncherDelegate.java:181) at org.eclipse.jdt.internal.ui.launcher.JavaApplicationLauncherDelegate.launchEleme nt(JavaApplicationLauncherDelegate.java:81) at org.eclipse.jdt.internal.ui.launcher.JavaApplicationLauncherDelegate.launch (JavaApplicationLauncherDelegate.java:93) at org.eclipse.debug.internal.core.Launcher.launch(Launcher.java:104) at org.eclipse.debug.internal.ui.RelaunchActionDelegate.relaunch (RelaunchActionDelegate.java:37) at org.eclipse.debug.internal.ui.RelaunchActionDelegate.relaunch (RelaunchActionDelegate.java:46) at org.eclipse.debug.internal.ui.RelaunchHistoryLaunchAction$1.run (RelaunchHistoryLaunchAction.java:49) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:56) at org.eclipse.debug.internal.ui.RelaunchHistoryLaunchAction.run (RelaunchHistoryLaunchAction.java:47) at org.eclipse.jface.action.Action.runWithEvent(Action.java:453) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:54) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:635) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1365) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1167) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:727) at org.eclipse.ui.internal.Workbench.run(Workbench.java:710) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:820) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285) at SlimLauncher.main(SlimLauncher.java:14) Caused by: java.lang.NullPointerException at java.net.Socket.<init>(Socket.java:285) at java.net.Socket.<init>(Socket.java:121) at org.eclipse.jdt.internal.ui.launcher.SocketUtil.findUnusedLocalPort (SocketUtil.java:21) at org.eclipse.jdt.internal.ui.launcher.JDK12DebugLauncher.run (JDK12DebugLauncher.java:60) at org.eclipse.jdt.internal.ui.launcher.JavaApplicationLauncherDelegate$1.run (JavaApplicationLauncherDelegate.java:170) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run (ModalContext.java:98)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/launcher/JDK12DebugLauncher.java
IProcess process= DebugPlugin.getDefault().newProcess(p, renderProcessLabel(cmdLine));
				process.setAttribute(JavaRuntime.ATTR_CMDLINE, renderCommandLine(cmdLine));
				
				
				
				
				boolean retry= false;
				do  {
					try {
						VirtualMachine vm= connector.accept(map);
						setTimeout(vm);
						IDebugTarget debugTarget= JDIDebugModel.newDebugTarget(vm, renderDebugTarget(config.getClassToLaunch(), port), process, true, false);
						return new VMRunnerResult(debugTarget, new IProcess[] { process });
					} catch (InterruptedIOException e) {
						retry= fRetryQuery.queryRetry();
					}
				} while (retry);
			} finally {
				connector.stopListening(map);
			}
		} catch (IOException e) {
			throw new CoreException(createStatus(LauncherMessages.getString("jdkLauncher.error.connect"), e)); 
		} catch (IllegalConnectorArgumentsException e) {
			throw new CoreException(createStatus(LauncherMessages.getString("jdkLauncher.error.connect"), e)); 
		}
		if (p != null)
			p.destroy();
		return null;
	}