This is the mail archive of the java-prs@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gcj/148: Definite assignment problem


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 ]
 
 
 
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]