Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Compiler bug?



I'm always hesitant to ascribe something to a compiler bug but I've got a problem which is driving me dotty.

I have a project which I've been developing with CodeWarrior. I'm now putting together an ant script to do a clean build and package the application for release. The ant script builds the application without errors, but omits to output one or two inner classes of one particular class! I get XX$55.class and XX$57.class but no $56! When I run the code, not surprisingly, I get a ClassNotFoundError.

I compiled with the verbose flag and and all the other files that are generated are listed, but not the missing one(s).

I tried compiling just the parent class rather than my entire project and this time a couple of other, different inner classes fail to be output ($50 and $51 I think).

Other things I think I've eliminated are ant itself as the culprit (I get the same results running javac from the command line) and memory (I've increased the maximum memory to 256MB). I'm using java 1.4.2_05 under Mac OS X 10.3.8.

If I compile the same code with CodeWarrior, or with the compiler="jikes" option in ant, all the inner classes are generated as expected. However, I can't use jikes because I need to generate 1.1 compatible class files. However, that doesn't seem to be a determining factor as javac fails whether or not I specify the target version.

Has anyone seen anything like this before??

-Rolf

PS. The anonymous inner classes concerned are all property accessors. Essentially, I have the following:

abstract class XyzAccessor
{
  String name;
  XyzAccessor(String name) { this.name = name; }
  public abstract Object getValue(Xyz obj);
}

public static final XyzAccessor FIELD_X = new XyzAccessor("X") {
  public Object getValue(Xyz obj) { return obj.getX(); }
};
public static final XyzAccessor FIELD_Y = new XyzAccessor("Y") {
  public Object getValue(Xyz obj) { return obj.getY(); }
};
etc.

There doesn't seem to be anything special about the particular accessors which are failing.
--
Rolf Howarth, Square Box Systems Ltd, Stratford-upon-Avon UK.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden


This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.