myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r1004666 - /myfaces/trinidad/branches/trinidad-1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/ConfigParser.java
Date Tue, 05 Oct 2010 15:11:11 GMT
Author: matzew
Date: Tue Oct  5 15:11:11 2010
New Revision: 1004666

URL: http://svn.apache.org/viewvc?rev=1004666&view=rev
Log:
TRINIDAD-1934

Modified:
    myfaces/trinidad/branches/trinidad-1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/ConfigParser.java

Modified: myfaces/trinidad/branches/trinidad-1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/ConfigParser.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/trinidad-1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/ConfigParser.java?rev=1004666&r1=1004665&r2=1004666&view=diff
==============================================================================
--- myfaces/trinidad/branches/trinidad-1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/ConfigParser.java
(original)
+++ myfaces/trinidad/branches/trinidad-1.2.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/ConfigParser.java
Tue Oct  5 15:11:11 2010
@@ -267,6 +267,10 @@ public class ConfigParser
             {
               value = _getIntegerValue(currentText, qName);
             }
+            else if (key.getType() == Long.class)
+            {
+              value = _getLongValue(currentText, qName);
+            }
             else if (key.getType() == Boolean.class)
             {
               value = ("true".equalsIgnoreCase(currentText)
@@ -347,6 +351,23 @@ public class ConfigParser
       return value;
     }
 
+    private static Long _getLongValue(String text, String qName)
+    {
+      Long value = null;
+      try
+      {
+        value = Long.valueOf(text);
+      }
+      catch (NumberFormatException nfe)
+      {
+        if (_LOG.isWarning())
+        {
+          _LOG.warning("ELEMENT_ONLY_ACCEPT_INTEGER", qName);
+        }
+      }
+      return value;
+    }
+
     // Parses the text into an AccessibilityProfile.
     private static AccessibilityProfile _getAccessibilityProfile(
       String text)



Mime
View raw message