Scarab commit: svn commit: r10446 - trunk/src/java/org/tigris/scarab/om/GlobalParameterManager.java

[email protected]
Newsgroups gmane.comp.java.scarab.cvs
Message-ID <[email protected]>
Author: ronvoe122
Date: 2007-06-10 06:39:30-0700
New Revision: 10446

Modified:
   trunk/src/java/org/tigris/scarab/om/GlobalParameterManager.java

Log:
Accept "t" and "true" as values for boolean parameters.
(because in the parameter table "t" is used and in property files "true")

Modified: trunk/src/java/org/tigris/scarab/om/GlobalParameterManager.java
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/java/org/tigris/scarab/om/GlobalParameterManager.java?view=diff&rev=10446&p1=trunk/src/java/org/tigris/scarab/om/GlobalParameterManager.java&p2=trunk/src/java/org/tigris/scarab/om/GlobalParameterManager.java&r1=10445&r2=10446
==============================================================================
--- trunk/src/java/org/tigris/scarab/om/GlobalParameterManager.java	(original)
+++ trunk/src/java/org/tigris/scarab/om/GlobalParameterManager.java	2007-06-10 06:39:30-0700
@@ -83,6 +83,13 @@
         setRegion(getClassName().replace('.', '_'));
     }
 
+    private static boolean toBoolean(String booleanValue)
+    {
+    	return(
+    	       booleanValue.equalsIgnoreCase("T") 
+    	    || booleanValue.equalsIgnoreCase("TRUE")
+        );
+    }
     protected Persistent putInstanceImpl(Persistent om)
         throws TorqueException
     {
@@ -284,7 +291,7 @@
     public static boolean getBoolean(String name)
         throws TorqueException
     {
-        return "T".equals(getString(name));
+        return toBoolean(getString(name));
     }
 
     /**
@@ -298,7 +305,7 @@
     public static boolean getBoolean(String name, Module module)
         throws TorqueException
     {
-        return "T".equals(getString(name, module));
+        return toBoolean(getString(name, module));
     }
 
     /**
@@ -316,7 +323,7 @@
         throws TorqueException
     {
         String defAsString = (def)? "T":"F";
-        return "T".equals(getStringFromHierarchy(name, module, defAsString ));
+        return toBoolean(getStringFromHierarchy(name, module, defAsString ));
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.