[Soot-list] Relaxing Semantic rules for Java?

Bernhard Berger berber at tzi.de
Thu Jul 12 01:06:38 EDT 2012


Hello Marc-Andre,

I've had similar problems with other source code. The cause for the
error message is that the method does not override a method (since there
is no implementation present in the interface). The behavior should be
the same if you compile the code with JDK 5. They changed the behavior
in JDK 6 where this annotation is valid in such situations. See [1] for
more information. I do not use the source-code-based front end, but if
it is configured to compile source code according to Java 1.6 it is a
bug in the front end. With Java 1.5 it is the desired behavior.

Regards,

Bernhard



[1]
http://stackoverflow.com/questions/212614/should-a-method-that-implements-an-interface-method-be-annotated-with-override

On Mi, 2012-07-11 at 21:21 -0400, Marc-Andre Laverdiere-Papineau wrote:
> Hello,
> 
> I am parsing a big code base, Alfresco, and I am getting some parsing 
> errors because of @Override annotations.
> 
> Here are a few, but they're all on the same pattern
> org/alfresco/wcm/client/impl/ResourceBaseImpl.java:110:
>    Semantic Error: method does not override a method from its superclass
> org/alfresco/wcm/client/impl/ResourceBaseImpl.java:119:
>    Semantic Error: method does not override a method from its superclass
> org/alfresco/wcm/client/impl/ResourceBaseImpl.java:129:
>    Semantic Error: method does not override a method from its superclass
> org/alfresco/wcm/client/impl/ResourceBaseImpl.java:138:
>    Semantic Error: method does not override a method from its superclass
> 
> I'm attaching the superclass and the extending class.
> 
> I had this on a previous file, and I 'solved' the problem by deleting 
> the annotations, but I don't feel like doing it for the whole program. ;)
> 
> At a quick glance, I don't see what would be wrong.
> P.S. Note that the original file didn't have the methods public. I added 
> that, but it didn't solve anything
> 
> First: is that a bug in the Java front-end?
> Second: if not, is there an option to relax the semantic rules to get a 
> warning instead?



More information about the Soot-list mailing list