Tested by Kestrel fcs_H and I with Classic VM on both of Solaris and Windows
String(byte[] bytes, int offset, int length, String enc)
makes NullPointerException.
Exception in thread "main" java.lang.NullPointerException
at java.lang.ThreadLocal.get(ThreadLocal.java:83)
at java.lang.String.getBTCConverter(String.java:124)
at java.lang.String.<init>(String.java:403)
at ASCIIGoThruTest.compare(ASCIIGoThruTest.java:54)
at ASCIIGoThruTest.tryfunc(ASCIIGoThruTest.java:42)
at ASCIIGoThruTest.run(ASCIIGoThruTest.java:25)
at ASCIIGoThruTest.main(ASCIIGoThruTest.java:18)
However, with hotspot it can work.
To reproduce
1. Extract attached zip file.---ASCIITestCode.zip
2. Compile them.
3. Run the program as follows;
java -classic ASCIIGoThruTest EUCJIS JIS SJIS 8859_1
In Kestrel fcs_G it can work with both of HotSpot and Classic VM.
- duplicates
-
JDK-4276441 Classic VM smashs Thread.threadLocals
- Closed