From 9bbc6bb137e23c3ceede331d193184ca766bcbc4 Mon Sep 17 00:00:00 2001 From: David McKnight Date: Mon, 7 Jul 2008 15:57:38 +0000 Subject: [PATCH] [235577] [dstore][launcher] Number 0 is accepted as valid port number --- .../rse/ui/widgets/RemoteServerLauncherForm.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/RemoteServerLauncherForm.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/RemoteServerLauncherForm.java index 408098970d8..80052989f3a 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/RemoteServerLauncherForm.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/widgets/RemoteServerLauncherForm.java @@ -13,6 +13,7 @@ * * Contributors: * Martin Oberhuber (Wind River) - [226364][api][breaking] RemoteBaseServerLauncherForm should not implement RemoteServerLauncherConstants. + * David McKnight (IBM) - [235577] [dstore][launcher] Number 0 is accepted as valid port number *******************************************************************************/ package org.eclipse.rse.ui.widgets; @@ -302,8 +303,14 @@ public class RemoteServerLauncherForm extends RemoteBaseServerLauncherForm if (launchType == ServerLaunchType.REXEC_LITERAL) { String port = getREXECPort(); + int portAsInt = Integer.parseInt(port); + msg = _rexecPortValidator.validate(port); + // for daemons we don't allow 0 + if (msg == null && portAsInt == 0) + msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_PORT_NOTVALID); + if (msg == null) { String path = getServerInstallPath(); @@ -330,8 +337,15 @@ public class RemoteServerLauncherForm extends RemoteBaseServerLauncherForm else if (launchType == ServerLaunchType.DAEMON_LITERAL) { String port = getDaemonPort(); + + int portAsInt = Integer.parseInt(port); msg = _daemonPortValidator.validate(port); + // for daemons we don't allow 0 + if (msg == null && portAsInt == 0) + msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_PORT_NOTVALID); + + if (msg == null) { _msgLine.clearErrorMessage();