jdk/src/share/classes/java/lang/reflect/Method.java
changeset 14904 6d9721836463
parent 14342 8435a30053c1
child 14905 ca1bf7f03ffb
equal deleted inserted replaced
14903:7181b5ef130e 14904:6d9721836463
   502     @Override
   502     @Override
   503     public boolean isSynthetic() {
   503     public boolean isSynthetic() {
   504         return super.isSynthetic();
   504         return super.isSynthetic();
   505     }
   505     }
   506 
   506 
       
   507     /**
       
   508      * Returns {@code true} if this method is a default
       
   509      * method; returns {@code false} otherwise.
       
   510      *
       
   511      * A default method is a non-abstract method, that is, a method
       
   512      * with a body, declared in an interface type.
       
   513      *
       
   514      * @return true if and only if this method is a default
       
   515      * method as defined by the Java Language Specification.
       
   516      * @since 1.8
       
   517      */
       
   518     public boolean isDefault() {
       
   519         return (getModifiers() & Modifier.ABSTRACT) == 0 &&
       
   520             getDeclaringClass().isInterface();
       
   521     }
       
   522 
   507     // NOTE that there is no synchronization used here. It is correct
   523     // NOTE that there is no synchronization used here. It is correct
   508     // (though not efficient) to generate more than one MethodAccessor
   524     // (though not efficient) to generate more than one MethodAccessor
   509     // for a given Method. However, avoiding synchronization will
   525     // for a given Method. However, avoiding synchronization will
   510     // probably make the implementation more scalable.
   526     // probably make the implementation more scalable.
   511     private MethodAccessor acquireMethodAccessor() {
   527     private MethodAccessor acquireMethodAccessor() {