Author: rob.stryker(a)jboss.com
Date: 2010-02-23 09:09:48 -0500 (Tue, 23 Feb 2010)
New Revision: 20433
Modified:
branches/jbosstools-3.1.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java
Log:
JBIDE-5885 - NPE check in branch
Modified:
branches/jbosstools-3.1.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java
===================================================================
---
branches/jbosstools-3.1.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java 2010-02-23
14:03:29 UTC (rev 20432)
+++
branches/jbosstools-3.1.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java 2010-02-23
14:09:48 UTC (rev 20433)
@@ -221,7 +221,6 @@
NLS.bind(Messages.CannotLocateServerHome, server.getName())));
IRuntime rt = jbs.getServer().getRuntime();
- String jrePath = null;
IJBossServerRuntime jbrt = null;
if( rt != null ) {
jbrt = (IJBossServerRuntime)rt.getAdapter(IJBossServerRuntime.class);
@@ -231,15 +230,14 @@
throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
NLS.bind(Messages.ServerRuntimeNotFound, jbs.getServer().getName())));
- IVMInstall install = jbrt.getVM();
- IPath path = JavaRuntime.newJREContainerPath(install);
- jrePath = path.toPortableString();
-
+ IVMInstall vmInstall = jbrt.getVM();
+ if( vmInstall != null )
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH,
JavaRuntime.newJREContainerPath(vmInstall).toPortableString());
+
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
getDefaultArgs(jbs));
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS,
jbrt.getDefaultRunVMArgs());
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME,
START_MAIN_TYPE);
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, serverHome +
Path.SEPARATOR + IJBossRuntimeResourceConstants.BIN);
- wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, jrePath);
wc.setAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES,
jbrt.getDefaultRunEnvVars());
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, getClasspath(jbs));
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER,
DEFAULT_CP_PROVIDER_ID);