jscience
  1. jscience
  2. JSCIENCE-60

SI.METRE transformed units seem to be broken

    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:
      60

      Description

      I first discovered these problems when I noticed that SI.KILOMETRE.toString()
      threw a NPE. Then I discovered more problems diving in deeper... As far as I can
      tell, there's some kind of race condition in the static initializers within
      UnitFormat. Whatever it is, km1 is broken when running the following code on my
      machine, while km2 seems to work fine (even though they are defined the same).

      <code>
      import javax.measure.unit.SI;
      import javax.measure.unit.Unit;
      public class Test {
      public static void main(String[] args)

      { Unit km1 = SI.KILOMETRE; Unit km2 = SI.KILO(SI.METRE); //System.out.println("km1 == km2? " + km1.equals(km2)); // throws NPE or returns false if you reverse km1/km2 //System.out.println(SI.KILOMETRE); // throws NPE }

      }
      </code>

        Activity

        There are no comments yet on this issue.

          People

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

            Dates

            • Created:
              Updated: