Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.0
    • Component/s: None
    • Labels:
      None

      Description

      There are some checks for the max value that will fit in a short.
      These are of the form:

      if (Math.abs(value) >= 32767)
      

      This seems wrong, as Short.MAX_VALUE = 32767, so the check should be

      if (Math.abs(value) > 32767)
      

      There's a further problem, which is that Short.MIN_VALUE = -32768.
      This will be disallowed, unless the condition is written as:

      if ((value >= -32768) && (value <= 32767))
      

      This is how the ctor generic.PUSH.PUSH(ConstantPoolGen cp, int value) does the check.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              sebb@apache.org Sebb
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: