[jsr294-modularity-eg] Static compilation
Glyn Normington
glyn_normington at uk.ibm.com
Wed May 2 04:49:51 EDT 2007
Hi Michal
"Michal Cierniak" <cierniak at google.com> wrote on 01/05/2007 18:33:07:
> Glyn, thanks for forwarding! It is an interesting post and it is a
> good point that Java modules may make it easier to guess that methods
> are effectively final but I'm not sure if it can be easily assumed to
> be a guarantee. We haven't talked about such details but my
> assumption was that it should be possible to dynamically load a class
> that extends any non-final class including those classes that are not
> exported. Perhaps this is a good time to discuss this minor issue.
> Have you all had the same expectation? If this is the case then
> modules would not provide the guarantee that Rob is after.
My expectation is different, as you may have guessed.
Suppose a superpackage X contains an unexported, non-final class A and a
class loader is attempting to load a class B that extends A. Let's assume
for simplicity that B is well-formed and does not depend on any other
application code, so A can be loaded if and only if its reference to B can
be resolved.
My understanding of the current strawman leads me to believe that B will
only resolve if it belongs to X. Agreed?
If so, then there is a guarantee of effective finality, assuming the
contents of the superpackage are not modified during class loading. The
latter assumption would, IMO, be reasonable in static compilation
scenarios.
Glyn
P.S. Rob responded in his blog (http://robubu.com/?p=29). I won't keep
forwarding these blogs to the mailing list unless something new and
particularly relevant to JSR 294 arises, so please add his blog to your
feedreader if you want to track it.
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/attachments/20070502/bb030c13/attachment.html
More information about the jsr294-modularity-eg
mailing list