Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 29231 invoked from network); 11 Dec 2006 17:05:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Dec 2006 17:05:07 -0000 Received: (qmail 49671 invoked by uid 500); 11 Dec 2006 17:04:06 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 49604 invoked by uid 500); 11 Dec 2006 17:04:06 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 49326 invoked by uid 99); 11 Dec 2006 17:04:04 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Dec 2006 09:04:03 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [143.182.124.21] (HELO mga03.intel.com) (143.182.124.21) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Dec 2006 09:03:31 -0800 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by mga03.intel.com with ESMTP; 11 Dec 2006 09:02:29 -0800 Received: from fmsmsx334.amr.corp.intel.com ([132.233.42.1]) by azsmga001.ch.intel.com with ESMTP; 11 Dec 2006 09:02:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: i="4.09,521,1157353200"; d="scan'208"; a="156699223:sNHT2089767099" Received: from mssmsx411.ccr.corp.intel.com ([10.125.2.10]) by fmsmsx334.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 11 Dec 2006 09:01:51 -0800 x-mimeole: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [classlib][awt] RenderingHints.Key.isCompatibleValue(). Method sence. Date: Mon, 11 Dec 2006 20:01:48 +0300 Message-ID: <2A786EB15713B544AB79607529273B04753501@mssmsx411> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [classlib][awt] RenderingHints.Key.isCompatibleValue(). Method sence. Thread-Index: AccdEnsrswCM6pP2T/yJ3u7qAeBd1QAMgpUA From: "Pavlenko, Andrey A" To: X-OriginalArrivalTime: 11 Dec 2006 17:01:51.0801 (UTC) FILETIME=[0DB1A290:01C71D46] X-Virus-Checked: Checked by ClamAV on apache.org 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 =3D=3D 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 -----Original Message----- From: Shipilov, Alexander D [mailto:alexander.d.shipilov@intel.com]=20 Sent: Monday, December 11, 2006 1:53 PM To: dev@harmony.apache.org Subject: [classlib][awt] RenderingHints.Key.isCompatibleValue(). Method sence. Hi, folks, I found a JIRA http://issues.apache.org/jira/browse/HARMONY-2066. Essence of this JIRA is a too hard restriction imposed by a method RenderingHints.Key.isCompatibleValue(Object value). Spec says about this method: "Returns true if the specified object is a valid value for this Key." http://java.sun.com/j2se/1.5.0/docs/api/java/awt/RenderingHints.Key.html #isCompatibleValue(java.lang.Object) Harmony implements this method in a following way. It returns true only if the value is an instance of the Key. Why it so? RI returns true in any case, even if the value is just Object, even if the value is null. Should we decrease restriction imposed by this method? Thanks, Alexander Shipilov