Harmony
  1. Harmony
  2. HARMONY-32

[classlib][text] java.text.Collator.setDecomposition(FULL_DECOMPOSITION) throws IllegalArgumentException

    Details

    • Type: Bug Bug
    • Status: In Progress
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Classlib
    • Labels:
      None

      Description

      Code for reproducing Test.java:
      import java.text.Collator;
      import java.util.Locale;

      public class Test {
      public static void main (String[] args)

      { Collator c = Collator.getInstance(Locale.US); c.setDecomposition(Collator.FULL_DECOMPOSITION); int decompositionMode = c.getDecomposition(); System.out.println("decomposition Mode is " + decompositionMode); }

      }

      Steps to Reproduce:
      1. Build Harmony-14 j2se subset as described in README.txt.
      2. Compile Test.java using BEA 1.4 javac
      > javac -d . Test.java
      2. Run java using compatible VM (J9)
      > java -showversion Test

      Output:
      java version 1.4.2 (subset)

      (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable.
      Exception in thread "main" java.lang.IllegalArgumentException: Wrong decomposition mode.
      at com.ibm.icu.text.Collator.setDecomposition(Collator.java:295)
      at java.text.Collator.setDecomposition(Collator.java:277)
      at Test.main(Test.java:7)

      Output on BEA 1.4.2:
      decomposition Mode is 2

      Suggested junit test case:
      package org.apache.harmony.tests.java.text;

      import java.text.Collator;
      import java.util.Locale;

      import junit.framework.TestCase;

      public class CollatorTest extends TestCase {
      public static void main(String[] args)

      { junit.textui.TestRunner.run(CollatorTest.class); }

      public void test_setDecomposition() {
      Collator c = Collator.getInstance(Locale.US);
      try

      { c.setDecomposition(Collator.FULL_DECOMPOSITION); }

      catch (Exception e)

      { fail("Assert 0: Unexpected exception " + e); }

      int decompositionMode = c.getDecomposition();
      assertTrue("Assert 1: next() returns incorrect value " + decompositionMode, decompositionMode == Collator.FULL_DECOMPOSITION );
      }
      }

        Activity

        Mikhail Loenko made changes -
        Summary java.text.Collator.setDecomposition(FULL_DECOMPOSITION) throws IllegalArgumentException [classlib][text] java.text.Collator.setDecomposition(FULL_DECOMPOSITION) throws IllegalArgumentException
        Nathan Beyer made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Nathan Beyer made changes -
        Assignee Nathan Beyer [ nbeyer ]
        Geir Magnusson Jr made changes -
        Field Original Value New Value
        Assignee Geir Magnusson Jr [ geir ]
        tatyana doubtsova created issue -

          People

          • Assignee:
            Nathan Beyer
            Reporter:
            tatyana doubtsova
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development