jscience
  1. jscience
  2. JSCIENCE-69

AlternateUnit constructor results in a NPE if the 'parent' argument is a non-standard unit

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Blocker Blocker
    • 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:
      69

      Description

      This issue was noticed in JScience v4.3.1.

      If the parent argument to the AlternateUnit constructor is not a standard unit,
      this results in a NullPointerException. I believe this occurs because the
      string expression argument to 'new UnsupportedException(...)' references 'this',
      when maybe it should use 'parent'.

      The relevent code snippet from AlternateUnit(String symbol, Unit<?> parent) is
      shown below.

      if (!parent.isStandardUnit())
      throw new UnsupportedOperationException(this
      + " is not a standard unit");

        Activity

        shanmann created issue -
        kenaiadmin made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 69 63228
        dautelle made changes -
        Fix Version/s Version 6.0 [ 14597 ]
        Fix Version/s milestone 1 [ 12327 ]

          People

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

            Dates

            • Created:
              Updated: