private CipherSuite(String javaName) { if (javaName == null) { throw new NullPointerException(); } this.javaName = javaName; }
/** Change the level at which this interceptor logs. */ public HttpLoggingInterceptor setLevel(Level level) { if (level == null) throw new NullPointerException("level == null. Use Level.NONE instead."); this.level = level; return this; }
/** * Customizes the {@code Throwable} with a custom message and wraps it before it * is signalled to the {@code RxJavaPlugins.onError()} handler as {@code OnErrorNotImplementedException}. * * @param message * the message to assign to the {@code Throwable} to signal * @param e * the {@code Throwable} to signal; if null, a NullPointerException is constructed */ public OnErrorNotImplementedException(String message, @NonNull Throwable e) { super(message, e != null ? e : new NullPointerException()); }
@Override public void subscribe(MaybeObserver<? super Object> observer) { throw new NullPointerException("Forced failure"); } }).test();
/** * Constructs a CompositeException with the given array of Throwables as the * list of suppressed exceptions. * @param exceptions the Throwables to have as initially suppressed exceptions * * @throws IllegalArgumentException if <code>exceptions</code> is empty. */ public CompositeException(@NonNull Throwable... exceptions) { this(exceptions == null ? Collections.singletonList(new NullPointerException("exceptions was null")) : Arrays.asList(exceptions)); }
/** * Creates a NullPointerException instance and sets the given Throwable as its initial cause. * @param ex the Throwable instance to use as cause, not null (not verified) * @return the created NullPointerException */ private static NullPointerException toNpe(Throwable ex) { NullPointerException npe = new NullPointerException("Actually not, but can't pass out an exception otherwise..."); npe.initCause(ex); return npe; }
@Override protected void subscribeActual(SingleObserver<? super Integer> observer) { throw new NullPointerException(); } }.test();
@Override public void subscribe(CompletableObserver observer) { throw new NullPointerException(); } }).test();
@SuppressWarnings("ConstantConditions") // Guarding public API nullability. public static <T> Result<T> response(Response<T> response) { if (response == null) throw new NullPointerException("response == null"); return new Result<>(response, null); }
@SuppressWarnings("ConstantConditions") // Guarding public API nullability. public static <T> Result<T> error(Throwable error) { if (error == null) throw new NullPointerException("error == null"); return new Result<>(null, error); }
/** * Returns an instance which creates synchronous observables that * {@linkplain Observable#subscribeOn(Scheduler) subscribe on} {@code scheduler} by default. */ @SuppressWarnings("ConstantConditions") // Guarding public API nullability. public static RxJava2CallAdapterFactory createWithScheduler(Scheduler scheduler) { if (scheduler == null) throw new NullPointerException("scheduler == null"); return new RxJava2CallAdapterFactory(scheduler, false); }
/** Returns a copy of this charset that expects a credential encoded with {@code charset}. */ public Challenge withCharset(Charset charset) { if (charset == null) throw new NullPointerException("charset == null"); Map<String, String> authParams = new LinkedHashMap<>(this.authParams); authParams.put("charset", charset.name()); return new Challenge(scheme, authParams); }
public Builder addEncoded(String name, String value) { if (name == null) throw new NullPointerException("name == null"); if (value == null) throw new NullPointerException("value == null"); names.add(HttpUrl.canonicalize(name, FORM_ENCODE_SET, true, false, true, true, charset)); values.add(HttpUrl.canonicalize(value, FORM_ENCODE_SET, true, false, true, true, charset)); return this; }
@Override public void onError(Throwable t) { if (terminate) { RxJavaPlugins.onError(t); } else { if (t == null) { t = new NullPointerException("onError called with null. Null values are generally not allowed in 2.x operators and sources."); } terminate = true; downstream.onError(t); } }
@Override public void onError(Throwable t) { if (terminate) { RxJavaPlugins.onError(t); } else { if (t == null) { t = new NullPointerException("onError called with null. Null values are generally not allowed in 2.x operators and sources."); } terminate = true; downstream.onError(t); } }
@Override public void onNext(T t) { if (done || isCancelled()) { return; } if (t == null) { onError(new NullPointerException("onNext called with null. Null values are generally not allowed in 2.x operators and sources.")); return; } queue.set(t); drain(); }
@Override public void onNext(T t) { if (t == null) { onError(new NullPointerException("onNext called with null. Null values are generally not allowed in 2.x operators and sources.")); return; } if (!isDisposed()) { observer.onNext(t); } }
@Override public void onNext(T t) { if (done || isCancelled()) { return; } if (t == null) { onError(new NullPointerException("onNext called with null. Null values are generally not allowed in 2.x operators and sources.")); return; } queue.offer(t); drain(); }
@Override public void subscribe(Subscriber<? super Flowable<String>> op) { op.onSubscribe(new BooleanSubscription()); op.onNext(Flowable.unsafeCreate(f1)); op.onNext(Flowable.unsafeCreate(f2)); op.onError(new NullPointerException("throwing exception in parent")); } });
@Override public void subscribe(Observer<? super Observable<String>> op) { op.onSubscribe(Disposables.empty()); op.onNext(Observable.unsafeCreate(o1)); op.onNext(Observable.unsafeCreate(o2)); op.onError(new NullPointerException("throwing exception in parent")); } });