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

Wrong exception messages in java.awt.color.ICC_ColorSpace

XMLWordPrintable

    • 2d
    • b54
    • generic
    • generic

        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.

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

                Created:
                Updated:
                Resolved: