Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: uber/NullAway
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.12.3
Choose a base ref
...
head repository: uber/NullAway
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.12.4
Choose a head ref
  • 13 commits
  • 31 files changed
  • 5 contributors

Commits on Jan 6, 2025

  1. Configuration menu
    Copy the full SHA
    1e29ca7 View commit details
    Browse the repository at this point in the history

Commits on Jan 25, 2025

  1. Update to Gradle 8.12.1 (#1133)

    To stay up to date
    msridhar authored Jan 25, 2025
    Configuration menu
    Copy the full SHA
    427fa89 View commit details
    Browse the repository at this point in the history

Commits on Jan 31, 2025

  1. Skip checks involving wildcard generic type arguments (#1137)

    We need to handle wildcards eventually, but in the meantime, avoid
    reporting false positives.
    
    Fixes #1126
    msridhar authored Jan 31, 2025
    Configuration menu
    Copy the full SHA
    90265c5 View commit details
    Browse the repository at this point in the history
  2. Properly handle conditional expression within parens as RHS of assign…

    …ment (#1140)
    
    Fixes #1127 
    
    Our previous (hacky) logic for determining the type of a conditional
    expression on the RHS of an assignment did not account for the
    expression possibly being enclosed in parentheses.
    msridhar authored Jan 31, 2025
    Configuration menu
    Copy the full SHA
    18a0a68 View commit details
    Browse the repository at this point in the history

Commits on Feb 3, 2025

  1. Configuration menu
    Copy the full SHA
    f064222 View commit details
    Browse the repository at this point in the history

Commits on Feb 7, 2025

  1. Remove need to use JSpecify's @nullable annotation (#1142)

    Fixes #1139. There are real scenarios where projects may not want to
    ship with a JSpecify dependence; see
    #1139 (comment).
    So, we remove any cases where we were specifically checking for or using
    JSpecify's `@Nullable` annotation.
    
    Most of the code changes are due to the fact that now, we check if an
    annotation is a `@Nullable` annotation using
    `Nullness.hasNullableAnnotation`, which requires a `Config` object as a
    parameter. So we need to thread a `Config` object as a parameter through
    a bunch of methods.
    msridhar authored Feb 7, 2025
    Configuration menu
    Copy the full SHA
    50cb4ab View commit details
    Browse the repository at this point in the history

Commits on Feb 10, 2025

  1. Fix printing of array types in JSpecify errors (#1145)

    Before we would not print nullability of the top-level array type. Also
    improve spacing.
    msridhar authored Feb 10, 2025
    Configuration menu
    Copy the full SHA
    7fa7bf9 View commit details
    Browse the repository at this point in the history
  2. Always acknowledge restrictive annotations in JSpecify mode (#1144)

    Previously, we neglected to acknowledge explicit `@Nullable` return
    types and `@NonNull` parameter types in `@NullUnmarked` code unless the
    `AcknowledgeRestrictiveAnnotations` setting was passed. But, the
    JSpecify spec requires acknowledging restrictive annotations in
    `@NullUnmarked` code. So now, in JSpecify mode, we always acknowledge
    restrictive annotations.
    
    Note that in JSpecify mode, this change will also impact handling of
    other "unannotated" code that is not explicitly annotated
    `@NullUnmarked`. But, as discussed in #978, we want to switch to
    acknowledging restrictive annotations by default anyway. It seems
    reasonable to go ahead and make this change in JSpecify mode, to ensure
    greater spec compliance.
    msridhar authored Feb 10, 2025
    Configuration menu
    Copy the full SHA
    a1df1c4 View commit details
    Browse the repository at this point in the history

Commits on Feb 13, 2025

  1. JSpecify: preserve explicit nullability annotations on type variables…

    … when performing substitutions (#1143)
    
    Fixes #1091 
    
    Consider the following code:
    ```java
    abstract class Test {
      abstract <V> @nullable V foo(Function<@nullable V, @nullable V> f);
      void testPositive(Function<String, String> f) {
         this.<String>foo(f); // error
      }
    } 
    ```
    The call to `foo` should not type check. Since the type of its parameter
    `f` is `Function<@nullable V, @nullable V>`, with explicit `@Nullable`
    annotations on the type variables, any `Function` passed to `foo` must
    have `@Nullable` type arguments. In typechecking this code, NullAway
    previously substituted the type arguments for the type variables in
    `foo` just using built-in `javac` routines. But, this would yield a
    formal parameter type `Function<String, String>`, as the `javac` routine
    would not retain the explicit type arguments in the right places. So we
    would miss reporting an error. This PR fixes the substitutions and
    re-introduces the annotations on type variables, so we get the type
    `Function<@nullable String, @nullable String>` for the formal parameter
    at the call, and report an error correctly. Substitutions were broken in
    other cases as well; substituting `@Nullable V` for `@Nullable V` (where
    `V` is a type variable) yielded just `V`, which led to false positives
    (like #1091).
    
    The main logic changes are in `TypeSubstitutionUtils`. We add a new
    `RestoreNullnessAnnotationsVisitor` and use it to restore nullability
    annotations from type variables after performing a substitution.
    
    We also extract the `TypeMetadataBuilder` logic to a top-level source
    file, and add new methods as needed for this PR. Some of this could have
    been split into a separate PR but it's a bit of a pain to extract it
    now.
    msridhar authored Feb 13, 2025
    Configuration menu
    Copy the full SHA
    6f4cda7 View commit details
    Browse the repository at this point in the history

Commits on Feb 18, 2025

  1. Ignore Spring Framework 6.2 @MockitoBean, @MockitoSpyBean fields (#…

    …1147)
    
    Spring Framework 6.2 introduced two annotations, `@MockitoBean` and
    `@MockitoSpyBean`, that supersede Spring Boot's `@MockBean` and
    `@SpyBean`. Add these annotations to the field ignore list.
    commonquail authored Feb 18, 2025
    Configuration menu
    Copy the full SHA
    4805b0b View commit details
    Browse the repository at this point in the history

Commits on Feb 19, 2025

  1. Add support for local variables for arrays. (#1146)

    I added changes to support local variables specifically for arrays.
    Added a new class `LocalVariableLocation` that will contain location
    details in the scenario when the target is a local variable.
    
    ---------
    
    Co-authored-by: Manu Sridharan <msridhar@gmail.com>
    avenger2597 and msridhar authored Feb 19, 2025
    Configuration menu
    Copy the full SHA
    15c817a View commit details
    Browse the repository at this point in the history

Commits on Feb 25, 2025

  1. Better @MonotonicNonNull support (#1149)

    Fixes #1148 
    
    We add explicit support for any annotation named `@MonotonicNonNull` and
    add our own version of the annotation to our annotations package. The
    main additional support is that we now reason that once assigned a
    non-null value, `@MonotonicNull` fields remain non-null when accessed
    from subsequent lambdas, even if the lambdas are invoked asynchronously.
    msridhar authored Feb 25, 2025
    Configuration menu
    Copy the full SHA
    8e525e6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    282c573 View commit details
    Browse the repository at this point in the history
Loading