Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6448787

Regression: UnicodeLittle broken on 1.4.2_12

XMLWordPrintable

    • b01
    • b06
    • generic, sparc
    • generic, solaris_8

        UnicodeLittle is broken on 1.4.2_12, the following test fails on 1.4.2_12 and works on older versions such as 1.4.2_06:
        public class TestUnicodeLittle {
                public static void main(String[] args) throws Exception {
                        byte[] unicodeLittleBytes = new byte[]{68,0,83,0,75,0,80,0,79,0,79,0,76,0,53,0,51,0};
                        String unicodeLittleStr = new String(unicodeLittleBytes, "UnicodeLittle");

                        System.out.println("Actual output: " + unicodeLittleStr);
                        System.out.println("Expected output: DSKPOOL53");
                        if ("DSKPOOL53".equals(unicodeLittleStr)) {
                                System.out.println("Test passed");
                        } else {
                                System.out.println("Test failed");
                        }

                }

        }

        Test output on 1.4.2_06:
        $ java -version
        java version "1.4.2_06"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_06-b03)
        Java HotSpot(TM) Client VM (build 1.4.2_06-b03, mixed mode)
        $ java -cp . TestUnicodeLittle
        Actual output: DSKPOOL53
        Expected output: DSKPOOL53
        Test passed
        $

        Output on 1.4.2_12:
        $ java -version
        java version "1.4.2_12"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_12-b03)
        Java HotSpot(TM) Client VM (build 1.4.2_12-b03, mixed mode)
        $ java -cp . TestUnicodeLittle
        Actual output: ?????????
        Expected output: DSKPOOL53
        Test failed
        $

              kevinw Kevin Walls
              ptiberio Paulo Tiberio Bulhoes (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: