Skip to content
This repository has been archived by the owner on Nov 22, 2024. It is now read-only.

Commit

Permalink
Update SharedPreferencesFlipperPlugin param that received null value …
Browse files Browse the repository at this point in the history
…to Nullable

Summary:
Runtime plugin showed null key passed into onSharedPreferenceChanged. Required buck dependency to allow nullable annotation.

## Context
We are in the process of making the entire codebase Nullsafe. This diff relies on a runtime codemod to track when null is passed into a parameter that is not marked as Nullable in java. Based on runtime data, we can be 100% certain that this parameter needs to be Nullable

Reviewed By: jocelynluizzi13

Differential Revision: D60586640

fbshipit-source-id: 1740e3bbec73186c908ed2cc31f52c0cd5fc12d9
  • Loading branch information
Philip Corriveau authored and facebook-github-bot committed Aug 1, 2024
1 parent a5d9057 commit eaaa841
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Nullable;

public class SharedPreferencesFlipperPlugin implements FlipperPlugin {

Expand All @@ -36,7 +37,8 @@ public class SharedPreferencesFlipperPlugin implements FlipperPlugin {
onSharedPreferenceChangeListener =
new SharedPreferences.OnSharedPreferenceChangeListener() {
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
public void onSharedPreferenceChanged(
SharedPreferences sharedPreferences, @Nullable String key) {
if (mConnection == null) {
return;
}
Expand Down

0 comments on commit eaaa841

Please sign in to comment.