jscience
  1. jscience
  2. JSCIENCE-62

Exception message from Amount.valueOf(CharSequence) with an invalid unit no longer has details

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: current
    • Fix Version/s: Version 6.0
    • Component/s: www
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      62

      Description

      In 4.2.0 and earlier versions, the exception message from
      Amount.valueOf(CharSequence) with an invalid unit string, contained information
      related to what failed in the parsing.

      For example Amount.valueOf( "10.0 notaunit" ) would have resulted in an
      exception with the following message.

      "notaunit not recognized (in 10.0 notaunit at index 5)"

      In 4.3.1, and I presume 4.3.0, however it is:
      "Incomplete Parsing"

      Looking at the source of AmountFormat.java, the ParseException is being
      "captured" in AmountFormat.PlusMinusError.parse(CharSequence,Cursor). In
      pre-4.3.x it was allowed to "escape" the parse method.

      I will attach a simple program with the call shown above.

        Activity

        Hide
        shanmann added a comment -

        Created an attachment (id=6)
        Example of Amount.valueOf(CharSequence) with an invalid unit string

        Show
        shanmann added a comment - Created an attachment (id=6) Example of Amount.valueOf(CharSequence) with an invalid unit string

          People

          • Assignee:
            jscience-issues
            Reporter:
            shanmann
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: