db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/jdo PersistenceManagerFactoryImpl.java
Date Tue, 07 Jun 2005 17:27:05 GMT
arminw      2005/06/07 10:27:05

  Modified:    src/java/org/apache/ojb/broker/util/logging Tag:
                        OJB_1_0_RELEASE LoggerWrapperPrintWriter.java
               src/java/org/apache/ojb/broker/util/pooling Tag:
                        OJB_1_0_RELEASE PoolConfiguration.java
               src/java/org/apache/ojb/jdo Tag: OJB_1_0_RELEASE
                        PersistenceManagerFactoryImpl.java
  Log:
  fix JDK 1.3 compatibility problem, replace use of Boolean.toString(...) with apache's commons-lang
BooleanUtils.toStringTrueFalse(...)
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.1.2.2   +5 -3      db-ojb/src/java/org/apache/ojb/broker/util/logging/Attic/LoggerWrapperPrintWriter.java
  
  Index: LoggerWrapperPrintWriter.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/util/logging/Attic/LoggerWrapperPrintWriter.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- LoggerWrapperPrintWriter.java	30 Apr 2005 20:55:15 -0000	1.1.2.1
  +++ LoggerWrapperPrintWriter.java	7 Jun 2005 17:27:05 -0000	1.1.2.2
  @@ -2,6 +2,8 @@
   
   import java.io.PrintWriter;
   
  +import org.apache.commons.lang.BooleanUtils;
  +
   /**
    * Extremely simple piggyback for OJB Logger interface to provide PrintWriter dito.
    *
  @@ -170,7 +172,7 @@
       {
           if (!filterEverything)
           {
  -            log(Boolean.toString(b));
  +            log(BooleanUtils.toStringTrueFalse(b));
           }
       }
   
  @@ -178,7 +180,7 @@
       {
           if (!filterEverything)
           {
  -            logLn(Boolean.toString(b));
  +            logLn(BooleanUtils.toStringTrueFalse(b));
           }
       }
   
  
  
  
  No                   revision
  No                   revision
  1.11.2.4  +7 -6      db-ojb/src/java/org/apache/ojb/broker/util/pooling/PoolConfiguration.java
  
  Index: PoolConfiguration.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/util/pooling/PoolConfiguration.java,v
  retrieving revision 1.11.2.3
  retrieving revision 1.11.2.4
  diff -u -r1.11.2.3 -r1.11.2.4
  --- PoolConfiguration.java	30 Apr 2005 20:55:15 -0000	1.11.2.3
  +++ PoolConfiguration.java	7 Jun 2005 17:27:05 -0000	1.11.2.4
  @@ -22,6 +22,7 @@
   import org.apache.commons.pool.impl.GenericKeyedObjectPool;
   import org.apache.commons.pool.impl.GenericObjectPool;
   import org.apache.commons.lang.StringUtils;
  +import org.apache.commons.lang.BooleanUtils;
   import org.apache.ojb.broker.metadata.AttributeContainer;
   
   /**
  @@ -174,7 +175,7 @@
   
       public void setLogAbandoned(boolean logAbandoned)
       {
  -        this.setProperty(LOG_ABANDONED, Boolean.toString(logAbandoned));
  +        this.setProperty(LOG_ABANDONED, BooleanUtils.toStringTrueFalse(logAbandoned));
       }
   
       public boolean isRemoveAbandoned()
  @@ -184,7 +185,7 @@
   
       public void setRemoveAbandoned(boolean removeAbandoned)
       {
  -        this.setProperty(REMOVE_ABANDONED, Boolean.toString(removeAbandoned));
  +        this.setProperty(REMOVE_ABANDONED, BooleanUtils.toStringTrueFalse(removeAbandoned));
       }
   
       public int getRemoveAbandonedTimeout()
  @@ -267,7 +268,7 @@
   
       public void setTestOnBorrow(boolean testOnBorrow)
       {
  -        this.setProperty(TEST_ON_BORROW, Boolean.toString(testOnBorrow));
  +        this.setProperty(TEST_ON_BORROW, BooleanUtils.toStringTrueFalse(testOnBorrow));
       }
   
   
  @@ -278,7 +279,7 @@
   
       public void setTestOnReturn(boolean testOnReturn)
       {
  -        this.setProperty(TEST_ON_RETURN, Boolean.toString(testOnReturn));
  +        this.setProperty(TEST_ON_RETURN, BooleanUtils.toStringTrueFalse(testOnReturn));
       }
   
   
  @@ -289,7 +290,7 @@
   
       public void setTestWhileIdle(boolean testWhileIdle)
       {
  -        this.setProperty(TEST_WHILE_IDLE, Boolean.toString(testWhileIdle));
  +        this.setProperty(TEST_WHILE_IDLE, BooleanUtils.toStringTrueFalse(testWhileIdle));
       }
   
   
  
  
  
  No                   revision
  No                   revision
  1.5.2.1   +10 -19    db-ojb/src/java/org/apache/ojb/jdo/PersistenceManagerFactoryImpl.java
  
  Index: PersistenceManagerFactoryImpl.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/jdo/PersistenceManagerFactoryImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.5.2.1
  diff -u -r1.5 -r1.5.2.1
  --- PersistenceManagerFactoryImpl.java	4 Apr 2004 23:53:38 -0000	1.5
  +++ PersistenceManagerFactoryImpl.java	7 Jun 2005 17:27:05 -0000	1.5.2.1
  @@ -22,6 +22,8 @@
   import java.util.Collections;
   import java.util.Properties;
   
  +import org.apache.commons.lang.BooleanUtils;
  +
   /**
    * @author <a href="mailto:mattbaird@yahoo.com">Matthew Baird</a>
    */
  @@ -130,25 +132,14 @@
   		PersistenceManagerFactoryImpl retval = new PersistenceManagerFactoryImpl();
   		// parse and set the properties
   		// boolean props
  -//#ifdef JDBC30
  -		retval.setOptimistic(Boolean.getBoolean(props.getProperty(JDOConstants.OPTIMISTIC, Boolean.toString(retval.getOptimistic()))));
  -		retval.setRetainValues(Boolean.getBoolean(props.getProperty(JDOConstants.RETAIN_VALUES,
Boolean.toString(retval.getRetainValues()))));
  -		retval.setRestoreValues(Boolean.getBoolean(props.getProperty(JDOConstants.RESTORE_VALUES,
Boolean.toString(retval.getRestoreValues()))));
  -		retval.setIgnoreCache(Boolean.getBoolean(props.getProperty(JDOConstants.IGNORE_CACHE,
Boolean.toString(retval.getIgnoreCache()))));
  -		retval.setNontransactionalRead(Boolean.getBoolean(props.getProperty(JDOConstants.NON_TRANSACTIONAL_READ,
Boolean.toString(retval.getNontransactionalRead()))));
  -		retval.setMultithreaded(Boolean.getBoolean(props.getProperty(JDOConstants.MULTI_THREADED,
Boolean.toString(retval.getMultithreaded()))));
  -		retval.setOptimistic(Boolean.getBoolean(props.getProperty(JDOConstants.OPTIMISTIC, Boolean.toString(retval.getOptimistic()))));
  -		retval.setOptimistic(Boolean.getBoolean(props.getProperty(JDOConstants.OPTIMISTIC, Boolean.toString(retval.getOptimistic()))));
  -//#else
  -		retval.setOptimistic(Boolean.getBoolean(props.getProperty(JDOConstants.OPTIMISTIC, (retval.getOptimistic()
? "true" : "false")))); 
  -		retval.setRetainValues(Boolean.getBoolean(props.getProperty(JDOConstants.RETAIN_VALUES,
(retval.getRetainValues() ? "true" : "false")))); 
  -		retval.setRestoreValues(Boolean.getBoolean(props.getProperty(JDOConstants.RESTORE_VALUES,
(retval.getRestoreValues() ? "true" : "false")))); 
  -		retval.setIgnoreCache(Boolean.getBoolean(props.getProperty(JDOConstants.IGNORE_CACHE,
(retval.getIgnoreCache() ? "true" : "false")))); 
  -		retval.setNontransactionalRead(Boolean.getBoolean(props.getProperty(JDOConstants.NON_TRANSACTIONAL_READ,
(retval.getNontransactionalRead() ? "true" : "false"))));
  -		retval.setMultithreaded(Boolean.getBoolean(props.getProperty(JDOConstants.MULTI_THREADED,
(retval.getMultithreaded() ? "true" : "false"))));
  -		retval.setOptimistic(Boolean.getBoolean(props.getProperty(JDOConstants.OPTIMISTIC, (retval.getOptimistic()
? "true" : "false"))));
  -		retval.setOptimistic(Boolean.getBoolean(props.getProperty(JDOConstants.OPTIMISTIC, (retval.getOptimistic()
? "true" : "false"))));
  -//#endif
  +		retval.setOptimistic(Boolean.getBoolean(props.getProperty(JDOConstants.OPTIMISTIC, BooleanUtils.toStringTrueFalse(retval.getOptimistic()))));
  +		retval.setRetainValues(Boolean.getBoolean(props.getProperty(JDOConstants.RETAIN_VALUES,
BooleanUtils.toStringTrueFalse(retval.getRetainValues()))));
  +		retval.setRestoreValues(Boolean.getBoolean(props.getProperty(JDOConstants.RESTORE_VALUES,
BooleanUtils.toStringTrueFalse(retval.getRestoreValues()))));
  +		retval.setIgnoreCache(Boolean.getBoolean(props.getProperty(JDOConstants.IGNORE_CACHE,
BooleanUtils.toStringTrueFalse(retval.getIgnoreCache()))));
  +		retval.setNontransactionalRead(Boolean.getBoolean(props.getProperty(JDOConstants.NON_TRANSACTIONAL_READ,
BooleanUtils.toStringTrueFalse(retval.getNontransactionalRead()))));
  +		retval.setMultithreaded(Boolean.getBoolean(props.getProperty(JDOConstants.MULTI_THREADED,
BooleanUtils.toStringTrueFalse(retval.getMultithreaded()))));
  +		retval.setOptimistic(Boolean.getBoolean(props.getProperty(JDOConstants.OPTIMISTIC, BooleanUtils.toStringTrueFalse(retval.getOptimistic()))));
  +		retval.setOptimistic(Boolean.getBoolean(props.getProperty(JDOConstants.OPTIMISTIC, BooleanUtils.toStringTrueFalse(retval.getOptimistic()))));
   
   		// string props
   		retval.setConnectionUserName(props.getProperty(JDOConstants.CONNECTION_USER_NAME, retval.getConnectionUserName()));
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message