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/broker/metadata/fieldaccess PersistentFieldDirectAccessImpl.java
Date Mon, 05 Jan 2004 02:20:58 GMT
arminw      2004/01/04 18:20:58

  Modified:    src/java/org/apache/ojb/broker/metadata/fieldaccess
                        PersistentFieldDirectAccessImpl.java
  Log:
  fix, avoid NullpointerException
  
  Revision  Changes    Path
  1.6       +6 -3      db-ojb/src/java/org/apache/ojb/broker/metadata/fieldaccess/PersistentFieldDirectAccessImpl.java
  
  Index: PersistentFieldDirectAccessImpl.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/metadata/fieldaccess/PersistentFieldDirectAccessImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PersistentFieldDirectAccessImpl.java	20 Aug 2003 19:40:13 -0000	1.5
  +++ PersistentFieldDirectAccessImpl.java	5 Jan 2004 02:20:58 -0000	1.6
  @@ -138,6 +138,7 @@
        */
       public Object doGet(Object obj) throws MetadataException
       {
  +        if(obj == null) return null;
           Field fld = getField();
           try
           {
  @@ -148,12 +149,14 @@
           {
               throw new MetadataException(
                       "IllegalAccess error getting field:" +
  -                    (fld != null ? fld.getName() : null) + " in object:" + obj.getClass().getName(),
e);
  +                    (fld != null ? fld.getName() : null) + " in object:"
  +                    + obj != null ? obj.getClass().getName() : null, e);
           }
           catch (Throwable e)
           {
               throw new MetadataException("Error getting field:" +
  -                    (fld != null ? fld.getName() : null) + " in object:" + obj.getClass().getName(),
e);
  +                    (fld != null ? fld.getName() : null) + " in object:" +
  +                    (obj != null ? obj.getClass().getName() : null) , e);
           }
       }
   
  
  
  

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