db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From olegn...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/otm/core ConcreteEditingContext.java
Date Wed, 10 Mar 2004 21:21:29 GMT
olegnitz    2004/03/10 13:21:29

  Modified:    src/java/org/apache/ojb/otm/core ConcreteEditingContext.java
  Log:
  Possible NPE fixed
  
  Revision  Changes    Path
  1.41      +16 -13    db-ojb/src/java/org/apache/ojb/otm/core/ConcreteEditingContext.java
  
  Index: ConcreteEditingContext.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/otm/core/ConcreteEditingContext.java,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- ConcreteEditingContext.java	5 Mar 2004 00:38:06 -0000	1.40
  +++ ConcreteEditingContext.java	10 Mar 2004 21:21:28 -0000	1.41
  @@ -1353,29 +1353,32 @@
                       {
                           Identity origOid = (Identity) it2.next();
   
  -                        if (!newList.contains(origOid))
  +                        if ((newList == null) || !newList.contains(origOid))
                           {
                               markDelete(origOid, oid, true);
                           }
                       }
                   }
   
  -                int countElem = 0;
  -                for (Iterator it2 = newList.iterator(); it2.hasNext(); countElem++)
  +                if (newList != null)
                   {
  -                    Object newOid = it2.next();
  -
  -                    if ((origList == null) || !origList.contains(newOid))
  +                    int countElem = 0;
  +                    for (Iterator it2 = newList.iterator(); it2.hasNext(); countElem++)
                       {
  -                        ContextEntry entry = (ContextEntry) _objects.get(newOid);
  +                        Object newOid = it2.next();
   
  -                        if (entry == null)
  +                        if ((origList == null) || !origList.contains(newOid))
                           {
  -                            ArrayList relCol = (ArrayList)
  -                                    newCollectionsOfObjects[count];
  -                            Object relObj = relCol.get(countElem);
  -                            markNew(newOid, relObj, null);
  -                            newObjects.add(newOid);
  +                            ContextEntry entry = (ContextEntry) _objects.get(newOid);
  +
  +                            if (entry == null)
  +                            {
  +                                ArrayList relCol = (ArrayList)
  +                                        newCollectionsOfObjects[count];
  +                                Object relObj = relCol.get(countElem);
  +                                markNew(newOid, relObj, null);
  +                                newObjects.add(newOid);
  +                            }
                           }
                       }
                   }
  
  
  

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