-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.1.6
-
x86
-
windows_95
Name: paC48320 Date: 04/03/98
System.gc() with JIT invocation causes java.lnag.NullPointerException.
This doesn't occur when java runs with the -nojit option or commenting
out System.gc() line without the -nojit option. The exception
message is as follows:
java.lang.NullPointerException
at sun.io.ByteToCharSJIS.<init>(Compiled Code)
at sun.io.ByteToCharConverter.getConverter(Compiled Code)
at test.convert(Compiled Code)
at test.<init>(test.java:11)
at test.main(test.java:3)
Following program demonstrates the problem.
public class test {
public static void main(String argv[]) {
test t = new test();
}
test() {
String sjis = "SJIS code";
System.gc(); // Removing this line works.
String aa = convert(sjis);
System.out.println("aa="+aa);
String bb = convert(sjis);
System.out.println("bb="+bb);
}
String convert(String sjis) {
try {
return new String(sjis.getBytes("8859_1"),
System.getProperty("file.encoding"));
} catch(Exception e) {
e.printStackTrace();
}
return null;
}
}
(Review ID: 27738)
======================================================================
- duplicates
-
JDK-4120141 JDK1.1.6 ONLY: [Win32]sun.io.ByteToCharEUC_JP/SJIS throws NullPointerException
-
- Closed
-