geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r946866 - in /geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment: AbstractNamingBuilder.java EnvironmentEntryBuilder.java
Date Fri, 21 May 2010 04:05:47 GMT
Author: djencks
Date: Fri May 21 04:05:47 2010
New Revision: 946866

URL: http://svn.apache.org/viewvc?rev=946866&view=rev
Log:
GERONIMO-5330 Don't trim env-entry values

Modified:
    geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java?rev=946866&r1=946865&r2=946866&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
(original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
Fri May 21 04:05:47 2010
@@ -271,6 +271,13 @@ public abstract class AbstractNamingBuil
         return s == null ? null : s.trim();
     }
 
+    protected static String getUntrimmedStringValue(org.apache.geronimo.xbeans.javaee6.String
string) {
+        if (string == null) {
+            return null;
+        }
+        return string.getStringValue();
+    }
+
     protected static String getStringValue(XsdStringType string) {
         if (string == null) {
             return null;
@@ -278,6 +285,13 @@ public abstract class AbstractNamingBuil
         String s = string.getStringValue();
         return s == null ? null : s.trim();
     }
+    
+    protected static String getUntrimmedStringValue(XsdStringType string) {
+        if (string == null) {
+            return null;
+        }
+        return string.getStringValue();
+    }
 
     public static AbstractNameQuery buildAbstractNameQuery(GerPatternType pattern, String
type, String moduleType, Set interfaceTypes) {
         return ENCConfigBuilder.buildAbstractNameQueryFromPattern(pattern, null, type, moduleType,
interfaceTypes);

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java?rev=946866&r1=946865&r2=946866&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java
(original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java
Fri May 21 04:05:47 2010
@@ -117,7 +117,7 @@ public class EnvironmentEntryBuilder ext
             
             String strValue = envEntryMap.remove(name);
             if (strValue == null) {
-                strValue = getStringValue(envEntry.getEnvEntryValue());
+                strValue = getUntrimmedStringValue(envEntry.getEnvEntryValue());
                 if (strValue == null) {
                     String lookupName = getStringValue(envEntry.getLookupName());
                     if (lookupName != null) {
@@ -139,7 +139,12 @@ public class EnvironmentEntryBuilder ext
                         if (String.class.equals(typeClass)) {
                             value = strValue;
                         } else if (Character.class.equals(typeClass)) {
-                            value = strValue.charAt(0);
+                            if (strValue.length() == 1) {
+                                value = strValue.charAt(0);
+                            } else {
+                                log.warn("invalid character value: {} for name {}", strValue,
name );
+                                value = ' ';
+                            }
                         } else if (Boolean.class.equals(typeClass)) {
                             value = Boolean.valueOf(strValue);
                         } else if (Byte.class.equals(typeClass)) {
@@ -186,7 +191,7 @@ public class EnvironmentEntryBuilder ext
         if (refs != null) {
             for (XmlObject ref1 : refs) {
                 GerEnvEntryType ref = (GerEnvEntryType) ref1.copy().changeType(GerEnvEntryType.type);
-                envEntryMap.put(ref.getEnvEntryName().trim(), ref.getEnvEntryValue().trim());
+                envEntryMap.put(ref.getEnvEntryName().trim(), ref.getEnvEntryValue());
             }
         }
         return envEntryMap;



Mime
View raw message