[
https://issues.apache.org/jira/browse/BCEL-174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13978072#comment-13978072
]
Emmanuel Bourg commented on BCEL-174:
-------------------------------------
There are two issues here:
- The error message is wrong, the missing modifier on the default methods is
{{ACC_ABSTRACT}} and not {{ACC_STATIC}}
- default methods in Java 8 are obviously not abstract, so this rule doesn't
apply to the class format 52 and above.
Here is the relevant part of the specification:
http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.6
{quote}Methods of interfaces may have any of the flags in Table 4.6-A set
except ACC_PROTECTED, ACC_FINAL, ACC_SYNCHRONIZED, and ACC_NATIVE (JLS ยง9.4).
In a class file whose version number is less than 52.0, each method of an
interface must have its ACC_PUBLIC and ACC_ABSTRACT flags set; in a class file
whose version number is 52.0 or above, each method of an interface must have
exactly one of its ACC_PUBLIC and ACC_PRIVATE flags set.{quote}
> Verification of interfaces with default methods fails with Java 8
> -----------------------------------------------------------------
>
> Key: BCEL-174
> URL: https://issues.apache.org/jira/browse/BCEL-174
> Project: Commons BCEL
> Issue Type: Bug
> Affects Versions: 5.2
> Reporter: Emmanuel Bourg
> Fix For: 6.0
>
>
> With Java 8 the verifier fails to validate interfaces containing default
> methods. For example with the Collection interface it returns this error:
> {code}Interface method 'public boolean removeIf(java.util.function.Predicate
> arg1) [Signature((Ljava/util/function/Predicate<-TE;>;)Z)]' must have the
> ACC_STATIC modifier set but hasn't!{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)