Skip to content

Commit bdfa008

Browse files
GijsWeteringsfacebook-github-bot
authored andcommitted
Apply Nullsafe FIXMEs for xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/BundleDownloader.java (#50065)
Summary: Pull Request resolved: #50065 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: D71126388 fbshipit-source-id: a9f08b4ce101202cebe13107cc9c6a660deaf58f
1 parent e9e4c2a commit bdfa008

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

+6
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,10 @@ public void onResponse(Call call, final Response response) throws IOException {
141141
// Make sure the result is a multipart response and parse the boundary.
142142
String contentType = response.header("content-type");
143143
Pattern regex = Pattern.compile("multipart/mixed;.*boundary=\"([^\"]+)\"");
144+
// NULLSAFE_FIXME[Parameter Not Nullable]
144145
Matcher match = regex.matcher(contentType);
145146
if (match.find()) {
147+
// NULLSAFE_FIXME[Parameter Not Nullable]
146148
processMultipartResponse(url, r, match.group(1), outputFile, bundleInfo, callback);
147149
} else {
148150
// In case the server doesn't support multipart/mixed responses, fallback to normal
@@ -152,8 +154,10 @@ public void onResponse(Call call, final Response response) throws IOException {
152154
url,
153155
r.code(),
154156
r.headers(),
157+
// NULLSAFE_FIXME[Nullable Dereference]
155158
r.body().source(),
156159
outputFile,
160+
// NULLSAFE_FIXME[Parameter Not Nullable]
157161
bundleInfo,
158162
callback);
159163
}
@@ -173,6 +177,7 @@ private void processMultipartResponse(
173177
throws IOException {
174178

175179
MultipartStreamReader bodyReader =
180+
// NULLSAFE_FIXME[Nullable Dereference]
176181
new MultipartStreamReader(response.body().source(), boundary);
177182
boolean completed =
178183
bodyReader.readAllParts(
@@ -192,6 +197,7 @@ public void onChunkComplete(
192197
status = Integer.parseInt(headers.get("X-Http-Status"));
193198
}
194199
processBundleResult(
200+
// NULLSAFE_FIXME[Parameter Not Nullable]
195201
url, status, Headers.of(headers), body, outputFile, bundleInfo, callback);
196202
} else {
197203
if (!headers.containsKey("Content-Type")

0 commit comments

Comments
 (0)