geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r568439 - /geronimo/server/trunk/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy
Date Wed, 22 Aug 2007 06:38:21 GMT
Author: jdillon
Date: Tue Aug 21 23:38:20 2007
New Revision: 568439

URL: http://svn.apache.org/viewvc?rev=568439&view=rev
Log:
Use shared addProperty closure

Modified:
    geronimo/server/trunk/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy

Modified: geronimo/server/trunk/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy?rev=568439&r1=568438&r2=568439&view=diff
==============================================================================
--- geronimo/server/trunk/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy
(original)
+++ geronimo/server/trunk/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy
Tue Aug 21 23:38:20 2007
@@ -200,25 +200,29 @@
             javaAgent = line.getOptionValue('H')
         }
         
-        if (line.hasOption('D')) {
-            def values = line.getOptionValues('D')
+        def addProperty = { namevalue, prefix ->
+            def name, value
+            int i = namevalue.indexOf('=')
             
-            def addProperty = { namevalue ->
-                def name, value
-                int i = namevalue.indexOf('=')
-                
-                if (i == -1) {
-                    name = namevalue
-                    value = true
-                }
-                else {
-                    name = namevalue.substring(0, i)
-                    value = namevalue.substring(i + 1, namevalue.size())
-                }
-                name = name.trim()
-                
-                properties[name] = value
+            if (i == -1) {
+                name = namevalue
+                value = true
             }
+            else {
+                name = namevalue.substring(0, i)
+                value = namevalue.substring(i + 1, namevalue.size())
+            }
+            name = name.trim()
+            
+            if (prefix) {
+                name = "${prefix}.$name"
+            }
+            
+            properties[name] = value
+        }
+        
+        if (line.hasOption('D')) {
+            def values = line.getOptionValues('D')
             
             values.each {
                 addProperty(it)
@@ -228,25 +232,8 @@
         if (line.hasOption('G')) {
             def values = line.getOptionValues('G')
             
-            def addProperty = { namevalue ->
-                def name, value
-                int i = namevalue.indexOf('=')
-                
-                if (i == -1) {
-                    name = namevalue
-                    value = true
-                }
-                else {
-                    name = namevalue.substring(0, i)
-                    value = namevalue.substring(i + 1, namevalue.size())
-                }
-                name = name.trim()
-                
-                properties["org.apache.geronimo.$name"] = value
-            }
-            
             values.each {
-                addProperty(it)
+                addProperty(it, 'org.apache.geronimo')
             }
         }
         



Mime
View raw message