Repository navigation
Releases
NullAway 0.14.3
Many bug fixes in this release. Thanks especially to @vlsi and @subhramit for
all the contributions! As they are now committers, their many contributions are
not credited individually below.
Two bug fixes of note are #2005 and #2003, which may lead to new warnings even
outside JSpecify mode.
We have also added initial support for @PolyNull in library models in #1813.
We will continue to enhance this support, but it should be helpful in removing
some false positives from JSpecifyExperimental mode.
- Allow configuring suppression-remover source encoding (#1894)
- Compute a call's executable type once per generic inference by @ericschlarmann (#1896)
- Skip nested annotation restoration from raw source types (#1898)
- Refine argument nullness after Objects.equals calls by @Beluomini (#1900)
- Keep nullable map values nullable after
containsKey(#1902) - Read nullable fields from JSpecify JDK models into astubx (#1901)
- Avoid initialization-check crashes in
@NullMarkedconstructors by @ZedingZhang (#1929) - Store types of implicit lambda parameters during inference (#1930)
- Compute erasure before binary promotion (#1935)
- Preserve captured type variables during constraint generation (#1941)
- Cache conversion of MethodSymbols to MethodRefs (#1964)
- Restore nullness annotations from implicit wildcard bounds (#1967)
- Use call-specific generic inference variables (#1965)
- Account for nullable map values in getOrDefault (#1985)
- Fix crash in map callbacks after an unmarked or suppressed filter predicate (#1996)
- Strip reference casts when computing access paths (#1997)
- Handle negated null checks in multi-argument boolean contracts (#1998)
- Skip parentheses around a lambda or method reference passed to unmarked code (#1999)
- Fix crash on method references to annotated array types (#2000)
- Skip a lower-bounded wildcard when restoring annotations on a call type (#2001)
- Strip parentheses before handlers match stream callbacks and boolean literals (#2002)
- Check explicitly typed lambda parameters against unmarked interface methods (#2003)
- Add PolyNull library models and apply them to Optional.orElseGet and Map.computeIfAbsent (#1813)
- Report unboxing of a @nullable operand inside a primitive conditional expression (#2005)
- Report unboxing of a @nullable result inside a primitive switch expression (#2006)
- Fix crash on null-marked code nested in unmarked lambdas and local classes (#2007)
- Strip parentheses before the futures and gRPC handlers match an argument (#2010)
- Recognize boolean constants behind a cast in EnsuresNonNullIf and stream filters (#2011)
- Treat a parenthesized lambda or method reference like an unwrapped one in generics checks (#2012)
- Recognize a cast null check in a boolean contract argument (#2013)
- Keep the access path of a map key, call argument, or array index cast to its own type (#2014)
- Check nested nullness of explicitly typed lambda parameters (#2015)
- Keep distinct constant map keys and call arguments on distinct access paths (#2016)
- Apply conditional library return models to method references (#1968)
- Reject conflicting fixed parameter models regardless of PolyNull (#2025)
- Keep the boxing wrapper in the identity of a variable map key (#2017)
- Maintenance
- Report diff coverage after each test run, quoting the changed lines the run did not execute and the branches it took one way, and writing the whole report to
<module>/build/reports/diff-coverage/test.txt; a// diff-coverage: ignorecomment moves a line out of that list without changing the counts (#1833) - Update Gradle to 9.8.1 (#1915, #1959)
- Update build plugins (#1878, #1917, #1918, #1969)
- Update library and test dependencies (#1884, #1885, #1921, #1922, #1923, #1925, #1927, #1970, #1973, #1974, #1976, #1977, #1978, #1981)
- Update GitHub Actions (#1920, #1928, #1979)
- Decouple build, lint and test CI checks (#1906)
- Update instructions for building jspecify-jdk.astubx (#1914)
- Add script to re-generate jspecify-jdk.astubx (#1916)
- Update dependency python to 3.14 (#1924)
- Update NullAway JMH benchmark to 0.14.2 (#1962)
- Add pitestDiff to mutation-test the lines a branch changed (#1975)
- Tell agents that Error Prone reports every mismatched test line (#2018)
- Update JSpecify JDK astubx (#2020)
- Keep git maintenance from racing temp directory cleanup in buildSrc tests (#2008)
- Pin oracle-actions/setup-java to the v1.5.0 tag (#2021)
- Build third-party projects at pinned commits with patches until upstream merges fixes (#2026)
- Enable zizmor job for merge queue (#2039)
- Report diff coverage after each test run, quoting the changed lines the run did not execute and the branches it took one way, and writing the whole report to
NullAway 0.14.2
This release adds JSpecifyUnrecognizedAnnotationLocation, an opt-in check that reports
nullness annotations in locations JSpecify does not recognize. See further documentation
on the wiki: https://github.com/uber/NullAway/wiki/JSpecify-Support#jspecifyunrecognizedannotationlocation-checker
Not packaged in the release, but we have also added a script to remove unnecessary NullAway
suppressions to the repo: https://github.com/uber/NullAway/tree/master/scripts/nullaway-suppression-remover
We expect this to be a useful script to run after NullAway updates, to check if
NullAway improvements make some suppressions unnecessary.
Also of note, NullAway now more precisely detects whether the JDK used for the build properly
supports reading type use annotations from bytecode, particularly important for JSpecify
mode. This may lead NullAway to crash on certain build configurations that were
unsupported before but we were not detecting precisely.
Beyond the above, this release includes further fixes for JSpecify mode and
JSpecifyExperimental, especially for wildcard bounds and multi-dimensional arrays,
along with other bug fixes.
Finally, we have re-enabled pushing snapshot builds to the Sonatype snapshots repository,
which should ease testing NullAway versions between releases.
- Small optimization for stream handlers (#1774)
- Check wildcard generics handling flag for enhanced for loops (#1786)
- Cover anonymous class type arguments and modeled call-site returns by @vlsi (#1777)
- Write the full encoded byte array when serializing TSV/XML rows #1788 by @AzazelSensei (#1798)
- Fix @RequiresNonNull override error message to list the extra fields added by the child method by @Beluomini (#1751)
- Model Stream.takeWhile (+ reactive equivalents) like .filter by @jeffrey-easyesi (#1809)
- Add
JSpecifyUnrecognizedAnnotationLocation, an opt-in check that reports nullness annotations in locations JSpecify does not recognize by @vlsi (#1787) - Detect support for the addTypeAnnotationsToSymbol flag on JDK 17 / 21 (#1794)
- Fix
RequireExplicitNullMarkingdiagnostics repeating the check name, so a report no longer begins with[RequireExplicitNullMarking] [RequireExplicitNullMarking]by @vlsi (#1815) - Less conservative handling of raw array types (#1807)
- Fix crasher example from Caffeine (#1820)
- Add a script to remove unnecessary NullAway suppressions (#1803)
- Use LinkedHashMap / LinkedHashSet for determinism (#1796)
- Prevent classloader closure from interrupting stubx reads (#1830)
- Preserve non-null type variables through wildcard capture (#1837)
- Treat Maven plugin parameters as externally initialized by @ZedingZhang (#1848)
- Do not treat type variables from the caller as inference variables (#1824)
- Prevent recursion on self-referential wildcard bounds during inference by @adityaanikam (#1843)
- Avoid stale wildcard bounds after javac supertype inspection (#1849)
- Preserve contextual bounds for recursive wildcard captures (#1853)
- Restore effective wildcard upper bounds for invocation types (#1855)
- Preserve wildcard component types for array element assignments (#1857)
- Lazily allocate maps to detect wildcard cycles (#1888)
- Preserve all dimensions of multi-dimensional array creation expressions in JSpecify mode by @dbwiddis (#1711)
- Fix false positives for Spring SpEL expressions using
nullin comparisons by @Beluomini (#1750) - Apply covariant array subtyping at every dimension by @dbwiddis (#1889)
- Maintenance
- Remove outdated Spark test (#1772)
- Disable Jacoco by default (#1773)
- Document MethodRef overload signatures in the sample library model #1016 by @AzazelSensei (#1779)
- Migrate CoreTests to addSourceLines by @abdeltaehass (#1765)
- Fix builds from a linked git worktree by skipping installGitHooks by @vlsi (#1776)
- Add tests for JPA mixed access type and anonymous-class callbacks in Map.forEach by @Beluomini (#1752)
- Add test case for issue #1799 (#1806)
- Document PR squash merging and commit headline style in AGENTS.md by @vlsi (#1810)
- Require an
Assisted-by:commit trailer for AI-assisted work by @vlsi (#1811) - Set up zizmor-action by @ZedingZhang (#1816)
- Tweak CI configuration to prepare for enabling merge queue (#1818)
- Set up Renovate and validate its configuration in CI by @vlsi (#1827)
- Move compilation-unit cleanup out of class matching (#1831)
- Store the nullness analysis in a NullAway field instead of the javac context by @abdeltaehass (#1832)
- Print the failure message and stack trace for a failing test (#1835)
- Add
Assisted-by:text to the PR template and CONTRIBUTING.md (#1838) - Remove code using
getRawTypeAttributesinGenericsChecks(#1844) - Replace deprecated
addSourceFilecalls in AndroidTest by @jabrailkhalil (#1839) - Test NullAway on JDK 27 (#1852)
- Update to Gradle 9.7.1 (#1858)
- Harden GCP benchmark workspace handling (#1865)
- Update GitHub Actions and zizmor-action (#1860, #1861)
- Update Checker Framework dependencies (#1863, #1869)
- Update build plugins (#1864, #1868, #1873, #1874)
- Update library and test dependencies (#1866, #1867, #1870, #1871, #1872, #1876, #1877, #1879, #1880, #1881, #1882, #1883)
- Remove the versions plugin (#1886)
- Update the Caffeine JMH benchmark to 3.3.0 and re-enable its compilation test by @abdeltaehass (#1887)
- Publish snapshots to Maven Central (#1890)
- Add missing dependencies for the Maven Central shadow publication task (#1891)
- Add a workflow for cutting releases (#1892)
NullAway 0.14.1
Several bug fixes in this release, particularly for JSpecifyExperimental.
Thanks to all who tested out this mode, reported bugs, and contributed! Please
continue to test and send feedback. See the 0.14.0 release notes below for
more information on JSpecifyExperimental.
- Fix restoring nullness annotations from an unbounded wildcard to a captured type (#1717)
- JSpecify: support anonymous diamond classes by @subhramit (#1710)
- Fix attribute errors reported during dataflow (#1736)
- Apply library models to an overridden method type when checking overrides (#1722)
- Deduplicate generic inference failure warnings (#1741)
- Preserve nested nullness annotations through inheritance (#1742)
- Fix crash for generic qualifiers in method references (#1744)
- Cache immutable stubx library models (#1745)
- Allow nullable method references for void functions (#1747)
- Preserve nested nullness in enhanced-for variable types (#1748)
- Track nullable elements in enhanced-for dataflow (#1749)
- Honor ignored methods in null-marked library models (#1753)
- Avoid crashes on malformed
@Contractarity (fixes #1726) (#1756) - Inherit null-implies-null models across overrides (#1758)
- Fix inference for annotated type variable uses (#1759)
- Preserve contract unreachability across store joins (#1761)
- Prevent recursion on self-referential wildcard bounds (#1763)
- Work around pre-JDK-25 limitations in reading upper bounds from wildcard arguments in bytecode (#1764)
- Improve diagnostics for non-null type variable bounds (#1770)
- Fix override checks for method type variables bounded by a class type variable by @pivovarit (#1775)
- Maintenance
- Migrate FrameworkTests to
addSourceLinesby @abdeltaehass (#1712) - Attribute errors reported during dataflow to the right file by @vlsi (#1734)
- Disable CodeRabbit summaries (#1755)
- Add tests for overrides of
Collection.toArray(#1757) - Assert the full set of diagnostics for annotated type-variable uses by @vlsi (#1768)
- Document that a
nullImpliesNullmodel applies to overriding methods by @vlsi (#1771) - Add tests for the JSpecify nullness operator by @vlsi (#1767)
- Migrate FrameworkTests to
NullAway 0.14.0
This release has significant improvements to JSpecify support, including
improved support for wildcards and integration of the standard library
nullability annotations from https://github.com/jspecify/jdk. Much of this
new support is gated behind a new JSpecifyExperimental flag, which is off by
default. We disable the flag by default since this new support leads to many
new errors in existing projects (mostly from the new JDK models), and because we
need more real-world testing before enabling it by default. We encourage
projects to enable the JSpecifyExperimental flag (alongside JSpecify mode) and
to report any issues that arise. We expect to turn JSpecifyExperimental on
by default in a future release.
Aside from the above, you may observe some newly reported warnings in JSpecify
mode, due to other checking improvements.
This release also removes the LegacyAnnotationLocations flag. Type-use
annotations must now be placed correctly on qualified and array types, even
outside JSpecify mode, see details here:
https://github.com/uber/NullAway/wiki/JSpecify-Support#type-use-annotation-placement
Beyond the above, we had useful changes from a variety of new contributors;
thanks so much!
- Remove LegacyAnnotationLocations flag (#1640)
- Handle signature-polymorphic calls in InvocationArguments (#1644)
- Fix handling of reference to method with
@Nullableparameter from library model (#1642) - Enable JSpecify JDK models (under a flag) (#1641)
- Enable JSpecify JDK models for regression tests (#1646)
- Fix bug with lambdas assigned to locals with a wildcard in their type (#1647)
- Add JSpecifyExperimental configuration flag (#1648)
- Improve wildcard mismatch diagnostics for identical-looking types (#1627)
- Enable inference failure warnings in experimental mode, and fix related bug in library models (#1649)
- Fix inference bug with generic instance methods (#1654)
- Fixes related to captured types and inference (#1655)
- Augment NullAway error / fix serialization for Annotator auto fix mode by @nimakarimipour (#1322)
- More consistent checks for captured types (#1662)
- Update to JSpecify 1.0.1 (#1665)
- Add test for issue 1671 (#1673)
- Test case and fix for issue 1672 (#1674)
- Fix subtype checking for nested captured types (#1663)
- Handle interaction of captured types and library models (#1666)
- Follow-on fix for restoring annotation on captured type wildcards (#1667)
- Fix subtle issue with invalid TreePaths (#1681)
- Honor @contract when a @nullable method is used as a method reference by @Eljees (#1679)
- Defensively thread path into NestedTypeVarSubstitutionRepairVisitor (#1683)
- More TreePath hardening (#1684)
- Harden TypeSubstitutionUtils type copies (#1669)
- Handle unbound wildcards and interactions with captured types better (#1668)
- Improve error messages involving capture variables (#1675)
- Update JarInfer to skip synthetic methods (#1686)
- Fix bug with storing library model type variable upper bounds (#1687)
- Fixes for processing return array types and multi-dimensional array types in AstubxGenerator (#1689)
- Pretty-print substituted types in bad-override error messages by @dbwiddis (#1697)
- Add test for issue 1693 (#1698)
- JSpecify: support annotated type arguments from an enclosing class by @dbwiddis (#1699)
- Fix crash in @contract dataflow init for zero-argument methods by @dbwiddis (#1701)
- Support method-based conditional library model postconditions by @Shankar-v27 (#1677)
- Update JSpecify JDK astubx (#1702)
- JSpecify: preserve array element nullability through requireNonNull by @kamilkrzywanski (#1645)
- Add positive test cases for annotations on generic method return types by @dbwiddis (#1704)
- Add regression test for inner classes inheriting enclosing type arguments by @dbwiddis (#1703)
- Fix JSpecify false negative when override narrows method type variable bound by @arimu1 (#1682)
- Fix bug with library-modeled return types, method references, and streams (#1706)
- Rename MethodInferenceResult to CallInferenceResult (#1692)
- Generalize generic-call inference internals to call expressions (#1707)
- Basic nullability inference for diamond constructor type arguments (#1708)
- Handle nested generic diamond call inference (#1544)
- Rename getExecutableTypeForInference and improve Javadoc (#1709)
- Maintenance
- Add policy on AI-generated PRs (#1635)
- Enable CodeRabbit reviews for all base branches (#1650)
- Fix Javadoc errors and allow future Javadoc errors to fail the build (#1652)
- Test on JDK 28 early access (#1653)
- Update to latest Shadow plugin (#1658)
- Remove duplicate NestedAnnotationInfo source from NullAway module (#1659)
- Fix Javadoc warnings (#1660)
- Fixes to JarInfer test harness and test inputs (#1670)
- Address zizmor findings (#1676)
- Update to Checker Dataflow 4.2.2 (#1678)
- Convert various classes to records (#1685)
- Update script to use snapshot builds in integration tests (#1691)
- Replace deprecated addSourceFile calls with addSourceLines in FrameworkTests by @dbwiddis (#1695)
- Migrate InitializationTests to addSourceLines by @abdeltaehass (#1694)
- Migrate anonymous class test to addSourceLines by @terminalchai (#1696)
NullAway 0.13.8
Mostly minor bug fixes. Note that NullAway now treats Map.remove as returning @Nullable (#1623), which may lead
to newly-reported warnings.
- Quote syntax element references in error messages by @AryamannSingh7 (#1620)
- Fix stream nullability propagation through sorted() (Fixes #1538) by @dyrpsf (#1610)
- Add support for reactor by @subhramit (#1599)
- Fix issue with passing poly expression to a function parameter with type from library model (#1614)
- Fix crash with library model @nullable being applied to wildcard (#1615)
- Add more modeling for Optional (#1613)
- Update lombok section at README.md by @jevanlingen (#1624)
- Model Map.remove as nullable by @codingkiddo (#1623)
- Better support for conditional expressions in JSpecify mode (#1608)
- Fix issue with reading annotations on record constructor parameters due to javac bug (#1636)
- Maintenance
- Update to Gradle 9.6.1 and AGP 9.3.0 (#1634)
NullAway 0.13.7
This is a minor bug fix release addressing a couple of issues observed in 0.13.6.
NullAway 0.13.6
(NOTE: originally these notes appeared with the 0.13.5 release, but that release was pushed
incorrectly due to an error in our release process.)
Includes various bug fixes, particularly in JSpecify mode. Also, the nullaway-annotations
artifact now includes a @Contract annotation. NullAway also now has a built-in handler
to reason about field initialization in classes managed by Jakarta Persistence.
Work has begun on support for wildcards in JSpecify mode. Currently, this support is off
by default, guarded by the configuration flag HandleWildcardGenerics. The support still
has multiple known bugs, and we do not yet recommend enabling it.
- Initial subtype checking for wildcards (#1520)
- Handle subtype checking for wildcard super bounds (#1547)
- Handle most remaining wildcard subtyping / containment cases (#1548)
- Test case for #1528 (#1556)
- Initial inference for wildcards (#1549)
- Fix wildcard inference bug with method references (#1553)
- Fix nullability for return and parameter wildcards (#1558)
- Test case for trick to assert chain of accesses is non-null (#1566)
- Improve inference failure error message (#1567)
- Adjust more TreePaths to have correct leaf before calling getTreeType (#1570)
- Add Contract annotation to nullaway-annotations by @codingkiddo (#1569)
- Run inference for generic method calls nested inside receivers (#1571)
- Refactor hasAnyAnnotationMatching method (#1583)
- Improve handling of
var-declared local variables (#1573) - Compensate for more annotations inserted by
javac(#1574) - Enable test for issue 1500 and add comment (#1560)
- Use ground target types when handling lambdas and method refs passed to generic methods (#1575)
- Fix for unbounded wildcard passed to
@NullUnmarkedtype variable (#1577) - Detect and warn on annotations directly on wildcard types (#1579)
- Enable HandleWildcardGenerics flag when building NullAway (#1586)
- Report error when @Initializer is used on a constructor by @Vinu2111 (#1546)
- Add a handler for Jakarta Persistence to reason about field initialization (#1584)
- Revert "Report error when @Initializer is used on a constructor (#1546)" (#1588)
- Maintenance
- Use Jacoco 0.8.15 snapshot (#1550)
- Update to Gradle 9.5.0 (#1554)
- Test with latest Error Prone snapshot on CI (#1555)
- Add Spring Boot as an integration test (#1557)
- Enable generic bytecode tests on JDK 17 (#1561)
- Update spotless and guava-latest deps, removed unused semver4j (#1562)
- Use text blocks in more tests (#1563)
- Use text blocks for addInputLines and addOutputLines calls (#1564)
- Use Temurin JDK 17 always in CI (#1565)
- Tell agents not to run multiple Gradle builds in parallel (#1582)
- Update Codecov action to v6 (#1587)
NullAway 0.13.5
DO NOT USE THIS RELEASE. It was pushed incorrectly due to an error in our release process.
Please use version 0.13.6 instead.
NullAway 0.13.4
Fixes a couple of crashes when running NullAway on JDK 27 ea builds. Also modularizes the annotations jar.
- Modularize the annotations JAR by @anthonyvdotbe (#1537)
- Test on JDK 27 EA (#1540)
- Fix crash on JDK 27 (#1541)
- Maintenance
- Run regression tests on JDK 26 (#1526)
- Refactor ThriftTests and Java8Tests to use addSourceLines instead of deprecated addSourceFile by @nanookclaw (#1517)
- Update to WALA 1.7.1 (#1539)
NullAway 0.13.3
Quick follow-up release to 0.13.2 to fix a crash (#1523).
- Add @InjectSoftAssertions to default excluded field annotations by @is-ivanov (#1516)
- Fix check for enclosing
NewClassTree(#1524) - Maintenance