This is the mail archive of the
java-prs@sourceware.cygnus.com
mailing list for the Java project.
Re: gcj/148: Definite assignment problem
- To: apbianco at cygnus dot com
- Subject: Re: gcj/148: Definite assignment problem
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: 16 Feb 2000 10:30:00 -0000
- Cc: java-prs at sourceware dot cygnus dot com,
- Reply-To: Bryce McKinlay <bryce at albatross dot co dot nz>
The following reply was made to PR gcj/148; it has been noted by GNATS.
From: Bryce McKinlay <bryce@albatross.co.nz>
To: java-gnats@sourceware.cygnus.com
Cc:
Subject: Re: gcj/148: Definite assignment problem
Date: Wed, 16 Feb 2000 23:27:24 +1300
Here's my test case for this strange bug:
interface I
{
int huk = 5;
}
public class DA implements I
{
DA(String s) {}
private void tmp(String line)
{
String broken = line.substring(huk);
DA da = new DA(broken);
}
}
produces:
DA.java: In class `DA':
DA.java: In method `tmp(java.lang.String)':
DA.java:13: Variable `broken' may not have been initialized.
DA da = new DA(broken);
Both the static variable being declared in an interface and calling a
constructor with the result appear to be significant. Works fine in 2.95.2
& 19991213. Broken on 20000215. Works fine from .class file.
[ bryce ]