File tree Expand file tree Collapse file tree
rxjava-core/src/main/java/rx Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ public class Notification<T> {
2626 private final Throwable throwable ;
2727 private final T value ;
2828
29+ private static final Notification <Void > ON_COMPLETED = new Notification <Void >(Kind .OnCompleted , null , null );
30+
2931 public static <T > Notification <T > createOnNext (T t ) {
3032 return new Notification <T >(Kind .OnNext , t , null );
3133 }
@@ -34,12 +36,14 @@ public static <T> Notification<T> createOnError(Throwable e) {
3436 return new Notification <T >(Kind .OnError , null , e );
3537 }
3638
39+ @ SuppressWarnings ("unchecked" )
3740 public static <T > Notification <T > createOnCompleted () {
38- return new Notification <T >( Kind . OnCompleted , null , null ) ;
41+ return ( Notification <T >) ON_COMPLETED ;
3942 }
4043
44+ @ SuppressWarnings ("unchecked" )
4145 public static <T > Notification <T > createOnCompleted (Class <T > type ) {
42- return new Notification <T >( Kind . OnCompleted , null , null ) ;
46+ return ( Notification <T >) ON_COMPLETED ;
4347 }
4448
4549 private Notification (Kind kind , T value , Throwable e ) {
You can’t perform that action at this time.
0 commit comments