8038451: Incorrect initialization order of static fields in sun.nio.cs.ext.JISAutoDetect$Decoder
Reviewed-by: alanb, sherman
--- a/jdk/src/share/classes/sun/nio/cs/ext/JISAutoDetect.java Thu Mar 27 13:42:39 2014 +0000
+++ b/jdk/src/share/classes/sun/nio/cs/ext/JISAutoDetect.java Thu Mar 27 17:11:28 2014 -0700
@@ -117,6 +117,8 @@
}
private static class Decoder extends CharsetDecoder {
+ private final static String osName = AccessController.doPrivileged(
+ (PrivilegedAction<String>) () -> System.getProperty("os.name"));
private final static String SJISName = getSJISName();
private final static String EUCJPName = getEUCJPName();
@@ -239,8 +241,6 @@
return ((CharsetDecoder) detectedDecoder).charset();
}
- private static final String osName = AccessController.doPrivileged(
- (PrivilegedAction<String>) () -> System.getProperty("os.name"));
/**
* Returned Shift_JIS Charset name is OS dependent