jscience
  1. jscience
  2. JSCIENCE-34

AsciiInstance of UnitFormat fails on some String->Unit conversions

    Details

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

      Operating System: All
      Platform: All

    • Issuezilla Id:
      34

      Description

      When converting from a String to a Unit using the AsciiInstance of
      UnitFormat, the conversion fails for the following Units:

      Example:
      StringBuilder ascii = new StringBuilder();
      UnitFormat.getAsciiInstance().format(SI.GRAM, ascii);
      Unit parsed = UnitFormat.getAsciiInstance().parse(ascii.toString(), new
      ParsePosition(0));

      SI.GRAM
      NonSI.PERCENT
      NonSI.DECIBEL
      NonSI.GALILEO
      NonSI.G
      NonSI.ATOM
      NonSI.REVOLUTION
      NonSI.CENTIRADIAN
      NonSI.GRADE
      NonSI.ARE
      NonSI.HECTARE
      NonSI.BYTE
      NonSI.OCTET
      NonSI.MINUTE
      NonSI.HOUR
      NonSI.DAY
      NonSI.WEEK
      NonSI.YEAR
      NonSI.MONTH
      NonSI.DAY_SIDEREAL
      NonSI.YEAR_SIDEREAL
      NonSI.YEAR_CALENDAR
      NonSI.AEON
      NonSI.E
      NonSI.FARADAY
      NonSI.FRANKLIN
      NonSI.GILBERT
      NonSI.ERG
      NonSI.ELECTRON_VOLT
      NonSI.LAMBERT
      NonSI.FOOT
      NonSI.FOOT_SURVEY_US
      NonSI.YARD
      NonSI.INCH
      NonSI.MILE
      NonSI.NAUTICAL_MILE
      NonSI.ASTRONOMICAL_UNIT
      NonSI.LIGHT_YEAR
      NonSI.PARSEC
      NonSI.POINT
      NonSI.PIXEL
      NonSI.COMPUTER_POINT
      NonSI.MAXWELL
      NonSI.GAUSS
      NonSI.ATOMIC_MASS
      NonSI.ELECTRON_MASS
      NonSI.POUND
      NonSI.OUNCE
      NonSI.TON_US
      NonSI.TON_UK
      NonSI.METRIC_TON
      NonSI.DYNE
      NonSI.KILOGRAM_FORCE
      NonSI.POUND_FORCE
      NonSI.HORSEPOWER
      NonSI.ATMOSPHERE
      NonSI.BAR
      NonSI.MILLIMETER_OF_MERCURY
      NonSI.INCH_OF_MERCURY
      NonSI.RAD
      NonSI.REM
      NonSI.CURIE
      NonSI.RUTHERFORD
      NonSI.SPHERE
      NonSI.MACH
      NonSI.C
      NonSI.LITER
      NonSI.CUBIC_INCH
      NonSI.GALLON_LIQUID_US
      NonSI.OUNCE_LIQUID_US
      NonSI.GALLON_DRY_US
      NonSI.GALLON_UK
      NonSI.OUNCE_LIQUID_UK
      NonSI.POISE
      NonSI.STOKE
      NonSI.ROENTGEN

        Activity

        Hide
        dautelle added a comment -

        Fixed in 4.3.0

        Show
        dautelle added a comment - Fixed in 4.3.0

          People

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

            Dates

            • Created:
              Updated:
              Resolved: