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

Commit

Permalink
Make toBase64() helper function static
Browse files Browse the repository at this point in the history
Summary:
Context
=
I am creating a flipper plugin to track and show network requests in a waterfall display to help IG App developers for my intern project. Having completed the project on iOS, I am now bringing the plugin to Android

This Diff
=
This diff makes the `toBase64()` helper function in `NetworkFlipperPlugin.java` static. This will allow me to use that function from within `IGNetworkingBehaviorFlipperPlugin.kt` without creating an instance of the `NetworkFlipperPlugin` class.

To avoid a `accidental override: The following declarations have the same JVM signature (toBase64([B)Ljava/lang/String;):` error, this diff removes the `toBase64()` function in `PortalNetworkFlipperPlugin.kt`  This error occurs because `PortalNetworkFlipperPlugin.kt` imports `NetworkFlipperPlugin`, so making the function `public` caused a conflict since both functions had the same name and parameters. Now, `PortalNetworkFlipperPlugin.kt` will use the `toBase64()` function defined in `NetworkFlipperPlugin` (they were identical, so this change won't impact the codebase in any way).

Differential Revision: D59346952

fbshipit-source-id: 4990a06430864b5feda81a190a30e7776a721c1f
  • Loading branch information
Kareem Trevor DaCosta authored and facebook-github-bot committed Jul 10, 2024
1 parent 81b89ba commit b1f2dec
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ protected void runOrThrow() throws Exception {
.run();
}

private String toBase64(@Nullable byte[] bytes) {
public static String toBase64(@Nullable byte[] bytes) {
if (bytes == null) {
return null;
}
Expand Down

0 comments on commit b1f2dec

Please sign in to comment.