Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8217971

Remove OOME statement from Base64.Decoder

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Withdrawn
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      The compatibility risk is minimum, as the Base64.Decoder.decode() methods were incorrectly throwing an OOME for the allocatable array/buffer size
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      The OOME statement should be removed from Base64.Decoder.

      Problem

      The Base64.Decoder specify the OOME error to be thrown by decode methods when the decoded byte array/buffer of needed size can not be allocated. The issue is because of the overflow of an intermediary integer value, not the final value, which should be handled with out throwing the error.

      Solution

      Remove the OutOfMemoryError statement from Base64.Decoder, as the allocation size of the decoded bytes will never be larger than the input bytes size.

      Specification

      Update Base64.Decoder spec

      from:

      * <p> Unless otherwise noted, passing a {@code null} argument to
      * a method of this class will cause a
      * {@link java.lang.NullPointerException NullPointerException} to
      * be thrown.
      * <p> If the decoded byte output of the needed size can not
      *     be allocated, the decode methods of this class will
      *     cause an {@link java.lang.OutOfMemoryError OutOfMemoryError}
      *     to be thrown.

      to:

      * <p> Unless otherwise noted, passing a {@code null} argument to
      * a method of this class will cause a
      * {@link java.lang.NullPointerException NullPointerException} to
      * be thrown.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              nishjain Nishit Jain
              Reporter:
              nishjain Nishit Jain
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: