Skip to content

Commit 0bce823

Browse files
committed
Java: Remove overwritten NestedType.isStatic() QLDoc
Did not mention nested non-member interfaces and record classes. The documentation of the overridden `isStatic()` predicate already mentions that this predicate holds for explicitly and implicitly static elements, so overwriting it is not necessary and only adds more maintenance work.
1 parent fb1385b commit 0bce823

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

java/ql/lib/semmle/code/java/Type.qll

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -779,23 +779,15 @@ class NestedType extends RefType {
779779
getEnclosingType().isStrictfp()
780780
}
781781

782-
/**
783-
* Holds if this nested type is static.
784-
*
785-
* A nested type is static either if it is explicitly declared as such
786-
* using the modifier `static`, or if it is implicitly static
787-
* because one of the following holds:
788-
*
789-
* - it is a member type of an interface,
790-
* - it is a member interface, or
791-
* - it is a nested enum type.
792-
*
793-
* See JLS v8, section 8.5.1 (Static Member Type Declarations),
794-
* section 8.9 (Enums) and section 9.5 (Member Type Declarations).
795-
*/
796782
override predicate isStatic() {
797783
super.isStatic()
798784
or
785+
/*
786+
* Note: The following is most likely redundant because `isStatic()` of the superclass
787+
* holds for implicitly static types, but keep the special casing below for now to be
788+
* on the safe side
789+
*/
790+
799791
// JLS 8.5.1: A member interface is implicitly static.
800792
this instanceof Interface
801793
or

0 commit comments

Comments
 (0)