Skip to content

Conversation

@copybara-service
Copy link
Contributor

@copybara-service copybara-service bot commented Sep 22, 2025

Add a missing @Nullable annotation identified by RedundantNullCheck.

Also, use that check as motivation to finally make AbstractBiMap more understandable to nullness checkers. While in the area, I also made inverse be private. That required changing a reference in a subclass in the file to use super.inverse. As I understand it from my experience in 856123e, a private field like inverse is accessible but not inherited (1, 2).

(And marginally simplify a couple AbstractBiMap subclasses by removing unnecessary type arguments.)

RELNOTES=n/a

@copybara-service copybara-service bot changed the title Add a missing @Nullable annotation identified by [RedundantNullCheck](https://github.com/google/error-prone/issues/5107). Add a missing @Nullable annotation identified by [RedundantNullCheck](https://github.com/google/error-prone/pull/5121). Sep 22, 2025
…ck`](google/error-prone#5121).

Also, use that check as motivation to finally make `AbstractBiMap` more understandable to nullness checkers. While in the area, I also made `inverse` be `private`. That required changing a reference in a subclass in the file to use `super.inverse`. As I understand it from my experience in 856123e, a `private` field like `inverse` is [accessible](https://docs.oracle.com/javase/specs/jls/se24/html/jls-6.html#jls-6.6.1) but not inherited ([1](https://docs.oracle.com/javase/specs/jls/se24/html/jls-8.html#d5e13771), [2](https://docs.oracle.com/javase/specs/jls/se24/html/jls-8.html#jls-8.2)).

(And marginally simplify a couple `AbstractBiMap` subclasses by removing unnecessary type arguments.)

RELNOTES=n/a
PiperOrigin-RevId: 810029934
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant