Changeset 18598 in josm for trunk/src


Ignore:
Timestamp:
2022-11-16T01:08:37+01:00 (2 years ago)
Author:
taylor.smock
Message:

FlatLaf uses properties files which occasionally have breaking changes

In the event that a properties file is misconfigured, FlatLaf will throw
an IllegalArgumentException, which causes JOSM to exit, which is not ideal,
since recovering is not intuitive.

This will roll back the LAF to the platform default, so people can start JOSM.
Which isn't ideal, but is better than not starting indefinitely.

File:
1 edited

Legend:

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

    r18570 r18598  
    11231123    }
    11241124
     1125    /**
     1126     * Set up the UI manager
     1127     */
     1128    // We want to catch all exceptions here to reset LaF to defaults and report it.
     1129    @SuppressWarnings("squid:S2221")
    11251130    static void setupUIManager() {
    11261131        String defaultlaf = PlatformManager.getPlatform().getDefaultStyle();
     
    11491154                    LafPreference.LAF.put(defaultlaf);
    11501155                    Logging.trace(ex);
     1156                } catch (Exception ex) {
     1157                    // We do not want to silently exit if there is an exception.
     1158                    // Put the default laf in place so that the user can use JOSM.
     1159                    LafPreference.LAF.put(defaultlaf);
     1160                    BugReportExceptionHandler.handleException(ex);
    11511161                }
    11521162            } else {
     
    11601170        } catch (InstantiationException | IllegalAccessException e) {
    11611171            Logging.error(e);
     1172        } catch (Exception e) {
     1173            // We do not want to silently exit if there is an exception.
     1174            // Put the default laf in place.
     1175            LafPreference.LAF.put(defaultlaf);
     1176            BugReportExceptionHandler.handleException(e);
    11621177        }
    11631178
Note: See TracChangeset for help on using the changeset viewer.