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

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

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b21
    • CPU:
      x86
    • OS:
      generic
    • Verification:
      Not verified

      Description

      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

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: