cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1483472 - /cayenne/main/trunk/framework/cayenne-project/src/main/java/org/apache/cayenne/project/validation/ObjEntityValidator.java
Date Thu, 16 May 2013 17:51:35 GMT
Author: aadamchik
Date: Thu May 16 17:51:35 2013
New Revision: 1483472

URL: http://svn.apache.org/r1483472
Log:
CAY-1817  NPE during Validate Project

Modified:
    cayenne/main/trunk/framework/cayenne-project/src/main/java/org/apache/cayenne/project/validation/ObjEntityValidator.java

Modified: cayenne/main/trunk/framework/cayenne-project/src/main/java/org/apache/cayenne/project/validation/ObjEntityValidator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-project/src/main/java/org/apache/cayenne/project/validation/ObjEntityValidator.java?rev=1483472&r1=1483471&r2=1483472&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-project/src/main/java/org/apache/cayenne/project/validation/ObjEntityValidator.java
(original)
+++ cayenne/main/trunk/framework/cayenne-project/src/main/java/org/apache/cayenne/project/validation/ObjEntityValidator.java
Thu May 16 17:51:35 2013
@@ -132,17 +132,13 @@ class ObjEntityValidator extends Configu
         Set<String> dbAttributeNames = new HashSet<String>();
 
         for (ObjAttribute attribute : entity.getAttributes()) {
-            String dbAttributeName = attribute.getDbAttribute().getName();
+            String dbAttributePath = attribute.getDbAttributePath();
 
-            if (Util.isEmptyString(dbAttributeName) == false) {
-                if (dbAttributeNames.contains(dbAttributeName)) {
-                    addFailure(validationResult,
-                               entity,
-                               "ObjEntity contains duplicate DbAttribute mappings (%s)",
-                               dbAttributeName);
+            if (!Util.isEmptyString(dbAttributePath)) {
+                if (!dbAttributeNames.add(dbAttributePath)) {
+                    addFailure(validationResult, entity, "ObjEntity contains duplicate DbAttribute
mappings (%s)",
+                            dbAttributePath);
                 }
-
-                dbAttributeNames.add(dbAttributeName);
             }
         }
     }



Mime
View raw message