8038451: Incorrect initialization order of static fields in sun.nio.cs.ext.JISAutoDetect$Decoder

Reviewed-by: alanb, sherman
This commit is contained in:
Mandy Chung 2014-03-27 17:11:28 -07:00
parent d7853cdac7
commit d056456ee8

View File

@ -117,6 +117,8 @@ public class JISAutoDetect
}
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 @@ public class JISAutoDetect
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