@Override @CheckResult @SafeVarargs @SuppressWarnings("varargs") public final GlideRequest<TranscodeType> thumbnail(@Nullable RequestBuilder<TranscodeType>... arg0) { return (GlideRequest<TranscodeType>) super.thumbnail(arg0); }
@Test public void multipleAnnotationAddition() { TypeSpec taco = TypeSpec.classBuilder("Taco") .addAnnotations(Arrays.asList( AnnotationSpec.builder(SuppressWarnings.class) .addMember("value", "$S", "unchecked") .build(), AnnotationSpec.builder(Deprecated.class).build())) .build(); assertThat(toString(taco)).isEqualTo("" + "package com.squareup.tacos;\n" + "\n" + "import java.lang.Deprecated;\n" + "import java.lang.SuppressWarnings;\n" + "\n" + "@SuppressWarnings(\"unchecked\")\n" + "@Deprecated\n" + "class Taco {\n" + "}\n"); }
@Override @SuppressWarnings("unchecked") protected boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException { switch(code) { case TRANSACT_methodWithObjectReturn: { data.enforceInterface(this.getInterfaceDescriptor()); final Object returnValue = delegate.methodWithObjectReturn(); reply.writeNoException(); reply.writeValue(returnValue); return true; } } return super.onTransact(code, data, reply, flags); }
@Override @SuppressWarnings("unchecked") protected boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException { switch(code) { case TRANSACT_methodWithObjectParameter: { data.enforceInterface(this.getInterfaceDescriptor()); final Object object = data.readValue(getClass().getClassLoader()); delegate.methodWithObjectParameter(AidlUtil.unsafeCast(object)); reply.writeNoException(); return true; } } return super.onTransact(code, data, reply, flags); }
@Override @SuppressWarnings("aidl2") @Call(1598835019) public Parcelable someMethod() throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); try { data.writeInterfaceToken(AdjustingTransactionIds$$AidlServerImpl.DESCRIPTOR); delegate.transact(AdjustingTransactionIds$$AidlServerImpl.TRANSACT_someMethod, data, reply, 0); reply.readException(); return reply.readParcelable(getClass().getClassLoader()); } finally { data.recycle(); reply.recycle(); } }
@Override @SuppressWarnings({ "wuhahahaha", "chirpkippy" }) public void aMethod() throws IllegalArgumentException, RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); try { data.writeInterfaceToken(MoreSuppressingWarnings$$AidlServerImpl.DESCRIPTOR); delegate.transact(MoreSuppressingWarnings$$AidlServerImpl.TRANSACT_aMethod, data, reply, 0); reply.readException(); } finally { data.recycle(); reply.recycle(); } }
@Override @SuppressWarnings({ "foobar", "all" }) public Object objectReturn() throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); try { data.writeInterfaceToken(MoreSuppressingWarnings$$AidlServerImpl.DESCRIPTOR); delegate.transact(MoreSuppressingWarnings$$AidlServerImpl.TRANSACT_objectReturn, data, reply, 0); reply.readException(); return reply.readValue(getClass().getClassLoader()); } finally { data.recycle(); reply.recycle(); } }
@Override @SuppressWarnings("unchecked") public Object methodWithObjectReturn() throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); try { data.writeInterfaceToken(TheObjectReturn$$AidlServerImpl.DESCRIPTOR); delegate.transact(TheObjectReturn$$AidlServerImpl.TRANSACT_methodWithObjectReturn, data, reply, 0); reply.readException(); return reply.readValue(getClass().getClassLoader()); } finally { data.recycle(); reply.recycle(); } }
/** * @param logger The logger to log exceptions on * @param message A message to use for logging exceptions * @return An interface that will log all exceptions to given logger */ @SuppressWarnings("Duplicates") default ObjLongConsumerWithThrowable<T, E> withLogging(final Logger logger, final String message) { return (final T v1, final long v2) -> { try { acceptWithThrowable(v1, v2); } catch (final Throwable throwable) { logger.error(message, v1, v2, throwable); throw throwable; } }; }
/** * @see GlideOptions#transforms(Transformation<Bitmap>[]) */ @CheckResult @SuppressWarnings({ "unchecked", "varargs" }) public GlideRequest<TranscodeType> transforms(@NonNull Transformation<Bitmap>... arg0) { if (getMutableOptions() instanceof GlideOptions) { this.requestOptions = ((GlideOptions) getMutableOptions()).transforms(arg0); } else { this.requestOptions = new GlideOptions().apply(this.requestOptions).transforms(arg0); } return this; }
@Override @SafeVarargs @SuppressWarnings("varargs") @CheckResult public final GlideOptions transforms(@NonNull Transformation<Bitmap>... arg0) { return (GlideOptions) super.transforms(arg0); }