Neal Gafter schrieb:
> On Mon, Jan 19, 2009 at 2:07 PM, Jochen Theodorou <[email protected]
> <mailto:[email protected]>> wrote:
>
>
> Jochen Theodorou schrieb:
> > John Wilson schrieb:
> > [...]
> >> I would say that it's behaving correctly. Synthetic methods are not
> >> intended to be visible to programmers (other than via reflection
> when
> >> the programmer explicitly asks to look at synthetic methods).
> >
> > well not visible to the programmer maybe, but I thought visible
> to the
> > compiler they are.
> >
> >> If B is not abstract I presume it will not compile. Is that so?
> >
> > B is not created by javac, only the class C that extends B
>
> I just checked... if B is not abstract, then C compiles.
>
>
> I think javac is acting correctly. It requires that every abstract
> method have an implementation visible to the programmer.
is there any specification on this? I mean I understand that there has
to be an implementation, but that is has to be visible to the
programmer? It doesn't really fit my thinking. Also in the case
interface A<T> {
T foo();
}
abstract class B implements A<String>{
public String foo(){
return null;
}
}
class C extends B {}
how does javac know there is a visible implementation? Adding the bridge
modifier to the synthetic method alone sure does not resolve this.
> If you make B
> not abstract, that means (to javac) that all interface methods have
> already been implemented. javac is wrong, but that's because you've
> fooled it by creating a class B whose user code doesn't implement A but
> that says it does (because the class is not abstract).
So I am just "lucky" that javac does not check this?
If I have a tool that adds an interface and the implementation for the
methods in the interface for the class, then I cannot make that
synthetic even though there is no source representation for it and that
means it should be synthetic? Or is there a way to keep the methods
synthetic and avoid javac complaining about the methods not being
implemented?
bye Jochen
--
Jochen "blackdrag" Theodorou
The Groovy Project Tech Lead (http://groovy.codehaus.org)
http://blackdragsview.blogspot.com/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "JVM
Languages" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jvm-languages?hl=en
-~----------~----~----~----~------~----~------~--~---