Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 89766 invoked from network); 2 Jan 2007 12:47:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Jan 2007 12:47:20 -0000 Received: (qmail 42148 invoked by uid 500); 2 Jan 2007 12:47:26 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 42127 invoked by uid 500); 2 Jan 2007 12:47:26 -0000 Mailing-List: contact commits-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 commits@harmony.apache.org Received: (qmail 42118 invoked by uid 99); 2 Jan 2007 12:47:26 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Jan 2007 04:47:26 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Jan 2007 04:47:19 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id BC0BA7142DF for ; Tue, 2 Jan 2007 04:46:27 -0800 (PST) Message-ID: <20869081.1167741987765.JavaMail.jira@brutus> Date: Tue, 2 Jan 2007 04:46:27 -0800 (PST) From: "Tim Ellison (JIRA)" To: commits@harmony.apache.org Subject: [jira] Assigned: (HARMONY-2478) [classlib][net]ContentHandler.getContent(Class[]) determines returned object incorrectly In-Reply-To: <26229986.1165349301065.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 [ http://issues.apache.org/jira/browse/HARMONY-2478?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Tim Ellison reassigned HARMONY-2478: ------------------------------------ Assignee: Tim Ellison > [classlib][net]ContentHandler.getContent(Class[]) determines returned object incorrectly > ---------------------------------------------------------------------------------------- > > Key: HARMONY-2478 > URL: http://issues.apache.org/jira/browse/HARMONY-2478 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: Nikolay Kuznetsov > Assigned To: Tim Ellison > Attachments: harmony-2478.diff, test.java > > > The attached test(which queries new URL("http://www.intel.com").getContent({ Object.class })) fails to return content type properly as RI does: > RI: > java test > content= sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@1b65ab > Harmony: > ./java test > content= null > Content is null > While getContent(_void_) method returns org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection$LimitedInputStream@2061b4bc > The problem here is that in HARMONY implmentation of ContentHandler.getContent(Class[]) uses reference equality to determine returned object instead of instanceof operator, while specification reads that: > "The instanceof operator should be used to determine the specific kind of object returned". > see code sample from ContentHandlers below. > public Object getContent(URLConnection uConn, Class[] types) > throws IOException { > Object content = getContent(uConn); > Class cl = content.getClass(); > for (int i = 0; i < types.length; i++) { > if (cl == types[i]) { //ERROR HERE isInstance should be used !!! > return content; > } > } > return null; > } -- 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