Skip to content

Commit d0b3f5e

Browse files
author
stoecker
committed
remove outdated expiry data check, see #24635
git-svn-id: https://josm.openstreetmap.de/svn/trunk@19541 0c6e7542-c601-0410-84e7-c038aed88b3b
1 parent cd2a41c commit d0b3f5e

File tree

4 files changed

+0
-53
lines changed

4 files changed

+0
-53
lines changed

src/org/openstreetmap/josm/tools/PlatformHook.java

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,14 @@
1616
import java.security.NoSuchAlgorithmException;
1717
import java.security.cert.CertificateException;
1818
import java.security.cert.X509Certificate;
19-
import java.text.DateFormat;
2019
import java.util.ArrayList;
2120
import java.util.Collection;
2221
import java.util.Collections;
23-
import java.util.Date;
2422
import java.util.List;
2523

2624
import org.openstreetmap.josm.data.projection.datum.NTV2Proj4DirGridShiftFileSource;
2725
import org.openstreetmap.josm.io.CertificateAmendment.NativeCertAmend;
2826
import org.openstreetmap.josm.spi.preferences.Config;
29-
import org.openstreetmap.josm.tools.date.DateUtils;
3027

3128
/**
3229
* This interface allows platform (operating system) dependent code
@@ -293,26 +290,6 @@ interface SanityCheckCallback {
293290
void sanityCheckFailed(String title, boolean canContinue, String... message);
294291
}
295292

296-
/**
297-
* Checks if the running version of Java has expired, proposes to user to update it if needed.
298-
* @param callback Java expiration callback
299-
* @since 12270 (signature)
300-
* @since 12219
301-
*/
302-
default void checkExpiredJava(JavaExpirationCallback callback) {
303-
Date expiration = Utils.getJavaExpirationDate();
304-
if (expiration != null && expiration.before(new Date())) {
305-
String latestVersion = Utils.getJavaLatestVersion();
306-
String currentVersion = Utils.getSystemProperty("java.version");
307-
// #17831 WebStart may be launched with an expired JRE but then launching JOSM with up-to-date JRE
308-
if (latestVersion == null || !latestVersion.equalsIgnoreCase(currentVersion)) {
309-
callback.askUpdateJava(latestVersion != null ? latestVersion : "latest",
310-
Config.getPref().get("java.update.url", getJavaUrl()),
311-
DateUtils.getDateFormat(DateFormat.MEDIUM).format(expiration), false);
312-
}
313-
}
314-
}
315-
316293
/**
317294
* Checks if we will soon not be supporting the running version of Java
318295
* @param callback Java expiration callback

src/org/openstreetmap/josm/tools/PlatformHookOsx.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ public void startupHook(JavaExpirationCallback javaCallback, SanityCheckCallback
9090
Logging.warn("Failed to register with macOS: " + ex);
9191
}
9292
warnSoonToBeUnsupportedJava(javaCallback);
93-
checkExpiredJava(javaCallback);
9493
PlatformHook.super.startupHook(javaCallback, sanityCheckCallback);
9594
}
9695

src/org/openstreetmap/josm/tools/PlatformHookWindows.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ public void afterPrefStartupHook() {
156156
@Override
157157
public void startupHook(JavaExpirationCallback javaCallback, SanityCheckCallback sanityCheckCallback) {
158158
warnSoonToBeUnsupportedJava(javaCallback);
159-
checkExpiredJava(javaCallback);
160159
PlatformHook.super.startupHook(javaCallback, sanityCheckCallback);
161160
}
162161

src/org/openstreetmap/josm/tools/Utils.java

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,14 @@
3131
import java.security.MessageDigest;
3232
import java.security.NoSuchAlgorithmException;
3333
import java.text.Bidi;
34-
import java.text.DateFormat;
3534
import java.text.MessageFormat;
3635
import java.text.Normalizer;
37-
import java.text.ParseException;
3836
import java.util.AbstractCollection;
3937
import java.util.AbstractList;
4038
import java.util.ArrayList;
4139
import java.util.Arrays;
4240
import java.util.Collection;
4341
import java.util.Collections;
44-
import java.util.Date;
4542
import java.util.Iterator;
4643
import java.util.List;
4744
import java.util.Locale;
@@ -1704,31 +1701,6 @@ public static int getJavaBuild() {
17041701
}
17051702
}
17061703

1707-
/**
1708-
* Returns the JRE expiration date.
1709-
* @return the JRE expiration date, or null
1710-
* @since 12219
1711-
*/
1712-
public static Date getJavaExpirationDate() {
1713-
try {
1714-
Object value;
1715-
Class<?> c = Class.forName("com.sun.deploy.config.BuiltInProperties");
1716-
try {
1717-
value = c.getDeclaredField("JRE_EXPIRATION_DATE").get(null);
1718-
} catch (NoSuchFieldException e) {
1719-
// Field is gone with Java 9, there's a method instead
1720-
Logging.trace(e);
1721-
value = c.getDeclaredMethod("getProperty", String.class).invoke(null, "JRE_EXPIRATION_DATE");
1722-
}
1723-
if (value instanceof String) {
1724-
return DateFormat.getDateInstance(3, Locale.US).parse((String) value);
1725-
}
1726-
} catch (IllegalArgumentException | ReflectiveOperationException | SecurityException | ParseException e) {
1727-
Logging.debug(e);
1728-
}
1729-
return null;
1730-
}
1731-
17321704
/**
17331705
* Returns the latest version of Java, from Oracle website.
17341706
* @return the latest version of Java, from Oracle website

0 commit comments

Comments
 (0)