Changeset 18570 in josm


Ignore:
Timestamp:
2022-10-06T21:10:57+02:00 (2 years ago)
Author:
taylor.smock
Message:

Fix #22183: NoClassDefFoundError: Could not initialize class org.openstreetmap.josm.actions.SessionSaveAction

This was caused by JOSM detecting that it had started in IPv6 mode, but no IPv6
network was available. When this occurs, JOSM immediately sets a preference key
and restarts so that users are not confused about a lack of network connectivity.

The JOSM restart action then proceeds to attempt to save any active layers, but
since this occurs during startup, there are no active layers and the save actions
have not yet been initialized. The save actions cannot be initialized before
contentPanePrivate has been initialized, but the IPv6 call is done prior to
that happening, which may then trigger a JOSM restart, which calls exitJosm,
which then calls the save layers actions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/MainApplication.java

    r18561 r18570  
    515515     */
    516516    public static boolean exitJosm(boolean exit, int exitCode, SaveLayersDialog.Reason reason) {
    517         final boolean proceed = Boolean.TRUE.equals(GuiHelper.runInEDTAndWaitAndReturn(() ->
     517        final boolean proceed = layerManager.getLayers().isEmpty() ||
     518                Boolean.TRUE.equals(GuiHelper.runInEDTAndWaitAndReturn(() ->
    518519                SaveLayersDialog.saveUnsavedModifications(layerManager.getLayers(),
    519520                        reason != null ? reason : SaveLayersDialog.Reason.EXIT)));
Note: See TracChangeset for help on using the changeset viewer.