Skip to content

Commit

Permalink
Nullsafe react/common/build (#45652)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #45652

Results of arc nn on the module

Changelog: [Internal]

Reviewed By: arushikesarwani94

Differential Revision: D60188665

fbshipit-source-id: d5322ed15e55a367dc1854177cd533fed90226ee
  • Loading branch information
Thomas Nardone authored and facebook-github-bot committed Jul 25, 2024
1 parent 3df2a86 commit 193117c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@
package com.facebook.react.common;

import androidx.core.util.Pools;
import com.facebook.infer.annotation.Nullsafe;
import javax.annotation.Nullable;

/**
* Like {@link androidx.core.util.Pools.SynchronizedPool} with the option to clear the pool (e.g. on
* memory pressure).
*/
@Nullsafe(Nullsafe.Mode.LOCAL)
public class ClearableSynchronizedPool<T> implements Pools.Pool<T> {

private final Object[] mPool;
Expand All @@ -23,7 +26,7 @@ public ClearableSynchronizedPool(int maxSize) {
}

@Override
public synchronized T acquire() {
public synchronized @Nullable T acquire() {
if (mSize == 0) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

package com.facebook.react.common.build;

import com.facebook.infer.annotation.Nullsafe;
import com.facebook.react.BuildConfig;

/**
Expand All @@ -15,6 +16,7 @@
* and b) we don't have to deal with IntelliJ getting confused about the autogenerated BuildConfig
* class all over the place.
*/
@Nullsafe(Nullsafe.Mode.LOCAL)
public class ReactBuildConfig {

public static final boolean DEBUG = BuildConfig.DEBUG;
Expand Down

0 comments on commit 193117c

Please sign in to comment.