Skip to content

Commit

Permalink
Do not throw IOException for init(Context,ExternalSoMapping) (#135)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #135

This mimics the same behavior of `init(Context, boolean)` and lifts the requirement for
Java consumers to catch an exception explicitely.

See facebook/react-native-website#4397

Reviewed By: cipolleschi, Abbondanzo

Differential Revision: D67032849

fbshipit-source-id: 2128e6762f33c52df6f60e2c57a0963bbda5beea
  • Loading branch information
cortinico authored and facebook-github-bot committed Dec 10, 2024
1 parent 0a12aa1 commit 71837f3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions java/com/facebook/soloader/SoLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -328,14 +328,16 @@ public static void init(Context context, boolean nativeExopackage) {
*
* @param context application context
* @param externalSoMapping the custom {@link ExternalSoMapping} if the App is using SoMerging.
* @throws IOException IOException
*/
public static void init(Context context, @Nullable ExternalSoMapping externalSoMapping)
throws IOException {
public static void init(Context context, @Nullable ExternalSoMapping externalSoMapping) {
synchronized (SoLoader.class) {
SoLoader.externalSoMapping = externalSoMapping;
}
init(context, 0);
try {
init(context, 0);
} catch (IOException ex) {
throw new RuntimeException(ex);
}
}

/**
Expand Down

0 comments on commit 71837f3

Please sign in to comment.