@@ -89,7 +89,7 @@ public static <R> Fallback<R> of(CheckedSupplier<? extends R> fallback) {
8989 *
9090 * @throws NullPointerException if {@code fallback} is null
9191 */
92- @ SuppressWarnings ("unchecked" )
92+ @ SuppressWarnings ({ "unchecked" , "rawtypes" } )
9393 public static <R > Fallback <R > of (CheckedConsumer <ExecutionAttemptedEvent <? extends R >> fallback ) {
9494 return new Fallback <>(toFn (Assert .notNull ((CheckedConsumer ) fallback , "fallback" )), null , false );
9595 }
@@ -100,7 +100,7 @@ public static <R> Fallback<R> of(CheckedConsumer<ExecutionAttemptedEvent<? exten
100100 *
101101 * @throws NullPointerException if {@code fallback} is null
102102 */
103- @ SuppressWarnings ("unchecked" )
103+ @ SuppressWarnings ({ "unchecked" , "rawtypes" } )
104104 public static <R > Fallback <R > of (CheckedFunction <ExecutionAttemptedEvent <? extends R >, ? extends R > fallback ) {
105105 return new Fallback <>(Assert .notNull ((CheckedFunction ) fallback , "fallback" ), null , false );
106106 }
@@ -111,7 +111,7 @@ public static <R> Fallback<R> of(CheckedFunction<ExecutionAttemptedEvent<? exten
111111 *
112112 * @throws NullPointerException if {@code fallback} is null
113113 */
114- @ SuppressWarnings ("unchecked" )
114+ @ SuppressWarnings ({ "unchecked" , "rawtypes" } )
115115 public static <R > Fallback <R > ofException (
116116 CheckedFunction <ExecutionAttemptedEvent <? extends R >, ? extends Exception > fallback ) {
117117 Assert .notNull ((CheckedFunction ) fallback , "fallback" );
@@ -121,10 +121,10 @@ public static <R> Fallback<R> ofException(
121121 }
122122
123123 /**
124- * Returns the {@code fallback} result to be returned if execution fails.
124+ * Returns the {@code fallbackResult} to be provided if execution fails.
125125 */
126- public static <R > Fallback <R > of (R fallback ) {
127- return new Fallback <>(toFn (fallback ), null , false );
126+ public static <R > Fallback <R > of (R fallbackResult ) {
127+ return new Fallback <>(toFn (fallbackResult ), null , false );
128128 }
129129
130130 /**
@@ -152,7 +152,7 @@ public static <R> Fallback<R> ofAsync(CheckedSupplier<? extends R> fallback) {
152152 *
153153 * @throws NullPointerException if {@code fallback} is null
154154 */
155- @ SuppressWarnings ("unchecked" )
155+ @ SuppressWarnings ({ "unchecked" , "rawtypes" } )
156156 public static <R > Fallback <R > ofAsync (CheckedConsumer <ExecutionAttemptedEvent <? extends R >> fallback ) {
157157 return new Fallback <>(toFn (Assert .notNull ((CheckedConsumer ) fallback , "fallback" )), null , true );
158158 }
@@ -163,7 +163,7 @@ public static <R> Fallback<R> ofAsync(CheckedConsumer<ExecutionAttemptedEvent<?
163163 *
164164 * @throws NullPointerException if {@code fallback} is null
165165 */
166- @ SuppressWarnings ("unchecked" )
166+ @ SuppressWarnings ({ "unchecked" , "rawtypes" } )
167167 public static <R > Fallback <R > ofAsync (CheckedFunction <ExecutionAttemptedEvent <? extends R >, ? extends R > fallback ) {
168168 return new Fallback <>(Assert .notNull ((CheckedFunction ) fallback , "fallback" ), null , true );
169169 }
@@ -173,6 +173,7 @@ public static <R> Fallback<R> ofAsync(CheckedFunction<ExecutionAttemptedEvent<?
173173 *
174174 * @throws NullPointerException if {@code fallback} is null
175175 */
176+ @ SuppressWarnings ({ "unchecked" , "rawtypes" })
176177 public static <R > Fallback <R > ofStage (CheckedSupplier <? extends CompletionStage <R >> fallback ) {
177178 return new Fallback <>(null , (CheckedFunction ) toFn (Assert .notNull (fallback , "fallback" )), false );
178179 }
@@ -183,6 +184,7 @@ public static <R> Fallback<R> ofStage(CheckedSupplier<? extends CompletionStage<
183184 *
184185 * @throws NullPointerException if {@code fallback} is null
185186 */
187+ @ SuppressWarnings ({ "unchecked" , "rawtypes" })
186188 public static <R > Fallback <R > ofStage (
187189 CheckedFunction <ExecutionAttemptedEvent <? extends R >, ? extends CompletionStage <R >> fallback ) {
188190 return new Fallback <>(null , Assert .notNull ((CheckedFunction ) fallback , "fallback" ), false );
@@ -193,6 +195,7 @@ public static <R> Fallback<R> ofStage(
193195 *
194196 * @throws NullPointerException if {@code fallback} is null
195197 */
198+ @ SuppressWarnings ({ "unchecked" , "rawtypes" })
196199 public static <R > Fallback <R > ofStageAsync (CheckedSupplier <? extends CompletionStage <R >> fallback ) {
197200 return new Fallback <>(null , (CheckedFunction ) toFn (Assert .notNull (fallback , "fallback" )), true );
198201 }
@@ -203,6 +206,7 @@ public static <R> Fallback<R> ofStageAsync(CheckedSupplier<? extends CompletionS
203206 *
204207 * @throws NullPointerException if {@code fallback} is null
205208 */
209+ @ SuppressWarnings ({ "unchecked" , "rawtypes" })
206210 public static <R > Fallback <R > ofStageAsync (
207211 CheckedFunction <ExecutionAttemptedEvent <? extends R >, ? extends CompletionStage <R >> fallback ) {
208212 return new Fallback <>(null , Assert .notNull ((CheckedFunction ) fallback , "fallback" ), true );
@@ -243,6 +247,7 @@ CompletableFuture<R> applyStage(R result, Throwable failure, ExecutionContext co
243247 }
244248
245249 @ Override
250+ @ SuppressWarnings ({ "unchecked" , "rawtypes" })
246251 public PolicyExecutor toExecutor (AbstractExecution execution ) {
247252 return new FallbackExecutor (this , execution , failedAttemptListener );
248253 }
0 commit comments