You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by aa...@apache.org on 2026/05/17 19:32:44 UTC

(cayenne) branch master updated: GlobalActions must be initialized lazily, leset they are triggered during unit tests

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

asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cayenne.git


The following commit(s) were added to refs/heads/master by this push:
     new deb8ff261 GlobalActions must be initialized lazily, leset they are triggered during unit tests
deb8ff261 is described below

commit deb8ff261545c167a13ab88d55591361930ce3f7
Author: Andrus Adamchik <an...@objectstyle.com>
AuthorDate: Sun May 17 15:32:32 2026 -0400

    GlobalActions must be initialized lazily, leset they are triggered during unit tests
---
 .../main/java/org/apache/cayenne/modeler/Application.java    | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/Application.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/Application.java
index 97aa18d93..fe7cdba9f 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/Application.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/Application.java
@@ -105,8 +105,8 @@ public class Application {
     private final UIInitializer platformInitializer;
     private final ModelerClassLoader classLoader;
     private final PreferencesRepository preferencesRepository;
-    private final GlobalActions actionManager;
     private final ProjectValidator projectValidator;
+    private GlobalActions actionManager;
     private LogConsole logConsole;
     private MainFrame frame;
     private CayenneUndoManager undoManager;
@@ -118,10 +118,6 @@ public class Application {
 
         this.classLoader = new ModelerClassLoader();
         this.preferencesRepository = new PreferencesRepository(injector.getInstance(ConfigurationNameMapper.class));
-        this.actionManager = new GlobalActions(
-                this,
-                injector.getInstance(ConfigurationNameMapper.class),
-                injector.getInstance(ConfigurationNodeParentGetter.class));
         this.projectValidator = new ConfigurableProjectValidator(this);
     }
 
@@ -187,7 +183,11 @@ public class Application {
     }
 
     public void launch(File initialProject) {
-        platformInitializer.initLookAndFeel();
+        this.platformInitializer.initLookAndFeel();
+        this.actionManager = new GlobalActions(
+                this,
+                injector.getInstance(ConfigurationNameMapper.class),
+                injector.getInstance(ConfigurationNodeParentGetter.class));
 
         this.logConsole = new LogConsole(this);
         ModelerLogFactory.setAppender(logConsole);