Skip to content

Commit c4e3068

Browse files
GijsWeteringsfacebook-github-bot
authored andcommitted
[skip ci] Apply Nullsafe FIXMEs for xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java (#50067)
Summary: Note this diff is only adding FIXMEs that will be removed in the next diff. This diff exists to make the next diff easily reviewable Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D71126382
1 parent 5b1224a commit c4e3068

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java

+20
Original file line numberDiff line numberDiff line change
@@ -223,13 +223,15 @@ private void logJSException(Exception e) {
223223
if (e instanceof JavascriptException) {
224224
FLog.e(ReactConstants.TAG, "Exception in native call from JS", e);
225225
showNewError(
226+
// NULLSAFE_FIXME[Nullable Dereference]
226227
e.getMessage().toString(), new StackFrame[] {}, JSEXCEPTION_ERROR_COOKIE, ErrorType.JS);
227228
} else {
228229
showNewJavaError(message.toString(), e);
229230
}
230231
}
231232

232233
@Override
234+
// NULLSAFE_FIXME[Inconsistent Subclass Parameter Annotation]
233235
public void showNewJavaError(@Nullable String message, Throwable e) {
234236
FLog.e(ReactConstants.TAG, "Exception in native call", e);
235237
showNewError(
@@ -242,16 +244,19 @@ public void showNewJavaError(@Nullable String message, Throwable e) {
242244
* called.
243245
*/
244246
@Override
247+
// NULLSAFE_FIXME[Inconsistent Subclass Parameter Annotation]
245248
public void addCustomDevOption(String optionName, DevOptionHandler optionHandler) {
246249
mCustomDevOptions.put(optionName, optionHandler);
247250
}
248251

249252
@Override
253+
// NULLSAFE_FIXME[Inconsistent Subclass Parameter Annotation]
250254
public void showNewJSError(String message, ReadableArray details, int errorCookie) {
251255
showNewError(message, StackTraceHelper.convertJsStackTrace(details), errorCookie, ErrorType.JS);
252256
}
253257

254258
@Override
259+
// NULLSAFE_FIXME[Inconsistent Subclass Parameter Annotation]
255260
public void registerErrorCustomizer(ErrorCustomizer errorCustomizer) {
256261
if (mErrorCustomizers == null) {
257262
mErrorCustomizers = new ArrayList<>();
@@ -260,6 +265,7 @@ public void registerErrorCustomizer(ErrorCustomizer errorCustomizer) {
260265
}
261266

262267
@Override
268+
// NULLSAFE_FIXME[Inconsistent Subclass Parameter Annotation]
263269
public Pair<String, StackFrame[]> processErrorCustomizers(Pair<String, StackFrame[]> errorInfo) {
264270
if (mErrorCustomizers != null) {
265271
for (ErrorCustomizer errorCustomizer : mErrorCustomizers) {
@@ -281,10 +287,12 @@ public void hideRedboxDialog() {
281287
mRedBoxSurfaceDelegate.hide();
282288
}
283289

290+
// NULLSAFE_FIXME[Inconsistent Subclass Parameter Annotation]
284291
public @Nullable View createRootView(String appKey) {
285292
return mReactInstanceDevHelper.createRootView(appKey);
286293
}
287294

295+
// NULLSAFE_FIXME[Inconsistent Subclass Parameter Annotation]
288296
public void destroyRootView(View rootView) {
289297
mReactInstanceDevHelper.destroyRootView(rootView);
290298
}
@@ -518,12 +526,14 @@ public View getView(int position, @Nullable View convertView, ViewGroup parent)
518526
mDevOptionsDialog =
519527
new AlertDialog.Builder(context)
520528
.setCustomTitle(header)
529+
// NULLSAFE_FIXME[Not Vetted Third-Party]
521530
.setAdapter(
522531
adapter,
523532
(dialog, which) -> {
524533
optionHandlers[which].onOptionSelected();
525534
mDevOptionsDialog = null;
526535
})
536+
// NULLSAFE_FIXME[Not Vetted Third-Party]
527537
.setOnCancelListener(dialog -> mDevOptionsDialog = null)
528538
.create();
529539
mDevOptionsDialog.show();
@@ -538,6 +548,7 @@ private String getJSExecutorDescription() {
538548
try {
539549
return getReactInstanceDevHelper().getJavaScriptExecutorFactory().toString();
540550
} catch (IllegalStateException e) {
551+
// NULLSAFE_FIXME[Return Not Nullable]
541552
return null;
542553
}
543554
}
@@ -624,6 +635,7 @@ public boolean hasUpToDateJSBundleInCache() {
624635
try {
625636
String packageName = mApplicationContext.getPackageName();
626637
PackageInfo thisPackage =
638+
// NULLSAFE_FIXME[Nullable Dereference]
627639
mApplicationContext.getPackageManager().getPackageInfo(packageName, 0);
628640
if (mJSBundleDownloadedFile.lastModified() > thisPackage.lastUpdateTime) {
629641
// Base APK has not been updated since we downloaded JS, but if app is using exopackage
@@ -663,6 +675,7 @@ private void resetCurrentContext(@Nullable ReactContext reactContext) {
663675
if (mCurrentReactContext != null) {
664676
try {
665677
URL sourceUrl = new URL(getSourceUrl());
678+
// NULLSAFE_FIXME[Nullable Dereference]
666679
String path = sourceUrl.getPath().substring(1); // strip initial slash in path
667680
String host = sourceUrl.getHost();
668681
String scheme = sourceUrl.getProtocol();
@@ -785,6 +798,7 @@ public void onProgress(
785798
}
786799

787800
@Override
801+
// NULLSAFE_FIXME[Inconsistent Subclass Parameter Annotation]
788802
public void onFailure(Exception cause) {
789803
UiThreadUtil.runOnUiThread(
790804
DevSupportManagerBase.this::hideSplitBundleDevLoadingView);
@@ -793,6 +807,7 @@ public void onFailure(Exception cause) {
793807
},
794808
bundleFile,
795809
bundleUrl,
810+
// NULLSAFE_FIXME[Parameter Not Nullable]
796811
null);
797812
});
798813
}
@@ -821,6 +836,7 @@ public void isPackagerRunning(final PackagerStatusCallback callback) {
821836
}
822837

823838
@Override
839+
// NULLSAFE_FIXME[Inconsistent Subclass Parameter Annotation]
824840
public @Nullable File downloadBundleResourceFromUrlSync(
825841
final String resourceURL, final File outputFile) {
826842
return mDevServerHelper.downloadBundleResourceFromUrlSync(resourceURL, outputFile);
@@ -888,6 +904,7 @@ public void onProgress(
888904
}
889905

890906
@Override
907+
// NULLSAFE_FIXME[Inconsistent Subclass Parameter Annotation]
891908
public void onFailure(final Exception cause) {
892909
hideDevLoadingView();
893910
if (mBundleDownloadListener != null) {
@@ -975,6 +992,7 @@ private void reload() {
975992
// start shake gesture detector
976993
if (!mIsShakeDetectorStarted) {
977994
mShakeDetector.start(
995+
// NULLSAFE_FIXME[Parameter Not Nullable]
978996
(SensorManager) mApplicationContext.getSystemService(Context.SENSOR_SERVICE));
979997
mIsShakeDetectorStarted = true;
980998
}
@@ -1060,6 +1078,7 @@ private static String getReloadAppAction(Context context) {
10601078
}
10611079

10621080
@Override
1081+
// NULLSAFE_FIXME[Inconsistent Subclass Parameter Annotation]
10631082
public void setPackagerLocationCustomizer(
10641083
DevSupportManager.PackagerLocationCustomizer packagerLocationCustomizer) {
10651084
mPackagerLocationCustomizer = packagerLocationCustomizer;
@@ -1071,6 +1090,7 @@ public void setPackagerLocationCustomizer(
10711090
}
10721091

10731092
@Override
1093+
// NULLSAFE_FIXME[Inconsistent Subclass Parameter Annotation]
10741094
public @Nullable SurfaceDelegate createSurfaceDelegate(String moduleName) {
10751095
if (mSurfaceDelegateFactory == null) {
10761096
return null;

0 commit comments

Comments
 (0)