Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 679c4317 authored by Jared Duke's avatar Jared Duke
Browse files

Keep explicit Objects.requireNonNull checks

While we still optimize other auto-generated null checks, keep explicit
Objects.requireNonNull checks. These often have clear semantic and
contextual side effects that are useful to retain even during
optimization, particular when surfaced across API boundaries.

Bug: 411591173
Test: atest ShortcutManagerClientApiTest
Flag: RELEASE_R8_GLOBAL_CHECK_NOT_NULL_FLAGS
Change-Id: I75935ff49b23b021d428dd5c8a7cb35ab5c4c9f5
parent c7bea2b7
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
# Tell R8 that the following methods are check not null methods, and to
# replace invocations to them with a more concise nullness check that produces
# (slightly) less informative error messages
# (slightly) less informative error messages.
# Note that we omit such optimizations for `Objects.requireNonNull`, as such
# messages are explicit and surfaced in the framework across API boundaries.

-convertchecknotnull class com.google.common.base.Preconditions {
  ** checkNotNull(...);
}

-convertchecknotnull class java.util.Objects {
  ** requireNonNull(...);
}

-convertchecknotnull class kotlin.jvm.internal.Intrinsics {
  void checkNotNull(...);
  void checkExpressionValueIsNotNull(...);