Return-Path: <wmeissner@gmail.com>
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on server.fritz.box
X-Spam-Level: 
X-Spam-Status: No, score=-0.1 required=8.0 tests=DKIM_SIGNED,DKIM_VALID,
	DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=disabled
	version=3.3.1
X-Spam-Tests: DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,
	FREEMAIL_FROM=0.001,RCVD_IN_DNSWL_NONE=-0.0001
X-Spam-Report: 
	*  0.0 FREEMAIL_FROM Sender email is freemail (wmeissner[at]gmail.com)
	* -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, low
	*      trust
	*      [209.85.212.45 listed in list.dnswl.org]
	* -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's
	*       domain
	*  0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily
	*      valid
	* -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
X-Original-To: mvg@localhost
Delivered-To: mvg@localhost.gagern.sytes.net
X-Flags: 0000
Delivered-To: GMX delivery to martin.vgagern@gmx.net
Received: from pop.gmx.net [212.227.17.185]
	by server.fritz.box with POP3 (fetchmail-6.3.17)
	for <mvg@localhost> (single-drop); Wed, 23 Jun 2010 08:54:38 +0200 (CEST)
Received: (qmail invoked by alias); 22 Jun 2010 22:49:49 -0000
Received: from mail-vw0-f45.google.com (EHLO mail-vw0-f45.google.com) [209.85.212.45]
  by mx0.gmx.net (mx115) with SMTP; 23 Jun 2010 00:49:49 +0200
Received: by mail-vw0-f45.google.com with SMTP id 10so416599vws.18
        for <Martin.vGagern@gmx.net>; Tue, 22 Jun 2010 15:49:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:mime-version:received:received:in-reply-to
         :references:date:message-id:subject:from:to:content-type
         :content-transfer-encoding;
        bh=tO6LrEorBumZABUX/apq+eDEA5bIc5UK/5H+XoUn1rM=;
        b=IJGLCKCoAvl3Bxodwee9BuflVFr/cn6iealEXRuudlD03lmk5K6wxf4G4CrKBA951W
         aPaDn/UmKl5DJ1/hoH+JWn+yqGXlPzW6fllVKdFC+mEIn5oL8T1rygpjX8S2HIjsjQ/Q
         3V/HbgiVdnClzAtM/dxQqtTT9tT9me8EpA6u8=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :content-type:content-transfer-encoding;
        b=B5WWbzl4cOhy51QsFkUuddit7VCRG8YUTsU6grwnsaLYFAuu+OD3ti19TaWhwh9beH
         OwbWAUQlIfK8YrY0tJFoML2ZQKD7lmNXCXC67BvYQHeMfVamLpd8ZM6aoPzHp4NryGz0
         YM21uMk2C3wSzvzoNmcQzFyCRyOgQqnzJNpkw=
MIME-Version: 1.0
Received: by 10.220.127.16 with SMTP id e16mr3445522vcs.138.1277245827782; 
	Tue, 22 Jun 2010 15:30:27 -0700 (PDT)
Received: by 10.220.187.129 with HTTP; Tue, 22 Jun 2010 15:30:27 -0700 (PDT)
In-Reply-To: <4C20DFC0.9000107@gmx.net>
References: <4C20DFC0.9000107@gmx.net>
Date: Wed, 23 Jun 2010 08:30:27 +1000
Message-ID: <AANLkTik7bjJNcCoj5hu8caPSBJke3B9agU8isRZGf7Qf@mail.gmail.com>
Subject: Re: jnr-netdb requires Java 6
From: Wayne Meissner <wmeissner@gmail.com>
To: Martin von Gagern <Martin.vGagern@gmx.net>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-GMX-Antivirus: 0 (no virus found)
X-GMX-Antispam: -2 (not scanned, spam filter disabled);
 Detail=5D7Q89H36p4L00VTXC6D4q0N+AH0PUCnKGJbGgJLbSXk30NezpdxUg==V1;
X-GMX-UID: PgkTfcZsIyd1+TR9eWdrxulaa2FkZpV9

Thanks for pointing both those issues out!

Yup, the line.length check should be checking for line.length <1 (or
<=3D 0).  Will apply those changes and update when I get a chance.

btw, if there's anything else needed to make the gentoo build a bit
easier, let me know.

On 23 June 2010 02:07, Martin von Gagern <Martin.vGagern@gmx.net> wrote:
> Dear Wayne,
>
> the jnr-netdb package you develop currently does require Java 6 because
> in jnr/netdb/NetDBIterator.java you make use of String.isEmpty(). It
> would be fairly easy to change that requirement to Java 5 by using a
> String.length() =3D=3D 0 check instead.
>
> I also noticed that the line in question not only has this compatibility
> problem, but has a bug as well: it contains a check for "line.length <
> 0", with line being an array. The length of an array will never be
> negative, and in case of zero length the check won't prevent subsequent
> access to line[0] in case of a zero-length array, thereby leading to an
> ArrayIndexOutOfBoundsException. Haven't experienced this in real life,
> but you should probably fix the code in any case, and perhaps add a test
> case ensuring proper behaviour.
>
> https://bugs.gentoo.org/show_bug.cgi?id=3D325079#c1 has a patch addressin=
g
> both these issues. I'll attach a copy here.
>
> Greetings,
> =A0Martin von Gagern
>

