pkl-parser: Represent "no children" as an empty list instead of null (#1513)

Motivation:
Facilitate the use of the NullAway checker as part of moving to
JSpecify.

Changes:
- represent "no children" as `List.of()` instead of null
- remove obsolete `children != null` assertions
  - NullAway intentionally ignores such assertions
- remove "no children" special-casing where no longer necessary

Result:
- cleaner code with similar performance
- removed a barrier to using the NullAway checker
This commit is contained in:
odenix
2026-04-09 08:05:34 -07:00
committed by GitHub
parent 2cfd0a0d28
commit 4620992743
33 changed files with 42 additions and 187 deletions

View File

@@ -219,9 +219,6 @@ public class PowerAssertions {
return parserNode;
}
var children = parserNode.children();
if (children == null) {
return null;
}
for (var child : children) {
var found = findParserNode(node, child, offset);
if (found != null) {