You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by ab...@apache.org on 2019/08/01 11:02:00 UTC

[cayenne] branch STABLE-4.1 updated: CAY-2603 NPE reloading project in the model

This is an automated email from the ASF dual-hosted git repository.

abulatski pushed a commit to branch STABLE-4.1
in repository https://gitbox.apache.org/repos/asf/cayenne.git


The following commit(s) were added to refs/heads/STABLE-4.1 by this push:
     new 3b955fd  CAY-2603 NPE reloading project in the model
3b955fd is described below

commit 3b955fdc3eb2072ccd9861768014b3dbe4ee2dc8
Author: Arseni Bulatski <an...@gmail.com>
AuthorDate: Thu Aug 1 14:00:17 2019 +0300

    CAY-2603 NPE reloading project in the model
---
 RELEASE-NOTES.txt                                                    | 1 +
 .../cayenne/modeler/editor/cgen/CodeGeneratorControllerBase.java     | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt
index f2ada55..92f7dad 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.txt
@@ -30,6 +30,7 @@ CAY-2594 DbImport: AutoAdapter resolving inside an import operation hangs up the
 CAY-2595 ObjAttributes are not sorted in alphabetical ordering on save
 CAY-2596 DbImport xml config changes after dbImport plugin task execution
 CAY-2601 Modeler DbImport: result dialog issues
+CAY-2603 NPE reloading project in the model
 
 ----------------------------------
 Release: 4.1.B2
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/cgen/CodeGeneratorControllerBase.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/cgen/CodeGeneratorControllerBase.java
index f96972a..ba410ec 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/cgen/CodeGeneratorControllerBase.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/cgen/CodeGeneratorControllerBase.java
@@ -80,6 +80,9 @@ public abstract class CodeGeneratorControllerBase extends CayenneController {
         this.selectedEntitiesForDataMap = new HashMap<>();
         this.selectedEmbeddablesForDataMap = new HashMap<>();
         this.selectedDataMaps = new HashMap<>();
+        this.selectedEntities = new HashSet<>();
+        this.selectedEmbeddables = new HashSet<>();
+        this.isDataMapSelected = new HashSet<>();
     }
 
     public void startup(DataMap dataMap){
@@ -287,7 +290,7 @@ public abstract class CodeGeneratorControllerBase extends CayenneController {
         else if (obj instanceof Embeddable) {
             name = ((Embeddable) obj).getClassName();
         }
-        
+
         if (validation == null) {
             return null;
         }