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

Update the classes in the java.awt.color package

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 16
    • client-libs
    • None
    • 2d
    • behavioral
    • minimal
    • This is minimal to none since the code would already throw this, but did not document it.
    • Java API
    • SE

      Summary

      Some methods in the java.awt.color.ICC_ProfileRGB class throw unspecified exceptions.

      Problem

      The methods ICC_ProfileRGB.getGamma(int) and ICC_ProfileRGB.getTRC(int) throw IllegalArgumentException for invalid parameters.

      Solution

      Update the specification.

      Specification

      java/awt/color/ICC_ProfileRGB.java

      @@ -179,37 +169,18 @@
             * </pre>
             *
             * @param  component the {@code ICC_ProfileRGB} constant that represents the
             *         component whose TRC you want to retrieve
             * @return the gamma value as a float
      +      * @throws IllegalArgumentException if the component is not
      +      *         {@code REDCOMPONENT}, {@code GREENCOMPONENT}, or
      +      *         {@code BLUECOMPONENT}
             * @throws ProfileDataException if the profile does not specify the
             *         corresponding TRC as a single gamma value
             */
            public float getGamma(int component) {
      
      @@ -230,35 +201,34 @@
             *
             * @param  component the {@code ICC_ProfileRGB} constant that represents the
             *         component whose TRC you want to retrieve: {@code REDCOMPONENT},
             *         {@code GREENCOMPONENT}, or {@code BLUECOMPONENT}
             * @return a short array representing the TRC
      +      * @throws IllegalArgumentException if the component is not
      +      *         {@code REDCOMPONENT}, {@code GREENCOMPONENT}, or
      +      *         {@code BLUECOMPONENT}
             * @throws ProfileDataException if the profile does not specify the
             *         corresponding TRC as a table
             */
            public short[] getTRC(int component) {

            serb Sergey Bylokhov
            serb Sergey Bylokhov
            Philip Race
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: