Author: adietish
Date: 2011-07-11 09:03:16 -0400 (Mon, 11 Jul 2011)
New Revision: 32815
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/LaunchConfigUtils.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBoss7StartLaunchDelegate.java
Log:
[JBIDE-9215] extracted method to util class
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/LaunchConfigUtils.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/LaunchConfigUtils.java 2011-07-11
13:00:35 UTC (rev 32814)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/LaunchConfigUtils.java 2011-07-11
13:03:16 UTC (rev 32815)
@@ -12,6 +12,7 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
@@ -23,6 +24,7 @@
import org.jboss.ide.eclipse.as.core.Messages;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.core.server.internal.launch.RunJarContainerWrapper;
+import
org.jboss.ide.eclipse.as.core.server.internal.launch.configuration.JBossLaunchConfigProperties;
/**
* @author André Dietisheim
@@ -85,6 +87,20 @@
return list;
}
+ public static String classpathUserClassesToString(ILaunchConfiguration config) throws
CoreException {
+ StringBuilder builder = new StringBuilder();
+ List<String> classpath = JBossLaunchConfigProperties.getClasspath(config);
+ for(String entry : classpath) {
+ IRuntimeClasspathEntry runtimeEntry = JavaRuntime.newRuntimeClasspathEntry(entry);
+ int classpathProperty = runtimeEntry.getClasspathProperty();
+ if (classpathProperty == IRuntimeClasspathEntry.USER_CLASSES) {
+ builder.append(runtimeEntry.getLocation());
+ builder.append(IJBossRuntimeConstants.SPACE);
+ }
+ }
+ return builder.toString();
+ }
+
public static IRuntimeClasspathEntry getRunJarRuntimeCPEntry(IServer server) throws
CoreException {
// TODO: improve/avoid server version check
// if (server.getServerType().getId().endsWith("70")) { //$NON-NLS-1$
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBoss7StartLaunchDelegate.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBoss7StartLaunchDelegate.java 2011-07-11
13:00:35 UTC (rev 32814)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBoss7StartLaunchDelegate.java 2011-07-11
13:03:16 UTC (rev 32815)
@@ -33,6 +33,7 @@
import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants;
import org.jboss.ide.eclipse.as.core.util.JBossServerBehaviorUtils;
import org.jboss.ide.eclipse.as.core.util.LaunchCommandPreferences;
+import org.jboss.ide.eclipse.as.core.util.LaunchConfigUtils;
import org.jboss.ide.eclipse.as.core.util.PollThreadUtils;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
@@ -109,7 +110,7 @@
String rseHome = RSEUtils.getRSEHomeDir(jbossServer.getServer());
String currentArgs =
config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
""); //$NON-NLS-1$
String currentVMArgs =
config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, "");
//$NON-NLS-1$
- String jarArg = getJarArg(config);
+ String jarArg = LaunchConfigUtils.classpathUserClassesToString(config);
String cmd = "java "
+ currentVMArgs
@@ -121,17 +122,4 @@
+ "&";
return cmd;
}
-
- private String getJarArg(ILaunchConfiguration config) throws CoreException {
- StringBuilder builder = new StringBuilder();
- List<String> classpath = JBossLaunchConfigProperties.getClasspath(config);
- for(String entry : classpath) {
- IRuntimeClasspathEntry runtimeEntry = JavaRuntime.newRuntimeClasspathEntry(entry);
- int classpathProperty = runtimeEntry.getClasspathProperty();
- if (classpathProperty == IRuntimeClasspathEntry.USER_CLASSES) {
- builder.append(runtimeEntry.getLocation());
- }
- }
- return builder.toString();
- }
}
Show replies by date