cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From torehal...@apache.org
Subject svn commit: r615405 - in /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src: main/java/org/apache/cayenne/merge/AbstractToModelToken.java test/java/org/apache/cayenne/merge/CreateTableToModelTest.java
Date Fri, 25 Jan 2008 23:55:54 GMT
Author: torehalset
Date: Fri Jan 25 15:55:54 2008
New Revision: 615405

URL: http://svn.apache.org/viewvc?rev=615405&view=rev
Log:
merge: fix NPE in objEntity.getDbEntity()

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/merge/AbstractToModelToken.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/merge/CreateTableToModelTest.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/merge/AbstractToModelToken.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/merge/AbstractToModelToken.java?rev=615405&r1=615404&r2=615405&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/merge/AbstractToModelToken.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/merge/AbstractToModelToken.java
Fri Jan 25 15:55:54 2008
@@ -53,6 +53,9 @@
         Set<ObjEntity> objEntities = new HashSet<ObjEntity>();
         MappingNamespace mns = entity.getDataMap().getNamespace();
         for (ObjEntity objEntity : mns.getObjEntities()) {
+            if (objEntity.getDbEntity() == null) {
+                continue;
+            }
             if (objEntity.getDbEntity().equals(entity)) {
                 objEntities.add(objEntity);
             }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/merge/CreateTableToModelTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/merge/CreateTableToModelTest.java?rev=615405&r1=615404&r2=615405&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/merge/CreateTableToModelTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/merge/CreateTableToModelTest.java
Fri Jan 25 15:55:54 2008
@@ -60,6 +60,9 @@
 
         ObjEntity objEntity = null;
         for (ObjEntity candiate : map.getObjEntities()) {
+            if (candiate.getDbEntity() == null) {
+                continue;
+            }
             if (candiate.getDbEntity().getName().equalsIgnoreCase(dbEntity.getName())) {
                 objEntity = candiate;
                 break;



Mime
View raw message