diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-common/deployment/src/main/java/io/quarkus/resteasy/reactive/common/deployment/VetoingAnnotationTransformer.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive-common/deployment/src/main/java/io/quarkus/resteasy/reactive/common/deployment/VetoingAnnotationTransformer.java index 9e6e796402319..ea8835bf6002f 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-common/deployment/src/main/java/io/quarkus/resteasy/reactive/common/deployment/VetoingAnnotationTransformer.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-common/deployment/src/main/java/io/quarkus/resteasy/reactive/common/deployment/VetoingAnnotationTransformer.java @@ -13,7 +13,7 @@ * then we need to make sure that Arc doesn't create a bean for it automatically (as it will fail validation because * there is no way to pass the parameter). * For these resources we add {@link jakarta.enterprise.inject.Vetoed}, and we generate custom CDI producers under the hood - * in {@link CustomResourceProducersGenerator#generate}. + * in {@code io.quarkus.resteasy.reactive.server.deployment.CustomResourceProducersGenerator#generate}. */ public class VetoingAnnotationTransformer implements AnnotationsTransformer { diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-common/runtime/src/main/java/io/quarkus/resteasy/reactive/common/runtime/JaxRsSecurityConfig.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive-common/runtime/src/main/java/io/quarkus/resteasy/reactive/common/runtime/JaxRsSecurityConfig.java index 394d53631bfc4..b635f86edb217 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-common/runtime/src/main/java/io/quarkus/resteasy/reactive/common/runtime/JaxRsSecurityConfig.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-common/runtime/src/main/java/io/quarkus/resteasy/reactive/common/runtime/JaxRsSecurityConfig.java @@ -23,7 +23,7 @@ public interface JaxRsSecurityConfig { * If no security annotations are affecting a method then they will default to requiring these roles, * (equivalent to adding an @RolesAllowed annotation with the roles to every endpoint class). * - * The role of '**' means any authenticated user, which is equivalent to the {@link io.quarkus.security.Authenticated} + * The role of '**' means any authenticated user, which is equivalent to the {@code io.quarkus.security.Authenticated} * annotation. */ Optional> defaultRolesAllowed(); diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-common/runtime/src/main/java/io/quarkus/resteasy/reactive/common/runtime/ResteasyReactiveCommonRecorder.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive-common/runtime/src/main/java/io/quarkus/resteasy/reactive/common/runtime/ResteasyReactiveCommonRecorder.java index 1fdc0c5aa0467..b5044a6331e8e 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-common/runtime/src/main/java/io/quarkus/resteasy/reactive/common/runtime/ResteasyReactiveCommonRecorder.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-common/runtime/src/main/java/io/quarkus/resteasy/reactive/common/runtime/ResteasyReactiveCommonRecorder.java @@ -1,7 +1,5 @@ package io.quarkus.resteasy.reactive.common.runtime; -import java.util.Collections; -import java.util.HashMap; import java.util.Map; import org.jboss.resteasy.reactive.common.core.Serialisers; @@ -14,19 +12,15 @@ @Recorder public class ResteasyReactiveCommonRecorder { - private static final Map> primitiveTypes; - static { - Map> prims = new HashMap<>(); - prims.put(byte.class.getName(), byte.class); - prims.put(boolean.class.getName(), boolean.class); - prims.put(char.class.getName(), char.class); - prims.put(short.class.getName(), short.class); - prims.put(int.class.getName(), int.class); - prims.put(float.class.getName(), float.class); - prims.put(double.class.getName(), double.class); - prims.put(long.class.getName(), long.class); - primitiveTypes = Collections.unmodifiableMap(prims); - } + private static final Map> primitiveTypes = Map.of( + byte.class.getName(), byte.class, + boolean.class.getName(), boolean.class, + char.class.getName(), char.class, + short.class.getName(), short.class, + int.class.getName(), int.class, + float.class.getName(), float.class, + double.class.getName(), double.class, + long.class.getName(), long.class); public BeanFactory factory(String targetClass, BeanContainer beanContainer) { return new ArcBeanFactory<>(loadClass(targetClass), diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-kotlin/deployment/src/main/java/io/quarkus/resteasy/reactive/kotlin/deployment/KotlinCoroutineIntegrationProcessor.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive-kotlin/deployment/src/main/java/io/quarkus/resteasy/reactive/kotlin/deployment/KotlinCoroutineIntegrationProcessor.java index a8bea26a4f378..251197554ed3a 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-kotlin/deployment/src/main/java/io/quarkus/resteasy/reactive/kotlin/deployment/KotlinCoroutineIntegrationProcessor.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-kotlin/deployment/src/main/java/io/quarkus/resteasy/reactive/kotlin/deployment/KotlinCoroutineIntegrationProcessor.java @@ -125,7 +125,7 @@ public boolean isMethodSignatureAsync(MethodInfo info) { * This method generates the same invocation code as for the standard invoker but also passes along the implicit * {@code Continuation} argument provided by kotlinc and the coroutines library. * - * @see io.quarkus.resteasy.reactive.server.deployment.QuarkusInvokerFactory#create(ResourceMethod, ClassInfo, MethodInfo) + * See: io.quarkus.resteasy.reactive.server.deployment.QuarkusInvokerFactory#create(ResourceMethod, ClassInfo, MethodInfo) */ private Supplier createCoroutineInvoker(ClassInfo currentClassInfo, MethodInfo info, BuildProducer generatedClassBuildItemBuildProducer, diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive/runtime/src/main/java/io/quarkus/resteasy/reactive/server/runtime/ResteasyReactiveRuntimeRecorder.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive/runtime/src/main/java/io/quarkus/resteasy/reactive/server/runtime/ResteasyReactiveRuntimeRecorder.java index af2fa0ff05c17..3841f55a4130c 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive/runtime/src/main/java/io/quarkus/resteasy/reactive/server/runtime/ResteasyReactiveRuntimeRecorder.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive/runtime/src/main/java/io/quarkus/resteasy/reactive/server/runtime/ResteasyReactiveRuntimeRecorder.java @@ -49,7 +49,7 @@ public RuntimeConfiguration get() { }; } - @SuppressWarnings({ "unchecked", "rawtypes" }) + @SuppressWarnings({ "unchecked", "rawtypes", "ForLoopReplaceableByForEach" }) public void configureHandlers(RuntimeValue deployment, Map, Supplier> runtimeConfigMap) { List> runtimeConfigurableServerRestHandlers = deployment.getValue() .getRuntimeConfigurableServerRestHandlers(); diff --git a/extensions/resteasy-reactive/rest-client-reactive/runtime/src/main/java/io/quarkus/rest/client/reactive/runtime/ResteasyReactiveResponseRedirectHandler.java b/extensions/resteasy-reactive/rest-client-reactive/runtime/src/main/java/io/quarkus/rest/client/reactive/runtime/ResteasyReactiveResponseRedirectHandler.java index 1dcf290e69ee9..13eb6a5bf53aa 100644 --- a/extensions/resteasy-reactive/rest-client-reactive/runtime/src/main/java/io/quarkus/rest/client/reactive/runtime/ResteasyReactiveResponseRedirectHandler.java +++ b/extensions/resteasy-reactive/rest-client-reactive/runtime/src/main/java/io/quarkus/rest/client/reactive/runtime/ResteasyReactiveResponseRedirectHandler.java @@ -15,6 +15,6 @@ default URI handle(Response response) { @Override default RedirectHandler getContext(Class aClass) { - return response -> handle(response); + return this::handle; } } diff --git a/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/HandlerChain.java b/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/HandlerChain.java index c518a68c629aa..af7e1f76ae881 100644 --- a/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/HandlerChain.java +++ b/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/HandlerChain.java @@ -20,6 +20,7 @@ import org.jboss.resteasy.reactive.client.spi.MultipartResponseData; import org.jboss.resteasy.reactive.common.jaxrs.ConfigurationImpl; +@SuppressWarnings("ForLoopReplaceableByForEach") class HandlerChain { private static final ClientRestHandler[] EMPTY_REST_HANDLERS = new ClientRestHandler[0]; diff --git a/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/MultiInvoker.java b/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/MultiInvoker.java index ead3b0a0ef12a..e3a8820add5f4 100644 --- a/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/MultiInvoker.java +++ b/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/MultiInvoker.java @@ -159,18 +159,12 @@ private void registerForSse(MultiRequest multiRequest, SseEventSourceImpl sseSource = new SseEventSourceImpl(invocationBuilder.getTarget(), invocationBuilder, Integer.MAX_VALUE, TimeUnit.SECONDS); - multiRequest.onCancel(() -> { - sseSource.close(); - }); + multiRequest.onCancel(sseSource::close); sseSource.register(event -> { // DO NOT pass the response mime type because it's SSE: let the event pick between the X-SSE-Content-Type header or // the content-type SSE field multiRequest.emit(event.readData(responseType)); - }, error -> { - multiRequest.fail(error); - }, () -> { - multiRequest.complete(); - }); + }, multiRequest::fail, multiRequest::complete); // watch for user cancelling sseSource.registerAfterRequest(vertxResponse); } diff --git a/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/EndpointIndexer.java b/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/EndpointIndexer.java index 86008ba946ea9..20a679649c4b2 100644 --- a/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/EndpointIndexer.java +++ b/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/EndpointIndexer.java @@ -82,7 +82,6 @@ import java.nio.charset.StandardCharsets; import java.util.AbstractMap; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; @@ -135,22 +134,15 @@ public abstract class EndpointIndexer primitiveTypes; private static final Map> supportedReaderJavaTypes; + // spec // NOTE: sync with ContextProducer and ContextParamExtractor - private static final Set DEFAULT_CONTEXT_TYPES = Collections.unmodifiableSet(new HashSet<>(Arrays.asList( - // spec - URI_INFO, - HTTP_HEADERS, - REQUEST, - SECURITY_CONTEXT, - PROVIDERS, - RESOURCE_CONTEXT, - CONFIGURATION, - SSE, + private static final Set DEFAULT_CONTEXT_TYPES = Set.of(URI_INFO, HTTP_HEADERS, REQUEST, SECURITY_CONTEXT, + PROVIDERS, RESOURCE_CONTEXT, CONFIGURATION, SSE, SSE_EVENT_SINK, // extras SERVER_REQUEST_CONTEXT, DotName.createSimple("org.jboss.resteasy.reactive.server.SimpleResourceInfo"), //TODO: fixme - RESOURCE_INFO))); + RESOURCE_INFO); protected static final Set SUPPORT_TEMPORAL_PARAMS = Set.of(INSTANT, LOCAL_DATE, LOCAL_TIME, LOCAL_DATE_TIME, OFFSET_TIME, diff --git a/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/HashUtil.java b/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/HashUtil.java index 0fd5dc157e78f..1b01d6e14c875 100644 --- a/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/HashUtil.java +++ b/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/HashUtil.java @@ -4,6 +4,7 @@ import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; +@SuppressWarnings("ForLoopReplaceableByForEach") public final class HashUtil { private HashUtil() { diff --git a/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/PathPart.java b/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/PathPart.java index 371cdd51be0e4..2db41c88b7adf 100644 --- a/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/PathPart.java +++ b/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/PathPart.java @@ -28,7 +28,7 @@ public class PathPart { /** * Create a new partial {@link Path} object. * - * @param path The file to send + * @param file The file to send * @param offset The starting byte of the file (must be >= 0) * @param count The number of bytes to send (must be >= 0 and offset+count <= file size) */ diff --git a/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/core/Serialisers.java b/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/core/Serialisers.java index 9daa23b1097ff..b214cc5691aab 100644 --- a/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/core/Serialisers.java +++ b/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/core/Serialisers.java @@ -28,6 +28,7 @@ import org.jboss.resteasy.reactive.common.util.QuarkusMultivaluedHashMap; import org.jboss.resteasy.reactive.common.util.QuarkusMultivaluedMap; +@SuppressWarnings("ForLoopReplaceableByForEach") public abstract class Serialisers { public static final Annotation[] NO_ANNOTATION = new Annotation[0]; public static final ReaderInterceptor[] NO_READER_INTERCEPTOR = new ReaderInterceptor[0]; diff --git a/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/jaxrs/ResponseImpl.java b/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/jaxrs/ResponseImpl.java index b35ef6614dd65..6d167482c9456 100644 --- a/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/jaxrs/ResponseImpl.java +++ b/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/jaxrs/ResponseImpl.java @@ -36,7 +36,7 @@ * This is the Response class for user-created responses. The client response * object has more deserialising powers in @{link {@link io.quarkus.rest.server.runtime.client.QuarkusRestClientResponse}. */ -@SuppressWarnings("JavadocReference") +@SuppressWarnings({ "JavadocReference", "ForLoopReplaceableByForEach" }) public class ResponseImpl extends Response { int status; diff --git a/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/jaxrs/RestResponseImpl.java b/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/jaxrs/RestResponseImpl.java index 142ebb122bc2c..3f3dbb2a5fcbb 100644 --- a/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/jaxrs/RestResponseImpl.java +++ b/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/jaxrs/RestResponseImpl.java @@ -37,7 +37,7 @@ * This is the Response class for user-created responses. The client response * object has more deserialising powers in @{link {@link io.quarkus.rest.server.runtime.client.QuarkusRestClientResponse}. */ -@SuppressWarnings("JavadocReference") +@SuppressWarnings({ "JavadocReference", "ForLoopReplaceableByForEach" }) public class RestResponseImpl extends RestResponse { int status; diff --git a/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/model/ResourceReader.java b/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/model/ResourceReader.java index 538c6194e5a48..23930a80f5858 100644 --- a/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/model/ResourceReader.java +++ b/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/model/ResourceReader.java @@ -13,6 +13,7 @@ import org.jboss.resteasy.reactive.common.util.MediaTypeHelper; import org.jboss.resteasy.reactive.spi.BeanFactory; +@SuppressWarnings("ForLoopReplaceableByForEach") public class ResourceReader { private BeanFactory> factory; diff --git a/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/model/ResourceWriter.java b/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/model/ResourceWriter.java index dae02708bc64e..5de3a260ba4ed 100644 --- a/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/model/ResourceWriter.java +++ b/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/model/ResourceWriter.java @@ -15,6 +15,7 @@ import org.jboss.resteasy.reactive.common.util.ServerMediaType; import org.jboss.resteasy.reactive.spi.BeanFactory; +@SuppressWarnings("ForLoopReplaceableByForEach") public class ResourceWriter { private BeanFactory> factory; diff --git a/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/util/DeploymentUtils.java b/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/util/DeploymentUtils.java index 16ac21ebbe4d6..95694a4dbf612 100644 --- a/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/util/DeploymentUtils.java +++ b/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/util/DeploymentUtils.java @@ -1,7 +1,5 @@ package org.jboss.resteasy.reactive.common.util; -import java.util.Collections; -import java.util.HashMap; import java.util.Map; import org.jboss.resteasy.reactive.common.core.Serialisers; @@ -9,20 +7,15 @@ import org.jboss.resteasy.reactive.common.model.ResourceWriter; public abstract class DeploymentUtils { - private static final Map> primitiveTypes; - - static { - Map> prims = new HashMap<>(); - prims.put(byte.class.getName(), byte.class); - prims.put(boolean.class.getName(), boolean.class); - prims.put(char.class.getName(), char.class); - prims.put(short.class.getName(), short.class); - prims.put(int.class.getName(), int.class); - prims.put(float.class.getName(), float.class); - prims.put(double.class.getName(), double.class); - prims.put(long.class.getName(), long.class); - primitiveTypes = Collections.unmodifiableMap(prims); - } + private static final Map> primitiveTypes = Map.of( + byte.class.getName(), byte.class, + boolean.class.getName(), boolean.class, + char.class.getName(), char.class, + short.class.getName(), short.class, + int.class.getName(), int.class, + float.class.getName(), float.class, + double.class.getName(), double.class, + long.class.getName(), long.class); public static void registerWriter(Serialisers serialisers, String entityClassName, ResourceWriter writer) { diff --git a/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/util/MediaTypeHelper.java b/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/util/MediaTypeHelper.java index eeea0e58cfd2a..81cedd7b62c60 100644 --- a/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/util/MediaTypeHelper.java +++ b/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/util/MediaTypeHelper.java @@ -15,7 +15,7 @@ /** * @author Bill Burke */ -@SuppressWarnings(value = "rawtypes") +@SuppressWarnings({ "ForLoopReplaceableByForEach" }) public class MediaTypeHelper { public static final MediaTypeComparator Q_COMPARATOR = new MediaTypeComparator("q"); public static final MediaTypeComparator QS_COMPARATOR = new MediaTypeComparator("qs"); diff --git a/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/util/ParameterParser.java b/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/util/ParameterParser.java index fe2652ced1323..8812bf5d23577 100644 --- a/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/util/ParameterParser.java +++ b/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/util/ParameterParser.java @@ -15,6 +15,7 @@ * @author Oleg Kalnichevski */ +@SuppressWarnings("ForLoopReplaceableByForEach") public class ParameterParser { /** * String to be parsed. diff --git a/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/util/types/TypeVariableImpl.java b/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/util/types/TypeVariableImpl.java index 4ef44b7adcbb3..fa06da739cab6 100644 --- a/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/util/types/TypeVariableImpl.java +++ b/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/util/types/TypeVariableImpl.java @@ -10,6 +10,7 @@ public class TypeVariableImpl implements TypeVariable { + private static final Type[] EMPTY_TYPES_ARRAY = new Type[0]; private final String name; private final List bounds; @@ -36,7 +37,7 @@ public Annotation[] getDeclaredAnnotations() { @Override public Type[] getBounds() { - return bounds.toArray(new Type[bounds.size()]); + return bounds.toArray(EMPTY_TYPES_ARRAY); } @Override diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/SseUtil.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/SseUtil.java index 200dc82a38748..da88aa6560dd5 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/SseUtil.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/SseUtil.java @@ -22,6 +22,7 @@ import org.jboss.resteasy.reactive.server.jaxrs.OutboundSseEventImpl; import org.jboss.resteasy.reactive.server.spi.ServerHttpResponse; +@SuppressWarnings("ForLoopReplaceableByForEach") public class SseUtil extends CommonSseUtil { private static final String NL = "\n"; diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/StreamingUtil.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/StreamingUtil.java index ecd59301f757b..ab04df5cff81c 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/StreamingUtil.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/StreamingUtil.java @@ -20,6 +20,7 @@ // FIXME: we need to refactor the serialisation of entities to bytes between here and Sse and Serialisers // and figure out where interceptors come into play +@SuppressWarnings("ForLoopReplaceableByForEach") public class StreamingUtil { public static CompletionStage send(ResteasyReactiveRequestContext context, diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/multipart/FormDataParser.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/multipart/FormDataParser.java index 86e342d7c1f67..d5b8ab0eceae2 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/multipart/FormDataParser.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/multipart/FormDataParser.java @@ -3,8 +3,6 @@ import java.io.Closeable; import java.io.IOException; -import org.jboss.resteasy.reactive.server.core.ResteasyReactiveRequestContext; - /** * Parser for form data. This can be used by down-stream handlers to parse * form data. @@ -25,9 +23,7 @@ public interface FormDataParser extends Closeable { void parse() throws Exception; /** - * Parse the data, blocking the current thread until parsing is complete. For blocking handlers this method is - * more efficient than {@link #parse(ResteasyReactiveRequestContext next)}, as the calling thread should do that - * actual parsing, rather than the read thread + * Parse the data, blocking the current thread until parsing is complete. * * @return The parsed form data * @throws IOException If the data could not be read diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/multipart/FormParserFactory.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/multipart/FormParserFactory.java index 8d382ed75a4b5..09af5098c8c36 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/multipart/FormParserFactory.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/multipart/FormParserFactory.java @@ -17,12 +17,13 @@ * * @author Stuart Douglas */ +@SuppressWarnings("ForLoopReplaceableByForEach") public class FormParserFactory { private final ParserDefinition[] parserDefinitions; FormParserFactory(final List parserDefinitions) { - this.parserDefinitions = parserDefinitions.toArray(new ParserDefinition[parserDefinitions.size()]); + this.parserDefinitions = parserDefinitions.toArray(new ParserDefinition[0]); } /** diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/multipart/MultipartMessageBodyWriter.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/multipart/MultipartMessageBodyWriter.java index 3e67e9b1e2d6b..a8ff157a4af84 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/multipart/MultipartMessageBodyWriter.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/multipart/MultipartMessageBodyWriter.java @@ -35,6 +35,7 @@ import org.jboss.resteasy.reactive.server.spi.ServerRequestContext; import org.jboss.resteasy.reactive.spi.BeanFactory; +@SuppressWarnings("ForLoopReplaceableByForEach") public class MultipartMessageBodyWriter extends ServerMessageBodyWriter.AllWriteableMessageBodyWriter { private static final String DOUBLE_DASH = "--"; diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/parameters/QueryParamExtractor.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/parameters/QueryParamExtractor.java index f6d31259de9bb..c8b7ddfa8fa1d 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/parameters/QueryParamExtractor.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/parameters/QueryParamExtractor.java @@ -6,6 +6,7 @@ import org.jboss.resteasy.reactive.server.core.ResteasyReactiveRequestContext; +@SuppressWarnings("ForLoopReplaceableByForEach") public class QueryParamExtractor implements ParameterExtractor { private final String name; diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/request/ServerDrivenNegotiation.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/request/ServerDrivenNegotiation.java index 28f8cb5ba0bc5..06feb1bd70913 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/request/ServerDrivenNegotiation.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/request/ServerDrivenNegotiation.java @@ -14,6 +14,7 @@ * @author Pascal S. de Kloe * @see "RFC 2296" */ +@SuppressWarnings("ForLoopReplaceableByForEach") public class ServerDrivenNegotiation { private Map requestedMediaTypes = null; diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/serialization/FixedEntityWriterArray.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/serialization/FixedEntityWriterArray.java index ba43b12513abf..24479e04762cf 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/serialization/FixedEntityWriterArray.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/serialization/FixedEntityWriterArray.java @@ -13,6 +13,7 @@ * A fixed entity writer that iterates an array of providers until it finds one that can handle * the given types. */ +@SuppressWarnings("ForLoopReplaceableByForEach") public class FixedEntityWriterArray implements EntityWriter { private final MessageBodyWriter[] writers; diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/startup/RuntimeDeploymentManager.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/startup/RuntimeDeploymentManager.java index 9cd376ea8f7af..9da3e62088016 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/startup/RuntimeDeploymentManager.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/startup/RuntimeDeploymentManager.java @@ -51,6 +51,7 @@ import org.jboss.resteasy.reactive.spi.BeanFactory; import org.jboss.resteasy.reactive.spi.ThreadSetupAction; +@SuppressWarnings("ForLoopReplaceableByForEach") public class RuntimeDeploymentManager { public static final ServerRestHandler[] EMPTY_REST_HANDLER_ARRAY = new ServerRestHandler[0]; private final DeploymentInfo info; diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/startup/RuntimeMappingDeployment.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/startup/RuntimeMappingDeployment.java index 8193685fbeb9b..6ef0814ec1ac5 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/startup/RuntimeMappingDeployment.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/startup/RuntimeMappingDeployment.java @@ -15,6 +15,7 @@ import org.jboss.resteasy.reactive.server.mapping.URITemplate; import org.jboss.resteasy.reactive.server.spi.ServerRestHandler; +@SuppressWarnings("ForLoopReplaceableByForEach") class RuntimeMappingDeployment { private final Map>>> classTemplates; diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/startup/RuntimeResourceDeployment.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/startup/RuntimeResourceDeployment.java index 9de762ffa31ec..d40bdfbf3ec61 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/startup/RuntimeResourceDeployment.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/startup/RuntimeResourceDeployment.java @@ -97,6 +97,7 @@ import org.jboss.resteasy.reactive.server.util.ScoreSystem; import org.jboss.resteasy.reactive.spi.BeanFactory; +@SuppressWarnings("ForLoopReplaceableByForEach") public class RuntimeResourceDeployment { private static final ServerRestHandler[] EMPTY_REST_HANDLER_ARRAY = new ServerRestHandler[0]; @@ -265,6 +266,7 @@ public RuntimeResource buildResourceMethod(ResourceClass clazz, for (ResourceRequestFilterHandler handler : containerRequestFilterHandlers) { if (handler.isWithFormRead()) { hasWithFormReadRequestFilters = true; + break; } } } diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/handlers/ClassRoutingHandler.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/handlers/ClassRoutingHandler.java index d7b04843a9240..96021b564068d 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/handlers/ClassRoutingHandler.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/handlers/ClassRoutingHandler.java @@ -25,6 +25,7 @@ import org.jboss.resteasy.reactive.server.mapping.RuntimeResource; import org.jboss.resteasy.reactive.server.spi.ServerRestHandler; +@SuppressWarnings("ForLoopReplaceableByForEach") public class ClassRoutingHandler implements ServerRestHandler { private static final String INVALID_ACCEPT_HEADER_MESSAGE = "The accept header value did not match the value in @Produces"; diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/handlers/FixedProducesHandler.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/handlers/FixedProducesHandler.java index 78ca786ccef8d..8029481fc125c 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/handlers/FixedProducesHandler.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/handlers/FixedProducesHandler.java @@ -18,6 +18,7 @@ * Handler that negotiates the content type for endpoints that * only produce a single type. */ +@SuppressWarnings("ForLoopReplaceableByForEach") public class FixedProducesHandler implements ServerRestHandler { final EncodedMediaType mediaType; diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/handlers/ResponseHandler.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/handlers/ResponseHandler.java index fc76d9fa445b5..5915c8baba032 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/handlers/ResponseHandler.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/handlers/ResponseHandler.java @@ -21,6 +21,7 @@ /** * Our job is to turn endpoint return types into Response instances */ +@SuppressWarnings("ForLoopReplaceableByForEach") public class ResponseHandler implements ServerRestHandler { public static final ResponseHandler NO_CUSTOMIZER_INSTANCE = new ResponseHandler(); @@ -247,6 +248,7 @@ public void customize(Response.ResponseBuilder responseBuilder) { } } + @SuppressWarnings("ForLoopReplaceableByForEach") class AddHeadersCustomizer implements ResponseBuilderCustomizer { private Map> headers; diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/jaxrs/UriInfoImpl.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/jaxrs/UriInfoImpl.java index a470d07b61f76..7cbd13cb272a6 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/jaxrs/UriInfoImpl.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/jaxrs/UriInfoImpl.java @@ -27,6 +27,7 @@ /** * UriInfo implementation */ +@SuppressWarnings("ForLoopReplaceableByForEach") public class UriInfoImpl implements UriInfo { private final ResteasyReactiveRequestContext currentRequest; diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/mapping/PathMatcher.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/mapping/PathMatcher.java index 6fdb256bdcb46..d13d30d0fddbe 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/mapping/PathMatcher.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/mapping/PathMatcher.java @@ -15,6 +15,7 @@ * * @author Stuart Douglas */ +@SuppressWarnings("ForLoopReplaceableByForEach") class PathMatcher implements Dumpable { private final T defaultHandler; diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/spi/EndpointInvoker.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/spi/EndpointInvoker.java index 4fa77ce958082..a7ea848bf5f04 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/spi/EndpointInvoker.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/spi/EndpointInvoker.java @@ -3,7 +3,7 @@ /** * Base interface implemented by the synthetic beans that represent rest endpoints. * - * @see CoroutineEndpointInvoker + * See org.jboss.resteasy.reactive.server.runtime.kotlin.CoroutineEndpointInvoker */ public interface EndpointInvoker {