geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r1141232 - in /geronimo/devtools/eclipse-plugin/trunk/plugins: org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/ org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/
Date Wed, 29 Jun 2011 20:30:57 GMT
Author: gawor
Date: Wed Jun 29 20:30:56 2011
New Revision: 1141232

URL: http://svn.apache.org/viewvc?rev=1141232&view=rev
Log:
GERONIMODEVTOOLS-709: Fix NPE when changing server or JVM arguments

Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoLaunchConfigurationTabGroup.java

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java?rev=1141232&r1=1141231&r2=1141232&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java
Wed Jun 29 20:30:56 2011
@@ -751,7 +751,6 @@ abstract public class GeronimoServerDele
         return getInstanceProperty(PROPERTY_VM_ARGS);
     }
     public void setVMArgs(String value) {
-        Trace.tracePoint("Entry", Activator.traceCore, "GeronimoServerDelegate.getVMArgs",
value);
         setInstanceProperty(PROPERTY_VM_ARGS, value);
     }
 
@@ -770,7 +769,6 @@ abstract public class GeronimoServerDele
         return getInstanceProperty(PROPERTY_PROGRAM_ARGS);
     }
     public void setProgramArgs(String value) {
-        Trace.tracePoint("Entry", Activator.traceCore, "GeronimoServerDelegate.getProgramArgs",
value);
         setInstanceProperty(PROPERTY_PROGRAM_ARGS, value);
     }
     
@@ -913,12 +911,7 @@ abstract public class GeronimoServerDele
     public void setInstanceProperty(String name, String value) {
         Map map = getServerInstanceProperties();
         map.put(name, value);
-        try {
-            setServerInstanceProperties(map);
-        } catch (Exception e) {
-            // TODO WTF? Need to figure out why this fails...  seems to fail before setDefaults
is called.
-            Trace.trace(Trace.INFO, "GeronimoServerDelegate.setInstanceProperty(name = "
+ name + ", value = " + value + " )", e, Activator.traceCore);
-        }
+        setServerInstanceProperties(map);
     }
 
     public Map getServerInstanceProperties() {

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoLaunchConfigurationTabGroup.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoLaunchConfigurationTabGroup.java?rev=1141232&r1=1141231&r2=1141232&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoLaunchConfigurationTabGroup.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoLaunchConfigurationTabGroup.java
Wed Jun 29 20:30:56 2011
@@ -31,6 +31,7 @@ import org.eclipse.jdt.launching.IJavaLa
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
 import org.eclipse.wst.server.core.ServerUtil;
 import org.eclipse.wst.server.ui.ServerLaunchConfigurationTab;
 
@@ -68,17 +69,18 @@ public class GeronimoLaunchConfiguration
              super.performApply(configuration);
              
              IServer server = ServerUtil.getServer(configuration);
-             GeronimoServerDelegate sd = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class);
+             IServerWorkingCopy swc = server.createWorkingCopy();
+             GeronimoServerDelegate sd = (GeronimoServerDelegate) swc.loadAdapter(GeronimoServerDelegate.class,
null);
              
              String oldValue = sd.getProgramArgs();
              String newValue = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
oldValue);
              sd.setProgramArgs(newValue);
-             //sd.updatePropertiesFromProgramArgs(newValue);
              
              oldValue = sd.getVMArgs();
              newValue = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS,
oldValue);
              sd.setVMArgs(newValue);     
-             //sd.updatePropertiesFromVMArgs(newValue);
+             
+             swc.save(true, null);
                        
          } catch (CoreException e) {
         	  MessageDialog.openError(Display.getCurrent().getActiveShell(),"Error", e.getMessage());



Mime
View raw message