Repository navigation
Conversation
7dfea38 to
373a392
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2162 +/- ##
============================================
+ Coverage 89.44% 89.61% +0.17%
- Complexity 4009 4128 +119
============================================
Files 113 114 +1
Lines 13148 13567 +419
Branches 2723 2819 +96
============================================
+ Hits 11760 12158 +398
- Misses 624 632 +8
- Partials 764 777 +13 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
NullAway bundled the JSpecify JDK models as jspecify-jdk.astubx, which regenerate-jspecify-jdk.sh produced by building the annotated JSpecify JDK with a javac plugin and converting the result. Updating the models meant rerunning that pipeline by hand and committing a 325 KB binary file. The build now downloads the jspecify-jdk-stubs jar for JDK 28 early access (a GitHub release asset of vlsi/jspecify-jdk-stubs, version jspecifyJdkStubs in gradle/libs.versions.toml) and packs it into the NullAway jar as jspecify-jdk-stubs.jar, with its entries repacked uncompressed. The NullAway jar then compresses the class files as one stream, which is smaller and inflates faster than ~850 entries compressed one by one. JSpecifyJdkStubsReader reads its class files when the models load and fills the same StubxCacheUtil caches, with the keys the astubx file used: methods as javac's MethodSymbol.toString() renders them, fields by flat class name, classes by dotted name. It reads only the constant pool, signatures, InnerClasses, and the JSpecify annotations, and skips method bodies. A class-file library such as ASM would have to be shaded into NullAway for that. Renovate updates jspecifyJdkStubs through a github-releases custom manager; the jdk28-ea classifier is changed by hand. User-visible: A top-level @nonnull on a JDK method parameter is modeled as a non-null parameter, for example the value parameter of Map.merge. java.nio.ByteBuffer is @NullMarked, as the stubs declare it. Non-public JDK members, such as sun.swing.DefaultLookup, are no longer modeled. The NullAway jar grows by about 220 KB: the stubs jar takes 277 KB in it, where the astubx file took about 54 KB. Not changed: @NullUnmarked in the stubs is not modeled; astubx has no slot for it. An annotation on an enclosing type of an inner class, as in Outer<@nullable String>.Inner, is skipped, as the astubx generator skipped it. See apache#2160. Assisted-by: Claude Code (claude-opus-5-5)
373a392 to
f53e126
Compare
Load time and size of the JDK modelsNullAway loads the JDK models once, when MeasurementsEach figure is the CPU time of the loading thread, from the resource stream to the filled
The cold figures also include loading Guava and the NullAway classes both versions use, so only the difference between the rows belongs to the reader. Why the build repacks the stubs jarThe release asset compresses each of its ~850 class files separately. The build repacks it with uncompressed entries, and Where the 9.1 ms goFrom a CPU profile (async-profiler) of the warm load:
Possible follow-ups
|
NullAway bundled the JSpecify JDK models as
jspecify-jdk.astubx, whichregenerate-jspecify-jdk.shproduced by building the annotated JSpecify JDK with a javac plugin and converting the result. Updating the models meant rerunning that pipeline by hand and committing a 325 KB binary file.The build now downloads the jspecify-jdk-stubs jar for JDK 28 early access (a GitHub release asset of vlsi/jspecify-jdk-stubs, version
jspecifyJdkStubsingradle/libs.versions.toml) and packs it into the NullAway jar asjspecify-jdk-stubs.jar, with its entries repacked uncompressed. The NullAway jar then compresses the class files as one stream, which is smaller and inflates faster than ~850 entries compressed one by one.JSpecifyJdkStubsReaderreads its class files when the models load and fills the sameStubxCacheUtilcaches, with the keys the astubx file used: methods as javac'sMethodSymbol.toString()renders them, fields by flat class name, classes by dotted name. It reads only the constant pool, signatures,InnerClasses, and the JSpecify annotations, and skips method bodies. A class-file library such as ASM would have to be shaded into NullAway for that. Renovate updatesjspecifyJdkStubsthrough a github-releases custom manager; thejdk28-eaclassifier is changed by hand.User-visible:
A top-level
@NonNullon a JDK method parameter is modeled as a non-null parameter, for example the value parameter ofMap.merge.java.nio.ByteBufferis@NullMarked, as the stubs declare it.Non-public JDK members, such as
sun.swing.DefaultLookup, are no longer modeled.The NullAway jar grows by about 220 KB: the stubs jar takes 277 KB in it, where the astubx file took about 54 KB.
Not changed:
@NullUnmarkedin the stubs is not modeled; astubx has no slot for it.An annotation on an enclosing type of an inner class, as in
Outer<@Nullable String>.Inner, is skipped, as the astubx generator skipped it.Scope. The build verifies no checksum of the downloaded jar, and a GitHub release asset can be replaced under the same tag, unlike a Maven Central artifact. Pinning a SHA-256 would stop Renovate from updating the version on its own; publishing the stubs to Maven Central would avoid both. That choice is left to the maintainers.
See #2160.
Assisted-by: Claude Code (claude-opus-5-5)
🤖 Generated with Claude Code