-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
1.3.0
-
sparc
-
solaris_2.5
Name: ksC84122 Date: 07/14/99
JDK kestrel Javadoc for java.awt.Color does not say anything about handling
empty string parameter in the following methods:
getColor(String nm), getColor(String nm, int v), getColor(String nm, Color v).
Besides that, the behavior of those methods has changed
since JDK 1.2.2 due to incompatible API change( Bug Id 4240252 ).
Here is the example demonstrating the bug:
------------- Test.java -------------------------
public class Test{
public static void main(String[] argv) {
java.awt.Color col = Color.getColor("");
System.out.println(col);
}
}
----------- Output under JDK 1.2.2-W ------------
<..>java -version
java version "1.2.2"
Classic VM (build JDK-1.2.2-W, green threads, sunwjit)
<..>java Test
null
----------- Output under JDK-1.3-K --------------
<..>java -version
java version "1.3"
Classic VM (build JDK-1.3-K, green threads, sunwjit)
<..>java Test
Exception in thread "main" java.lang.IllegalArgumentException: key can't be empty
at java.lang.System.getProperty(System.java, Compiled Code)
at java.lang.Integer.getInteger(Integer.java, Compiled Code)
at java.lang.Integer.getInteger(Integer.java, Compiled Code)
at java.awt.Color.getColor(Color.java, Compiled Code)
at java.awt.Color.getColor(Color.java, Compiled Code)
at Test.main(Test.java, Compiled Code)
======================================================================
- relates to
-
JDK-4240252 java.security.BasicPermission.BasicPermission() throws IllegalArgumentException
-
- Resolved
-