File tree Expand file tree Collapse file tree
java/ql/src/semmle/code/java Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -361,18 +361,23 @@ class Method extends Callable, @method {
361361 override MethodAccess getAReference ( ) { result = Callable .super .getAReference ( ) }
362362
363363 override predicate isPublic ( ) {
364- Callable .super .isPublic ( ) or
365- // JLS 9.4: Every method declaration in the body of an interface is implicitly public.
366- getDeclaringType ( ) instanceof Interface or
364+ Callable .super .isPublic ( )
365+ or
366+ // JLS 9.4: Every method declaration in the body of an interface without an
367+ // access modifier is implicitly public.
368+ getDeclaringType ( ) instanceof Interface and
369+ not this .isPrivate ( )
370+ or
367371 exists ( FunctionalExpr func | func .asMethod ( ) = this )
368372 }
369373
370374 override predicate isAbstract ( ) {
371375 Callable .super .isAbstract ( )
372376 or
373- // JLS 9.4: An interface method lacking a `default` modifier or a `static` modifier
377+ // JLS 9.4: An interface method lacking a `private`, ` default`, or `static` modifier
374378 // is implicitly abstract.
375379 this .getDeclaringType ( ) instanceof Interface and
380+ not this .isPrivate ( ) and
376381 not this .isDefault ( ) and
377382 not this .isStatic ( )
378383 }
You can’t perform that action at this time.
0 commit comments