SV: Adding another configuration feature to libjava for arm-elfmetal configurations

Tom Tromey tromey@redhat.com
Fri May 2 06:40:00 GMT 2003


>>>>> "Anthony" == Anthony Green <green@redhat.com> writes:

Anthony> Keep in mind that it's more than just removing things.
Anthony> Sometimes the method APIs look the same, but the behaviour is
Anthony> different - so the annotations would have to be relatively
Anthony> expressive.

Did I ever tell you my idea for this?  Basically it is a form of
conditional compilation for Java:

  public void conditional_method() if (Profile.J2SE)
  { .. }

Profile would be a special class that would have only constants in it.
These would be used to select the profile.  You'd annotate classes,
methods, and fields as above.  In the body of a method you could also
reference Profile (which, unfortunately, isn't as simple as it seems
-- you still have to remove the code at preprocessing time, unless you
teach the compiler about the whole scheme).

Wouldn't this cover the interesting cases?  I like it better than
something like cpp, since it is structural and not textual.

The downside is, probably nobody will implement it.  Though for all I
know there's some Java parser already in rhug that could do the job.
Or I suppose you could modify jalopy... that might not be too hard.


One challenge for any sort of profile scheme is keeping changes
correct.  Before we had the japi pages constantly updated, we had
regressions here.

If there's a reference implementation we could compare against that.
Or if there is an API reference I guess someone could write a tool
for that.

Tom



More information about the Java mailing list