Changeset 10058 in josm


Ignore:
Timestamp:
2016-03-27T14:28:02+02:00 (8 years ago)
Author:
Don-vip
Message:

see #11924 - Package.getPackage is deprecated in Java 9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java

    r10055 r10058  
    5959        if (source != null && target.length() < source.length() && param[1].startsWith(source)) {
    6060            it.set(param[0] + '=' + param[1].replace(source, target));
     61        }
     62    }
     63
     64    private static boolean isRunningJavaWebStart() {
     65        try {
     66            // See http://stackoverflow.com/a/16200769/2257172
     67            return Class.forName("javax.jnlp.ServiceManager") != null;
     68        } catch (ClassNotFoundException e) {
     69            return false;
    6170        }
    6271    }
     
    9099            }
    91100            // Add WebStart package details if run from JNLP
    92             if (Package.getPackage("javax.jnlp") != null) {
     101            if (isRunningJavaWebStart()) {
    93102                String webStartDetails = ((PlatformHookUnixoid) Main.platform).getWebStartPackageDetails();
    94103                if (webStartDetails != null) {
Note: See TracChangeset for help on using the changeset viewer.