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

ICC_Profile.getInstance(byte[]): IAE is not specified

    XMLWordPrintable

Details

    • CSR
    • Resolution: Approved
    • P4
    • 17
    • client-libs
    • None
    • 2d
    • behavioral
    • minimal
    • More properly document existing behavior.
    • Java API
    • SE

    Description

      Summary

      Add @throws IllegalArgumentException to the specification of java.awt.color.ICC_Profile.getInstance(byte[])

      Problem

      The javadoc for this method already states "Throws an {@code IllegalArgumentException} if the data does not correspond to a valid ICC Profile." But properly this should be specified with an @throws clause

      Solution

      Update the specification as above.

      Specification

       src/java.desktop/share/classes/java/awt/color/ICC_Profile.java
      
           /**
            * Constructs an {@code ICC_Profile} object corresponding to the data in a
      -     * byte array. Throws an {@code IllegalArgumentException} if the data does
      -     * not correspond to a valid ICC Profile.
      +     * byte array.
            *
            * @param  data the specified ICC Profile data
            * @return an {@code ICC_Profile} object corresponding to the data in the
            *         specified {@code data} array
      +     * @throws IllegalArgumentException If the byte array does not contain valid
      +     *         ICC Profile data
            */
           public static ICC_Profile getInstance(byte[\] data) {

      link for convenience https://github.com/openjdk/jdk/pull/2328/files

      Attachments

        Issue Links

          Activity

            People

              serb Sergey Bylokhov
              ydanilev Yury Danilevich (Inactive)
              Philip Race
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: