-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.2.0
-
sparc
-
solaris_2.5
A sample program:
Collator c = Collator.getInstance();
causes an ArrayIndexOutofBoundsException on the Korean machine.
Using Collator.getAvailableLocales() shows that "ko" is an available locale/
We currently are testing on approx. 10 different languages (a mix of SBCS and
DBCS) and Korean is the only language that causes this problem.
To test further, I ran my sample program on a Japanese machine and everything
worked fine. I used the following code on the same Japanese machine:
Locale.setDefault(Locale.KOREAN);
System.out.println("New default locale: " + Locale.getDefault());
Collator c =3D Collator.getInstance();
This is the output:
New default locale: ko
java.lang.ArrayIndexOutOfBoundsException: -32768
at java.text.CompactIntArray.compact(CompactIntArray.java:180)
at java.text.RuleBasedCollator.build(RuleBasedCollator.java:546)
If I run the same sample code on my English NT machine, I get the same
exact errors. If I change the locale (.setDefault(Locale.JAPANESE) and =
run this
on my English machine (or Korean machine), everything works fine.
The actual test case is:
import java.text.*;
import java.util.*;
public class Test
{
public static void main(String[] args)
{
Locale.setDefault(Locale.KOREAN);
System.out.println("New default locale: " + Locale.getDefault());
Collator c =3D Collator.getInstance();
Collator c =3D Collator.getInstance();
}
}
This produces an ArrayIndexOutOfBoundsException when the locale is set =
to be
Korean but works with other locales!
Collator c = Collator.getInstance();
causes an ArrayIndexOutofBoundsException on the Korean machine.
Using Collator.getAvailableLocales() shows that "ko" is an available locale/
We currently are testing on approx. 10 different languages (a mix of SBCS and
DBCS) and Korean is the only language that causes this problem.
To test further, I ran my sample program on a Japanese machine and everything
worked fine. I used the following code on the same Japanese machine:
Locale.setDefault(Locale.KOREAN);
System.out.println("New default locale: " + Locale.getDefault());
Collator c =3D Collator.getInstance();
This is the output:
New default locale: ko
java.lang.ArrayIndexOutOfBoundsException: -32768
at java.text.CompactIntArray.compact(CompactIntArray.java:180)
at java.text.RuleBasedCollator.build(RuleBasedCollator.java:546)
If I run the same sample code on my English NT machine, I get the same
exact errors. If I change the locale (.setDefault(Locale.JAPANESE) and =
run this
on my English machine (or Korean machine), everything works fine.
The actual test case is:
import java.text.*;
import java.util.*;
public class Test
{
public static void main(String[] args)
{
Locale.setDefault(Locale.KOREAN);
System.out.println("New default locale: " + Locale.getDefault());
Collator c =3D Collator.getInstance();
Collator c =3D Collator.getInstance();
}
}
This produces an ArrayIndexOutOfBoundsException when the locale is set =
to be
Korean but works with other locales!
- duplicates
-
JDK-4058613 Getting ArrayIndexOutOfBoundsException for URL's openStream method in ko locale
-
- Closed
-