db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/odmg ImplementationImpl.java
Date Sat, 25 Sep 2004 14:26:17 GMT
brj         2004/09/25 07:26:17

  Modified:    src/java/org/apache/ojb/broker/core MtoNBroker.java
               src/java/org/apache/ojb/broker/util ArrayIterator.java
               src/java/org/apache/ojb/broker PBStateEvent.java PBKey.java
                        PBLifeCycleEvent.java
               src/java/org/apache/ojb/broker/query Criteria.java
                        UserAlias.java
               src/java/org/apache/ojb/broker/metadata ClassDescriptor.java
               src/java/org/apache/ojb/odmg ImplementationImpl.java
  Log:
  minor refactorings/corrections based on findbugs.0.8.4
  
  Revision  Changes    Path
  1.13      +5 -8      db-ojb/src/java/org/apache/ojb/broker/core/MtoNBroker.java
  
  Index: MtoNBroker.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/core/MtoNBroker.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- MtoNBroker.java	21 Sep 2004 00:30:42 -0000	1.12
  +++ MtoNBroker.java	25 Sep 2004 14:26:16 -0000	1.13
  @@ -415,7 +415,7 @@
       // ************************************************************************
       // inner class
       // ************************************************************************
  -    final class GenericObject implements Serializable
  +    private static final class GenericObject
       {
           private String tablename;
           private String[] columnNames;
  @@ -442,10 +442,11 @@
               if(obj instanceof GenericObject)
               {
                   GenericObject other = (GenericObject) obj;
  -                if(result = (tablename.equalsIgnoreCase(other.tablename)
  +                result = (tablename.equalsIgnoreCase(other.tablename)
                           && (columnNames != null)
                           && (other.columnNames != null)
  -                        && (columnNames.length == other.columnNames.length)))
  +                        && (columnNames.length == other.columnNames.length));
  +                if(result)
                   {
                       for (int i = 0; i < columnNames.length; i++)
                       {
  @@ -459,10 +460,6 @@
                           result = result && values[i].equals(other.values[otherIndex]);
                           if(!result) break;
                       }
  -    //                if(result)
  -    //                {
  -    //                    System.out.println("## Match: " + this);
  -    //                }
                   }
               }
               return result;
  
  
  
  1.7       +2 -2      db-ojb/src/java/org/apache/ojb/broker/util/ArrayIterator.java
  
  Index: ArrayIterator.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/util/ArrayIterator.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ArrayIterator.java	4 Apr 2004 23:53:36 -0000	1.6
  +++ ArrayIterator.java	25 Sep 2004 14:26:16 -0000	1.7
  @@ -67,7 +67,7 @@
        *
        * @return <tt>true</tt> if the iterator has more elements.
        */
  -    public boolean hasNext()
  +    public synchronized boolean hasNext()
       {
           return (position < length);
       }
  
  
  
  1.6       +4 -2      db-ojb/src/java/org/apache/ojb/broker/PBStateEvent.java
  
  Index: PBStateEvent.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/PBStateEvent.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PBStateEvent.java	4 Apr 2004 23:53:30 -0000	1.5
  +++ PBStateEvent.java	25 Sep 2004 14:26:17 -0000	1.6
  @@ -15,6 +15,8 @@
    * limitations under the License.
    */
   
  +import java.io.Serializable;
  +
   import org.apache.commons.lang.builder.ToStringBuilder;
   
   
  @@ -61,7 +63,7 @@
       //**********************************************************************
       // Immutable inner class
       //**********************************************************************
  -    public static class Type
  +    public static class Type implements Serializable
       {
           /**
            * Caused after a <code>PersistenceBroker transaction</code> was started.
  
  
  
  1.14      +2 -2      db-ojb/src/java/org/apache/ojb/broker/PBKey.java
  
  Index: PBKey.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/PBKey.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- PBKey.java	11 Aug 2004 00:41:49 -0000	1.13
  +++ PBKey.java	25 Sep 2004 14:26:17 -0000	1.14
  @@ -72,7 +72,7 @@
       /**
        * Returns an 'deep' copy of this key.
        */
  -    protected Object clone() throws CloneNotSupportedException
  +    public Object clone() throws CloneNotSupportedException
       {
           return new PBKey(this.jcdAlias, this.user, this.password);
       }
  
  
  
  1.6       +4 -2      db-ojb/src/java/org/apache/ojb/broker/PBLifeCycleEvent.java
  
  Index: PBLifeCycleEvent.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/PBLifeCycleEvent.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PBLifeCycleEvent.java	4 Apr 2004 23:53:30 -0000	1.5
  +++ PBLifeCycleEvent.java	25 Sep 2004 14:26:17 -0000	1.6
  @@ -15,6 +15,8 @@
    * limitations under the License.
    */
   
  +import java.io.Serializable;
  +
   import org.apache.commons.lang.builder.ToStringBuilder;
   import org.apache.commons.lang.builder.ToStringStyle;
   
  @@ -102,7 +104,7 @@
       //**********************************************************************
       // Immutable inner class
       //**********************************************************************
  -    public static class Type
  +    public static class Type implements Serializable
       {
           public static final Type BEFORE_INSERT = new Type(TYPE_BEFORE_INSERT);
           public static final Type BEFORE_UPDATE = new Type(TYPE_BEFORE_UPDATE);
  
  
  
  1.52      +2 -2      db-ojb/src/java/org/apache/ojb/broker/query/Criteria.java
  
  Index: Criteria.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/query/Criteria.java,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- Criteria.java	24 Sep 2004 19:36:13 -0000	1.51
  +++ Criteria.java	25 Sep 2004 14:26:17 -0000	1.52
  @@ -1311,7 +1311,7 @@
        * 
        * @author <a href="mailto:jbraeuchi@gmx.ch">Jakob Braeuchi</a>
        */
  -    private static class ImplicitUserAlias extends UserAlias
  +    private static final class ImplicitUserAlias extends UserAlias
       {
           private String m_aliasedPath;
           private List m_tokenizedAliasedPath;
  
  
  
  1.4       +3 -8      db-ojb/src/java/org/apache/ojb/broker/query/UserAlias.java
  
  Index: UserAlias.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/query/UserAlias.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- UserAlias.java	24 Sep 2004 19:36:13 -0000	1.3
  +++ UserAlias.java	25 Sep 2004 14:26:17 -0000	1.4
  @@ -15,14 +15,10 @@
    * limitations under the License.
    */
   
  -import java.util.HashMap;
  +import java.io.Serializable;
   import java.util.HashSet;
  -import java.util.Map;
   import java.util.Set;
   
  -import org.apache.ojb.broker.util.logging.Logger;
  -import org.apache.ojb.broker.util.logging.LoggerFactory;
  -
   /**
    * This class is used to specify the path segments of a Criteria
    * that should have associated table aliases.  Previously, the default
  @@ -30,13 +26,12 @@
    * 
    * @author <a href="mailto:philip.warrick@mcgill.ca">Phil Warrick</a> 
    */
  -public class UserAlias
  +public class UserAlias implements Serializable
   {
       private Set m_pathSegments = new HashSet();
       private String m_name = null;
       private boolean m_allPathsAliased = true;
  -    private Logger m_logger = LoggerFactory.getLogger(UserAlias.class);
  -
  + 
       /**
        * Constructor declaration
        *
  
  
  
  1.93      +6 -6      db-ojb/src/java/org/apache/ojb/broker/metadata/ClassDescriptor.java
  
  Index: ClassDescriptor.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/metadata/ClassDescriptor.java,v
  retrieving revision 1.92
  retrieving revision 1.93
  diff -u -r1.92 -r1.93
  --- ClassDescriptor.java	14 Sep 2004 16:17:41 -0000	1.92
  +++ ClassDescriptor.java	25 Sep 2004 14:26:17 -0000	1.93
  @@ -1516,7 +1516,7 @@
       /**
        * sets the initialization method for this descriptor
        */
  -    private void setInitializationMethod(Method newMethod)
  +    private synchronized void setInitializationMethod(Method newMethod)
       {
           if (newMethod != null)
           {
  @@ -1542,7 +1542,7 @@
       /**
        * sets the initialization method for this descriptor by name
        */
  -    public void setInitializationMethod(String newMethodName)
  +    public synchronized void setInitializationMethod(String newMethodName)
       {
           Method newMethod = null;
           if (newMethodName != null)
  @@ -1643,7 +1643,7 @@
        * descriptor.
        * @see #setFactoryMethod
        */
  -    public void setFactoryClass(Class newClass)
  +    public synchronized void setFactoryClass(Class newClass)
       {
           this.factoryClass = newClass;
       }
  @@ -1677,7 +1677,7 @@
        * represented by this descriptor.
        * @see #setFactoryClass
        */
  -    private void setFactoryMethod(Method newMethod)
  +    private synchronized void setFactoryMethod(Method newMethod)
       {
           if (newMethod != null)
           {
  @@ -1704,7 +1704,7 @@
       /**
        * sets the initialization method for this descriptor by name
        */
  -    public void setFactoryMethod(String factoryMethodName)
  +    public synchronized void setFactoryMethod(String factoryMethodName)
       {
           Method newMethod = null;
           this.factoryMethodName = factoryMethodName;
  
  
  
  1.3       +2 -2      db-ojb/src/java/org/apache/ojb/odmg/ImplementationImpl.java
  
  Index: ImplementationImpl.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/odmg/ImplementationImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ImplementationImpl.java	14 Aug 2004 23:48:12 -0000	1.2
  +++ ImplementationImpl.java	25 Sep 2004 14:26:17 -0000	1.3
  @@ -78,7 +78,7 @@
           currentDatabase = curDB;
       }
   
  -    public DatabaseImpl getCurrentDatabase()
  +    public synchronized DatabaseImpl getCurrentDatabase()
       {
           return currentDatabase;
       }
  
  
  

---------------------------------------------------------------------
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