gcj/253: problems with instanceof when compilation from .classfiles

Gregory R. Warnes warnes@biostat.washington.edu
Fri Jun 9 06:14:00 GMT 2000

Well, I just tried recompiling directly from the .java files and gcj
throws lots of compilation errors that the javac compilers don't.   I get
a whole pile of messages like:

/extra/home/warnes/sandbox/Simulation/MCMC/Dissertation/Paper1/BananaTarget.java:41: Incompatible
type for `='. Can't convert
`org.omegahat.Simulation.MCMC.Targets.TwoMultivariateNormalMixture' to
  target = new TwoMultivariateNormalMixture( mean0, cov0,
1 error

where TwoMultiVariateNormalMixture is declared as

public class TwoMultivariateNormalMixture implements UnnormalizedDensity

and target is deslared (in a super class two levels up) as 
protected UnnormalizedDensity target;

As far a I can tell, this is a bug in the gcj .java parser, since it
should be perfectly valid to cast to the superclass.  

I likewise get errors on explicit casts from something declared as
UnnormalizedDensity (or its child GeneralProposal) to


On Wed, 7 Jun 2000, Alexandre Petit-Bianco wrote:

  AP>> Gregory R. Warnes writes:
  AP>> > Based on things posted on the list some time ago I understood that
  AP>> > the source parser didn't handle inner classes, static array
  AP>> > intializing, and a couple of other java features, but that the class
  AP>> > file parser handled these just fine.  Am I mistaken?
  AP>> Yes, and I noticed that Bryce recently patched the FAQ. You can read
  AP>> the entries 2.8 and 4.2
  AP>> If you're running a benchmark, I strongly encourage you to build it
  AP>> from sources instead of from classes. You'll get much better
  AP>> performances. If gcj can't build it from sources because of 1.1
  AP>> issues, well, I'll fix them.
  AP>> ./A

More information about the Java mailing list