gcj/148: Definite assignment problem
Bryce McKinlay
bryce@albatross.co.nz
Wed Feb 16 02:30:00 GMT 2000
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 ]
More information about the Java-prs
mailing list