25
25
import io .reactivex .exceptions .Exceptions ;
26
26
import io .reactivex .functions .*;
27
27
import io .reactivex .internal .functions .*;
28
- import io .reactivex .internal .operators .flowable .*;
29
28
import io .reactivex .internal .subscribers .LambdaSubscriber ;
30
29
import io .reactivex .internal .util .ExceptionHelper ;
31
30
import io .reactivex .plugins .RxJavaPlugins ;
@@ -1179,7 +1178,7 @@ public final <R> Solo<R> lift(Function<Subscriber<? super R>, Subscriber<? super
1179
1178
* @return the new Flowable instance
1180
1179
*/
1181
1180
public final Flowable <T > repeat () {
1182
- return RxJavaPlugins . onAssembly ( new FlowableRepeat < T >( this , Long . MAX_VALUE ) );
1181
+ return Flowable . fromPublisher ( this ). repeat ( );
1183
1182
}
1184
1183
1185
1184
/**
@@ -1188,10 +1187,7 @@ public final Flowable<T> repeat() {
1188
1187
* @return the new Flowable instance
1189
1188
*/
1190
1189
public final Flowable <T > repeat (long times ) {
1191
- if (times < 0L ) {
1192
- throw new IllegalArgumentException ("times >= 0 required but it was " + times );
1193
- }
1194
- return RxJavaPlugins .onAssembly (new FlowableRepeat <T >(this , times ));
1190
+ return Flowable .fromPublisher (this ).repeat (times );
1195
1191
}
1196
1192
1197
1193
/**
@@ -1202,8 +1198,7 @@ public final Flowable<T> repeat(long times) {
1202
1198
* @return the new Flowable instance
1203
1199
*/
1204
1200
public final Flowable <T > repeat (BooleanSupplier stop ) {
1205
- ObjectHelper .requireNonNull (stop , "stop is null" );
1206
- return RxJavaPlugins .onAssembly (new FlowableRepeatUntil <T >(this , stop ));
1201
+ return Flowable .fromPublisher (this ).repeatUntil (stop );
1207
1202
}
1208
1203
1209
1204
/**
@@ -1215,8 +1210,7 @@ public final Flowable<T> repeat(BooleanSupplier stop) {
1215
1210
* @return the new Flowable instance
1216
1211
*/
1217
1212
public final Flowable <T > repeatWhen (Function <? super Flowable <Object >, ? extends Publisher <?>> handler ) {
1218
- ObjectHelper .requireNonNull (handler , "handler is null" );
1219
- return RxJavaPlugins .onAssembly (new FlowableRepeatWhen <T >(this , handler ));
1213
+ return Flowable .fromPublisher (this ).repeatWhen (handler );
1220
1214
}
1221
1215
1222
1216
/**
0 commit comments