Skip to content

Commit

Permalink
@nonnull annotation for ReactPackage (#23415)
Browse files Browse the repository at this point in the history
Summary:
Here are some leftovers from nullable annotations for native modules, discovered while developing native module in Kotlin. This will help improve Kotlin developer experience

[Android] [Changed] - Add Nonnull annotations to ReactPackage
Pull Request resolved: #23415

Differential Revision: D14064607

Pulled By: cpojer

fbshipit-source-id: af2ce1fc1911ee03c54b20a4fc3a6d1aba9267da
  • Loading branch information
dulmandakh authored and grabbou committed Feb 13, 2019
1 parent 818f6bb commit e6d8ac8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ public interface ReactPackage {
* @param reactContext react application context that can be used to create modules
* @return list of native modules to register with the newly created catalyst instance
*/
@Nonnull
List<NativeModule> createNativeModules(@Nonnull ReactApplicationContext reactContext);

/**
* @return a list of view managers that should be registered with {@link UIManagerModule}
*/
@Nonnull
List<ViewManager> createViewManagers(@Nonnull ReactApplicationContext reactContext);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

package com.facebook.react.modules.core;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import android.net.Uri;
Expand All @@ -27,7 +28,7 @@
public class DeviceEventManagerModule extends ReactContextBaseJavaModule {
public static final String NAME = "DeviceEventManager";
public interface RCTDeviceEventEmitter extends JavaScriptModule {
void emit(String eventName, @Nullable Object data);
void emit(@Nonnull String eventName, @Nullable Object data);
}

private final Runnable mInvokeDefaultBackPressRunnable;
Expand Down

0 comments on commit e6d8ac8

Please sign in to comment.