Changeset 12238 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2017-05-23T01:25:33+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/Utils.java
r12219 r12238 1657 1657 public static Date getJavaExpirationDate() { 1658 1658 try { 1659 Object value = Class.forName("com.sun.deploy.config.BuiltInProperties").getDeclaredField("JRE_EXPIRATION_DATE").get(null); 1659 Object value = null; 1660 Class<?> c = Class.forName("com.sun.deploy.config.BuiltInProperties"); 1661 try { 1662 value = c.getDeclaredField("JRE_EXPIRATION_DATE").get(null); 1663 } catch (NoSuchFieldException e) { 1664 // Field is gone with Java 9, there's a method instead 1665 Main.trace(e); 1666 value = c.getDeclaredMethod("getProperty", String.class).invoke(null, "JRE_EXPIRATION_DATE"); 1667 } 1660 1668 if (value instanceof String) { 1661 1669 return DateFormat.getDateInstance(3, Locale.US).parse((String) value);
Note:
See TracChangeset
for help on using the changeset viewer.