Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 38472 invoked from network); 26 Apr 2006 11:14:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 26 Apr 2006 11:14:25 -0000 Received: (qmail 50574 invoked by uid 500); 26 Apr 2006 11:14:25 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 50492 invoked by uid 500); 26 Apr 2006 11:14:25 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 50481 invoked by uid 99); 26 Apr 2006 11:14:25 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Apr 2006 04:14:25 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Apr 2006 04:14:24 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 3259B410005 for ; Wed, 26 Apr 2006 11:14:03 +0000 (GMT) Message-ID: <58327781.1146050043204.JavaMail.root@brutus> Date: Wed, 26 Apr 2006 11:14:03 +0000 (GMT+00:00) From: "Mikhail Loenko (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Closed: (HARMONY-402) java.beans.Beans.InstanceOf(Object bean,Class targetType) method works incorrectly In-Reply-To: <23784553.1145882226092.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/HARMONY-402?page=all ] Mikhail Loenko closed HARMONY-402: ---------------------------------- verified by Svetlana > java.beans.Beans.InstanceOf(Object bean,Class targetType) method works incorrectly > ---------------------------------------------------------------------------------- > > Key: HARMONY-402 > URL: http://issues.apache.org/jira/browse/HARMONY-402 > Project: Harmony > Type: Bug > Components: Classlib > Reporter: Svetlana Samoilenko > Assignee: Mikhail Loenko > Attachments: Beans.diffs, BeansTest.java, ObjectBean.java > > Accodring to java 1.4.2 and 1.5 specifications java.beans.Beans.InstanceOf(Object bean,Class targetType) method returns "true" if the given bean supports the given targetType. > As a result isInstanceOf(Object bean, null) should return false. > Harmony throws NPE in this case and returns false for correct non-null targetType. > > Code for reproduce: > Put ObjectBean class in the same directory as the test. > import java.beans.Beans; > import java.io.*; > > public class test { > public static void main(String[] args) { > ObjectBean bean = new ObjectBean(); > > try { > Class targetType = Externalizable.class; > //correct non-null targetType > System.out.println("***"+Beans.isInstanceOf(bean, targetType)); > } catch (Exception e) { > e.printStackTrace(); > } > > try { > Class targetType = null; > // null targetType > System.out.println("***"+Beans.isInstanceOf(bean, targetType)); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > class ObjectBean implements Externalizable { > public void writeExternal(ObjectOutput out) {}; > public void readExternal(ObjectInput in){}; > } > Harmony output: > ***false > java.lang.NullPointerException > at java.lang.Class.isAssignableFrom(Native Method) > at java.beans.Beans.isInstanceOf(Beans.java:147) > at test.main(test.java:18) > BEA optput: > ***true > ***false > -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira