From notifications-return-21540-apmail-ant-notifications-archive=ant.apache.org@ant.apache.org Mon Feb 4 08:02:14 2013 Return-Path: X-Original-To: apmail-ant-notifications-archive@minotaur.apache.org Delivered-To: apmail-ant-notifications-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A1229E416 for ; Mon, 4 Feb 2013 08:02:14 +0000 (UTC) Received: (qmail 1464 invoked by uid 500); 4 Feb 2013 08:02:14 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 1358 invoked by uid 500); 4 Feb 2013 08:02:13 -0000 Mailing-List: contact notifications-help@ant.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ant.apache.org Delivered-To: mailing list notifications@ant.apache.org Received: (qmail 1330 invoked by uid 99); 4 Feb 2013 08:02:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Feb 2013 08:02:12 +0000 Date: Mon, 4 Feb 2013 08:02:12 +0000 (UTC) From: =?utf-8?Q?Fr=C3=A9d=C3=A9ric_RIVIERE_=28JIRA=29?= To: notifications@ant.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (IVY-1400) NullPointerException - problem while listing resources MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/IVY-1400?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D135700= 53#comment-13570053 ]=20 Fr=C3=A9d=C3=A9ric RIVIERE commented on IVY-1400: --------------------------------------- Works fine. Do you think there is a chance to have a 2.3.1 official mainten= ance release ? Or should I wait for 2.4.0 ? =20 > NullPointerException - problem while listing resources > ------------------------------------------------------ > > Key: IVY-1400 > URL: https://issues.apache.org/jira/browse/IVY-1400 > Project: Ivy > Issue Type: Bug > Affects Versions: 2.3.0 > Reporter: Fr=C3=A9d=C3=A9ric RIVIERE > Assignee: Maarten Coene > Priority: Minor > Fix For: 2.4.0 > > > After debugging, the problem appears when using org.apache.ivy.util.url.H= ttpClientHandler (connecting jakarta commons http client).=20 > A check is missing in getURLInfo() when web server does not return conten= t-type in HTTP header. Line 156, method.getResponseHeader("content-type") r= eturns null so NPE occurs when calling getValue(). > Works fine with BasicURLHandler. > Should be something like: > public URLInfo getURLInfo(URL url, int timeout) { > ... > if (checkStatusCode(url, method)) { > HttpResponseHeader h =3D method.getResponseHeader("conten= t-type"); > String contentType =3D h =3D=3D null ? null : h.getValue(= ); > String bodyCharset =3D BasicURLHandler.getCharSetFromCont= entType(contentType); > ... -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs For more information on JIRA, see: http://www.atlassian.com/software/jira