Author: torehalset
Date: Wed Nov 29 15:49:57 2006
New Revision: 480772

URL: http://svn.apache.org/viewvc?view=rev&rev=480772
Log:
CAY-641: Stack trace instead of error message when relationship and attribute 
have the same name
display "bla bla 'attrname'" instead of "bla bla 'attrname"

Modified:
    
incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/map/Entity.java

Modified: 
incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/map/Entity.java
URL: 
http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/map/Entity.java?view=diff&rev=480772&r1=480771&r2=480772
==============================================================================
--- 
incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/map/Entity.java
 (original)
+++ 
incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/map/Entity.java
 Wed Nov 29 15:49:57 2006
@@ -131,7 +131,8 @@
             }
             else {
                 throw new IllegalArgumentException("An attempt to override 
attribute '"
-                        + attribute.getName());
+                        + attribute.getName()
+                        + "'");
             }
         }
         
@@ -139,7 +140,9 @@
         Object existingRelationship = relationships.get(attribute.getName());
         if (existingRelationship != null) {            
             throw new IllegalArgumentException(
-                   "Attribute name conflict with existing relationship '" + 
attribute.getName());
+                    "Attribute name conflict with existing relationship '"
+                            + attribute.getName()
+                            + "'");
         }
 
         attributes.put(attribute.getName(), attribute);
@@ -180,15 +183,19 @@
             }
             else {
                 throw new IllegalArgumentException(
-                        "An attempt to override relationship '" + 
relationship.getName());
+                        "An attempt to override relationship '"
+                                + relationship.getName()
+                                + "'");
             }
         }
         
         // Check that there aren't any attributes with the same name as the 
given relationship.
         Object existingAttribute = attributes.get(relationship.getName());
         if (existingAttribute != null) {
-            throw new IllegalArgumentException("Relationship name conflict 
with existing attribute '"
-                    + relationship.getName());
+            throw new IllegalArgumentException(
+                    "Relationship name conflict with existing attribute '"
+                            + relationship.getName()
+                            + "'");
         }
 
         relationships.put(relationship.getName(), relationship);


Reply via email to