cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r775630 - /cayenne/main/trunk/framework/cayenne-tools/src/main/java/org/apache/cayenne/gen/ClientDataMapArtifact.java
Date Sun, 17 May 2009 11:56:16 GMT
Author: aadamchik
Date: Sun May 17 11:56:16 2009
New Revision: 775630

URL: http://svn.apache.org/viewvc?rev=775630&view=rev
Log:
fixing NPE on class generation that I believe got introduced recently
... client class generation can still result in garbage under certain circumstances (when
entities are
not setup for client use)... going forward we may need to do more sanity checking here

Modified:
    cayenne/main/trunk/framework/cayenne-tools/src/main/java/org/apache/cayenne/gen/ClientDataMapArtifact.java

Modified: cayenne/main/trunk/framework/cayenne-tools/src/main/java/org/apache/cayenne/gen/ClientDataMapArtifact.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-tools/src/main/java/org/apache/cayenne/gen/ClientDataMapArtifact.java?rev=775630&r1=775629&r2=775630&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-tools/src/main/java/org/apache/cayenne/gen/ClientDataMapArtifact.java
(original)
+++ cayenne/main/trunk/framework/cayenne-tools/src/main/java/org/apache/cayenne/gen/ClientDataMapArtifact.java
Sun May 17 11:56:16 2009
@@ -22,29 +22,32 @@
 import java.util.Collection;
 
 import org.apache.cayenne.map.DataMap;
-import org.apache.cayenne.query.ProcedureQuery;
 import org.apache.cayenne.query.Query;
 import org.apache.cayenne.util.NameConverter;
+import org.apache.cayenne.util.Util;
 
-public class ClientDataMapArtifact extends DataMapArtifact{
+public class ClientDataMapArtifact extends DataMapArtifact {
 
     public ClientDataMapArtifact(DataMap dataMap, Collection<Query> queries) {
         super(dataMap, queries);
-        
+
     }
-    
+
     @Override
-    public String getQualifiedBaseClassName(){
+    public String getQualifiedBaseClassName() {
 
         return dataMap.getDefaultClientSuperclass();
-    } 
-    
+    }
+
     @Override
     public String getQualifiedClassName() {
         String clientPrefix = "";
-        if(dataMap.getDefaultClientPackage().equals(dataMap.getDefaultPackage())){
+
+        if (Util.nullSafeEquals(dataMap.getDefaultClientPackage(), dataMap
+                .getDefaultPackage())) {
             clientPrefix = "Client_";
         }
+
         String pkg = dataMap.getDefaultClientPackage();
         if (pkg == null) {
             pkg = "";
@@ -54,7 +57,7 @@
         }
 
         return pkg
-            + NameConverter.underscoredToJava(clientPrefix + NameConverter
-                        .specialCharsToJava(dataMap.getName()), true);
+                + NameConverter.underscoredToJava(clientPrefix
+                        + NameConverter.specialCharsToJava(dataMap.getName()), true);
     }
 }
\ No newline at end of file



Mime
View raw message