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

[Fmt-Ch] uninformative exception in ChoiceFormat.applyPattern(String)

XMLWordPrintable

    • b21
    • x86
    • generic
    • Not verified

      A DESCRIPTION OF THE REQUEST :
      when exception is thrown from applyPattern, there is no information about what caused it

      } catch (Exception e) {
           throw new IllegalArgumentException();
      }

      JUSTIFICATION :
      this exception should contain information on cause so developers of client code can understand the cause problem

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      thrown exceptions should contain cause exception and some description
      ACTUAL -
      there is no information about what caused the exception

      ---------- BEGIN SOURCE ----------
      import java.text.ChoiceFormat;

      public class FormatTest{
      public static void main(String[] args){
      new ChoiceFormat("{0,choice,0#a|1#b}");
      }
      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      debuging ChoiceFormat.applyPattern(String) and running it step-by-step gives some information on problem

            nishjain Nishit Jain
            okutsu Masayoshi Okutsu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: