Skip to content

Commit 5dbd11a

Browse files
Jami CogswellJami Cogswell
authored andcommitted
Java: move veryPublic predicate
1 parent fa1a6da commit 5dbd11a

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -340,23 +340,23 @@ class Callable extends StmtParent, Member, @callable {
340340
}
341341
}
342342

343+
/**
344+
* Holds if the given type is public and not a nested type.
345+
* If the given type is a nested type, holds if its enclosing type
346+
* is also public.
347+
*/
348+
private predicate veryPublic(RefType t) {
349+
t.isPublic() and
350+
(
351+
not t instanceof NestedType or
352+
veryPublic(t.(NestedType).getEnclosingType())
353+
)
354+
}
355+
343356
/** A callable that is the same as its source declaration. */
344357
class SrcCallable extends Callable {
345358
SrcCallable() { this.isSourceDeclaration() }
346359

347-
/**
348-
* Holds if the given type is public and not a nested type.
349-
* If the given type is a nested type, holds if its enclosing type
350-
* is also public.
351-
*/
352-
private predicate veryPublic(RefType t) {
353-
t.isPublic() and
354-
(
355-
not t instanceof NestedType or
356-
veryPublic(t.(NestedType).getEnclosingType())
357-
)
358-
}
359-
360360
/**
361361
* Holds if this callable is effectively `public`, meaning that it can be
362362
* called outside the codebase.

0 commit comments

Comments
 (0)