Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-releng-dev] improved checking for internal references


As soon as you use a 1.5 constructs (annotations, new for loop, generics, static imports, enums, ....) you need -source 1.5 which requires -target 1.5. So the generated .class file can only run on a 1.5 VM. If you don't use 1.5 constructs, then you can change the source level to what you want 1.4 ou less and have a compatible target level.

Hope I am clear that time :-),

Olivier



Jeff McAffer/Ottawa/IBM@IBMCA
Sent by: platform-releng-dev-admin@xxxxxxxxxxx

2005-02-17 17:00

Please respond to
platform-releng-dev

To
platform-releng-dev@xxxxxxxxxxx
cc
Subject
Re: [platform-releng-dev] improved checking for internal references






Just to be clear, with the 1.5 support you can no longer generate class files for any other Java (1.4, 1.3, ...)? Or is it that you have to flip the big switch and under the covers a 1.4, 1.3, ... compiler is actually being used?


Jeff



Olivier Thomann/Ottawa/IBM@IBMCA
Sent by: platform-releng-dev-admin@xxxxxxxxxxx

02/17/2005 04:18 PM

Please respond to
platform-releng-dev

To
platform-releng-dev@xxxxxxxxxxx
cc
Subject
Re: [platform-releng-dev] improved checking for internal references








Maybe I missed something, but when you use annotations, you need a 1.5 compiler.

Even if you use the SOURCE retention policy, the generated .class file can run only on a 1.5 VM because of the major version being 49 instead of 48 for 1.4 VM. So a 1.4 VM could not run the generated .class file even if it doesn't contain any reference to annotations.


So I don't think this is compatible with the limitation to a subset of the libraries.


Just my 2 cents,


Olivier


Steven Wasleski <wasleski@xxxxxxxxxx>
Sent by: platform-releng-dev-admin@xxxxxxxxxxx

2005-02-17 15:56

Please respond to
platform-releng-dev


To
platform-releng-dev@xxxxxxxxxxx
cc
Subject
Re: [platform-releng-dev] improved checking for internal references









Good tooling will be desirable for what ever annotation method(s) we choose or we run the risk of annotation and intention getting out of sync.  I think we agree that a single source for the information is best now or not so long from now.

As for Java 5 Annotations vs Javadoc, there are good arguments both ways and the RCP point from your comment and the bug are well taken.  However, it might be possible to use these annotations even in this case.  The Java 5 Annotations provide for three different retention policies for different annotation types (
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/annotation/RetentionPolicy.html).  One of them directs the compiler to throw them away.  This essentially makes them fancy Javadoc comments as far as I can tell, but perhaps we could have non-RCP types use a longer retention policy.

I think I could be convinced either way on the Java 5 Annotations vs Javadoc debate.  I think the decisive point would be which one could be more easily and completely tooled, both for authoring annotations for an api and enforcing them as others write code that uses an api.

Thanks,
Steve


Back to the top