Skip to content

Commit a40fc85

Browse files
committed
[LANG-1786] A lot of warnings on the console when using FastDateFormat
with JDK25 Java 26-ea contains the same unguarded writing to System.err
1 parent 4d70398 commit a40fc85

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/org/apache/commons/lang3/time/TimeZones.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import java.time.ZoneId;
2626
import java.util.TimeZone;
2727

28+
import org.apache.commons.lang3.JavaVersion;
2829
import org.apache.commons.lang3.ObjectUtils;
2930
import org.apache.commons.lang3.SystemUtils;
3031

@@ -35,7 +36,7 @@
3536
*/
3637
public class TimeZones {
3738

38-
private static PrintStream NOOP = SystemUtils.IS_JAVA_25 ? createNoop() : null;
39+
private static PrintStream NOOP = SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_25) ? createNoop() : null;
3940

4041
/**
4142
* A public version of {@link java.util.TimeZone}'s package private {@code GMT_ID} field.
@@ -82,7 +83,7 @@ public void write(final int b) throws IOException {
8283
* @since 3.20.0
8384
*/
8485
public static synchronized TimeZone getTimeZone(final String id) {
85-
if (SystemUtils.IS_JAVA_25 && NOOP != null && ZoneId.SHORT_IDS.containsKey(id)) {
86+
if (SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_25) && NOOP != null && ZoneId.SHORT_IDS.containsKey(id)) {
8687
final PrintStream ps = System.err;
8788
if (ps != null) {
8889
try {

0 commit comments

Comments
 (0)