Skip to content

Commit 8f8afb0

Browse files
a7medevHeshamMegid
authored andcommitted
refactor: use anonymous class instead of lambda (#1016)
Jira ID: MOB-12977
1 parent 4c94749 commit 8f8afb0

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,15 @@ public void run() {
115115
*/
116116
@ReactMethod
117117
public void init(final String token, final ReadableArray invocationEventValues, final String logLevel) {
118-
MainThreadHandler.runOnMainThread(() -> {
119-
final ArrayList<String> keys = ArrayUtil.parseReadableArrayOfStrings(invocationEventValues);
120-
final ArrayList<InstabugInvocationEvent> parsedInvocationEvents = ArgsRegistry.invocationEvents.getAll(keys);
121-
final InstabugInvocationEvent[] invocationEvents = parsedInvocationEvents.toArray(new InstabugInvocationEvent[0]);
122-
final int parsedLogLevel = ArgsRegistry.sdkLogLevels.getOrDefault(logLevel, LogLevel.ERROR);
123-
RNInstabug.getInstance().init(getCurrentActivity().getApplication(), token, parsedLogLevel, invocationEvents);
118+
MainThreadHandler.runOnMainThread(new Runnable() {
119+
@Override
120+
public void run() {
121+
final ArrayList<String> keys = ArrayUtil.parseReadableArrayOfStrings(invocationEventValues);
122+
final ArrayList<InstabugInvocationEvent> parsedInvocationEvents = ArgsRegistry.invocationEvents.getAll(keys);
123+
final InstabugInvocationEvent[] invocationEvents = parsedInvocationEvents.toArray(new InstabugInvocationEvent[0]);
124+
final int parsedLogLevel = ArgsRegistry.sdkLogLevels.getOrDefault(logLevel, LogLevel.ERROR);
125+
RNInstabug.getInstance().init(getCurrentActivity().getApplication(), token, parsedLogLevel, invocationEvents);
126+
}
124127
});
125128
}
126129

0 commit comments

Comments
 (0)