Changeset 15193 in josm for trunk


Ignore:
Timestamp:
2019-06-23T23:16:11+02:00 (5 years ago)
Author:
Don-vip
Message:

fix #17831 - make sure we don't ask to update to current version of Java by mistake

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/PlatformHook.java

    r15007 r15193  
    291291        Date expiration = Utils.getJavaExpirationDate();
    292292        if (expiration != null && expiration.before(new Date())) {
    293             String version = Utils.getJavaLatestVersion();
    294             callback.askUpdateJava(version != null ? version : "latest",
    295                     Config.getPref().get("java.update.url", "https://www.java.com/download"),
    296                     DateUtils.getDateFormat(DateFormat.MEDIUM).format(expiration), false);
     293            String latestVersion = Utils.getJavaLatestVersion();
     294            String currentVersion = Utils.getSystemProperty("java.version");
     295            // #17831 WebStart may be launched with an expired JRE but then launching JOSM with up-to-date JRE
     296            if (latestVersion == null || !latestVersion.equalsIgnoreCase(currentVersion)) {
     297                callback.askUpdateJava(latestVersion != null ? latestVersion : "latest",
     298                        Config.getPref().get("java.update.url", "https://www.java.com/download"),
     299                        DateUtils.getDateFormat(DateFormat.MEDIUM).format(expiration), false);
     300            }
    297301        }
    298302    }
Note: See TracChangeset for help on using the changeset viewer.