jscience
  1. jscience
  2. JSCIENCE-84

Unit.valueOf(CharSequence) does not support a number immediately after opening paren

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Critical Critical
    • 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:
      84

      Description

      This problem was noticed in JScience 4.3.1.

      Unit.valueOf(CharSequence) does not support a number immediately after opening
      paren.

      ---- Begin example code snippet ----
      System.out.println( "JScience.VERSION=" + JScience.VERSION );

      final Unit<?> unit = Unit.valueOf( "(123*s)" );
      ---- End example code snippet ----

      ---- Begin output ----
      JScience.VERSION=4.3.1 October 4 2007
      Exception in thread "main" java.lang.IllegalArgumentException:
      java.text.ParseException: unexpected token 8
      at javax.measure.unit.Unit.valueOf(Unit.java:482)
      at
      jscience.UnitValueOfNumberAfterOpenParen.main(UnitValueOfNumberAfterOpenParen.java:11)
      Caused by: java.text.ParseException: unexpected token 8
      at
      javax.measure.unit.UnitFormat$DefaultFormat.parseProductUnit(UnitFormat.java:468)
      at
      javax.measure.unit.UnitFormat$DefaultFormat.parseProductUnit(UnitFormat.java:395)
      at javax.measure.unit.Unit.valueOf(Unit.java:479)
      ... 1 more
      ---- End output ----

        Activity

        There are no comments yet on this issue.

          People

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

            Dates

            • Created:
              Updated: