File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
java/ql/src/semmle/code/java Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -361,18 +361,23 @@ class Method extends Callable, @method {
361
361
override MethodAccess getAReference ( ) { result = Callable .super .getAReference ( ) }
362
362
363
363
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
367
371
exists ( FunctionalExpr func | func .asMethod ( ) = this )
368
372
}
369
373
370
374
override predicate isAbstract ( ) {
371
375
Callable .super .isAbstract ( )
372
376
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
374
378
// is implicitly abstract.
375
379
this .getDeclaringType ( ) instanceof Interface and
380
+ not this .isPrivate ( ) and
376
381
not this .isDefault ( ) and
377
382
not this .isStatic ( )
378
383
}
You can’t perform that action at this time.
0 commit comments