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

Wrong exception messages in java.awt.color.ICC_ColorSpace

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
      2d
    • Resolved In Build:
      b54
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        FULL PRODUCT VERSION :


        A DESCRIPTION OF THE PROBLEM :
        The methods getMinValue and getMaxValue of java.awt.color.ICC_ColorSpace correctly throw IllegalArgumentException when the 'component' parameter is out of range. However, the exception message contains the literal string "+ component" instead of the value of 'component'.

        This patch fixes the problem:

        diff -r b8e8497c541c src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java
        --- a/src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java Thu Feb 05 13:00:26 2015 +0100
        +++ b/src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java Thu Feb 05 19:21:31 2015 +0100
        @@ -546,7 +546,7 @@
             public float getMinValue(int component) {
                 if ((component < 0) || (component > this.getNumComponents() - 1)) {
                     throw new IllegalArgumentException(
        - "Component index out of range: + component");
        + "Component index out of range: " + component);
                 }
                 return minVal[component];
             }
        @@ -571,7 +571,7 @@
             public float getMaxValue(int component) {
                 if ((component < 0) || (component > this.getNumComponents() - 1)) {
                     throw new IllegalArgumentException(
        - "Component index out of range: + component");
        + "Component index out of range: " + component);
                 }
                 return maxVal[component];
             }



        REPRODUCIBILITY :
        This bug can be reproduced always.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                psadhukhan Prasanta Sadhukhan
                Reporter:
                webbuggrp Webbug Group
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: