Hi, Alexander, As I said in the comment http://issues.apache.org/jira/browse/HARMONY-2066 I think it's a bug in the RI.
-----Original Message----- From: Shipilov, Alexander D [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 12, 2006 12:55 PM To: dev@harmony.apache.org Subject: RE: [classlib][awt] RenderingHints.Key.isCompatibleValue(). Method sence. Hi, Andrey, I'm agreeing that in the Harmony implementation a value have to be an instance of KeyValue. I'm also agreeing that straight invocation of method isCompatibleValue() on RI gets correct results. But in case of RenderingHints creation (like in bug) we have incorrect results on RI: RenderingHints localRenderingHints = new RenderingHints( RenderingHints.KEY_ANTIALIASING, new Object()); System.out.println("passed"); RenderingHints localRenderingHints = new RenderingHints( RenderingHints.KEY_ANTIALIASING, null); System.out.println("passed"); RenderingHints localRenderingHints = new RenderingHints( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); System.out.println("passed"); The results on RI are: passed passed passed The results on Harmony are: java.lang.IllegalArgumentException java.lang.IllegalArgumentException passed Is that means that RI has incorrect behavior? I see that you have already added similar comment to the bug :) Thanks, Alexander Shipilov >-----Original Message----- >From: Pavlenko, Andrey A [mailto:[EMAIL PROTECTED] >Sent: Monday, December 11, 2006 8:02 PM >To: dev@harmony.apache.org >Subject: RE: [classlib][awt] RenderingHints.Key.isCompatibleValue(). Method >sence. > >Hi, Alexander, > >In the Harmony implementation a value have to be an instance of >KeyValue, but not Value. See the implementation of the isCompatibleValue >method. > > public boolean isCompatibleValue(Object val) { > if (!(val instanceof KeyValue)) { > return false; > } > > return ((KeyValue)val).key == this; > } > >RI also does not return true in any case, see the following example. > > System.out.println(RenderingHints.KEY_ANTIALIASING > .isCompatibleValue(new Object())); > System.out.println(RenderingHints.KEY_ANTIALIASING > .isCompatibleValue(null)); > System.out.println(RenderingHints.KEY_ANTIALIASING > .isCompatibleValue(RenderingHints.VALUE_ANTIALIAS_ON)); > >Output: >false >false >true >