 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Gene McCulley Guest
|
Posted: Fri Feb 06, 2004 1:50 pm Post subject: major version 49? |
|
|
It looks like the JRE classes that come with the 1.5.0 beta have their
major version set to 49. Does anyone know of any documentation
available for this new version of the class file format? It appears
that the signatures can now have "+" prepended to them, which I am
assuming has something to do with generics. I have no idea what other
changes may be in there.
|
|
| Back to top |
|
 |
Chris Uppal Guest
|
Posted: Sat Feb 07, 2004 11:23 am Post subject: Re: major version 49? |
|
|
Gene McCulley wrote:
| Quote: | It looks like the JRE classes that come with the 1.5.0 beta have their
major version set to 49. Does anyone know of any documentation
available for this new version of the class file format? It appears
that the signatures can now have "+" prepended to them, which I am
assuming has something to do with generics. I have no idea what other
changes may be in there.
|
I don't know of any documentation either, but looking at the output of the beta
compiler (and its source), I've seen 5 new attributes.
"Enum": a flag attribute added to classes to signify that they were synthesised
from an enum declaration.
"Bridge": a flag added to methods to indicate that they are the forwarding
methods synthesised to fake covariant returns*.
"Varargs": a flag attribute added to methods to indicate that they were
declared to accept varargs.
"Signature": a new string-values attribute that is used to hold the signature
of generic classes and members before they were subjected to erasure. These
are separate from the real signatures used to name and refer to the real (post
erasure) classes and members. The syntax of the new signature strings is
extended with a T (used the same way as L) to refer to a template type name. I
have no idea what the "+" signatures you mention are, I have not seen them
myself yet -- do you have an easy way to reproduce them ?
"StackMap": a new sub-attribute added to "Code" attributes. I haven't bothered
to try to decode them; the code in the beta compiler that generates them
suggests a fairly complicated internal structure, and they are of no particular
interest for my purposes. AFAIK they hold data generated by the compiler
indicating the layout of the stack and locals at various points of execution,
and are (I'm guessing) intended to ease the job of verification in
resource-restricted environments.
Of course, that's all from observing what the beta compiler does now -- there
is no guarantee that the final compiler will do quite the same thing...
I've read that some of the limits on method and/or constant pool size are to be
removed too, but I have no idea what classfile format changes that will entail.
The beta compiler generates the same basic layout as 1.4 javac, so I assume
that it doesn't have support for the "big" classfile format.
-- chris
[*] Or do I mean variant returns ? I can never sort out varient from
covarient...
|
|
| Back to top |
|
 |
Daniel Guest
|
Posted: Tue Feb 10, 2004 2:02 pm Post subject: Re: major version 49? |
|
|
"Chris Uppal" <chris.uppal (AT) metagnostic (DOT) REMOVE-THIS.org> wrote
| Quote: | I
have no idea what the "+" signatures you mention are, I have not seen them
myself yet -- do you have an easy way to reproduce them ?
|
I noticed this when playing with the 1.5 beta in Netbeans. I added a
type parameter to one of my classes, e.g. MyClass<T>, recompiled it,
and a class appeared in the Netbeans browser with "+" on the end of
its name. I guess a future version of Netbeans will interpret this
information properly in some way.
|
|
| Back to top |
|
 |
Artur Biesiadowski Guest
|
Posted: Sat Feb 14, 2004 11:54 am Post subject: Re: major version 49? |
|
|
Chris Uppal wrote:
| Quote: | [*] Or do I mean variant returns ? I can never sort out varient from
covarient...
|
AFAIK, it is covariant versus contravariant.
For me, memo technique is quite easy. Contra means opposite. So
covariance goes in same direction as inheritance (subclass can
specialize return types/arguments), contravariance other way around
(subclass can generalize return type/argument). In short -
covariance - specialization specializes (return types/arguments)
contravariance - specialization generalizes (return types/arguments)
Artur
|
|
| Back to top |
|
 |
Chris Uppal Guest
|
Posted: Sat Feb 14, 2004 1:04 pm Post subject: Re: major version 49? |
|
|
Artur Biesiadowski wrote:
| Quote: | [*] Or do I mean variant returns ? I can never sort out varient from
covarient...
AFAIK, it is covariant versus contravariant.
|
Yes, you are right -- but you see the difficulty I have remembering it ;-)
| Quote: | For me, memo technique is quite easy. Contra means opposite. So
covariance goes in same direction as inheritance (subclass can
specialize return types/arguments), contravariance other way around
(subclass can generalize return type/argument).
|
Very clear, thanks.
But I bet I'll have fogotten again by the time I next come to talk about the
concepts. Some things just *won't* stay stuck.
Sigh...
-- chris
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|