pkl-parser: Migrate nullness to JSpecify (#1515)

This commit is contained in:
odenix
2026-04-14 12:17:17 -07:00
committed by GitHub
parent 2d4286ee7b
commit 1ba54f11a9
63 changed files with 317 additions and 312 deletions
+1 -1
View File
@@ -59,7 +59,7 @@ org.jetbrains.kotlinx:kotlinx-serialization-bom:1.7.3=swiftExportClasspathResolv
org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.7.3=swiftExportClasspathResolvable
org.jetbrains.kotlinx:kotlinx-serialization-core:1.7.3=swiftExportClasspathResolvable
org.jetbrains:annotations:13.0=generatorCompileClasspath,generatorRuntimeClasspath,kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathGenerator,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinInternalAbiValidation,kotlinKlibCommonizerClasspath,swiftExportClasspathResolvable,testCompileClasspath,testRuntimeClasspath
org.jspecify:jspecify:1.0.0=testCompileClasspath
org.jspecify:jspecify:1.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.junit.jupiter:junit-jupiter-api:6.0.3=testCompileClasspath,testRuntimeClasspath
org.junit.jupiter:junit-jupiter-engine:6.0.3=testCompileClasspath,testRuntimeClasspath
org.junit.jupiter:junit-jupiter-params:6.0.3=testCompileClasspath,testRuntimeClasspath
@@ -1,5 +1,5 @@
/*
* Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -52,7 +52,7 @@ import org.pkl.parser.syntax.StringPart.StringChars;
* <li>read expressions
* </ul>
*/
public class ImportsAndReadsParser extends AbstractAstBuilder<@Nullable List<Entry>> {
public class ImportsAndReadsParser extends AbstractAstBuilder<List<Entry>> {
public record Entry(
boolean isModule,
@@ -141,12 +141,11 @@ public class ImportsAndReadsParser extends AbstractAstBuilder<@Nullable List<Ent
}
@Override
protected @Nullable List<Entry> aggregateResult(
@Nullable List<Entry> aggregate, @Nullable List<Entry> nextResult) {
if (aggregate == null || aggregate.isEmpty()) {
protected List<Entry> aggregateResult(List<Entry> aggregate, List<Entry> nextResult) {
if (aggregate.isEmpty()) {
return nextResult;
}
if (nextResult == null || nextResult.isEmpty()) {
if (nextResult.isEmpty()) {
return aggregate;
}
var ret = new ArrayList<Entry>(aggregate.size() + nextResult.size());