> iterator = modifiableBeans.iterator(); iterator.hasNext();) {
Bean> bean = iterator.next();
if (!bean.getBeanClass().equals(clazz) && !bean.isAlternative()) {
// remove Beans that have clazz in their type closure but not as a base class
diff --git a/rest-client-base/src/main/java/org/jboss/resteasy/microprofile/client/async/AsyncInterceptorRxInvoker.java b/rest-client-base/src/main/java/org/jboss/resteasy/microprofile/client/async/AsyncInterceptorRxInvoker.java
index 32865ed..90de55a 100644
--- a/rest-client-base/src/main/java/org/jboss/resteasy/microprofile/client/async/AsyncInterceptorRxInvoker.java
+++ b/rest-client-base/src/main/java/org/jboss/resteasy/microprofile/client/async/AsyncInterceptorRxInvoker.java
@@ -23,6 +23,7 @@
import java.util.concurrent.CompletionException;
import java.util.concurrent.CompletionStage;
import java.util.concurrent.ExecutorService;
+
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.SyncInvoker;
import javax.ws.rs.core.GenericType;
@@ -36,7 +37,7 @@
/**
* @author Bill Burke
* @author Alessio Soldano
- *
+ *
*/
public class AsyncInterceptorRxInvoker extends CompletionStageRxInvokerImpl {
private Method method;
diff --git a/rest-client-base/src/main/java/org/jboss/resteasy/microprofile/client/async/AsyncInterceptorRxInvokerProvider.java b/rest-client-base/src/main/java/org/jboss/resteasy/microprofile/client/async/AsyncInterceptorRxInvokerProvider.java
index 6f00ed4..f1cf572 100644
--- a/rest-client-base/src/main/java/org/jboss/resteasy/microprofile/client/async/AsyncInterceptorRxInvokerProvider.java
+++ b/rest-client-base/src/main/java/org/jboss/resteasy/microprofile/client/async/AsyncInterceptorRxInvokerProvider.java
@@ -20,6 +20,7 @@
package org.jboss.resteasy.microprofile.client.async;
import java.util.concurrent.ExecutorService;
+
import javax.ws.rs.client.CompletionStageRxInvoker;
import javax.ws.rs.client.RxInvokerProvider;
import javax.ws.rs.client.SyncInvoker;
diff --git a/rest-client-base/src/main/java/org/jboss/resteasy/microprofile/client/header/ClientHeaderGenerator.java b/rest-client-base/src/main/java/org/jboss/resteasy/microprofile/client/header/ClientHeaderGenerator.java
index 087df72..72f5193 100644
--- a/rest-client-base/src/main/java/org/jboss/resteasy/microprofile/client/header/ClientHeaderGenerator.java
+++ b/rest-client-base/src/main/java/org/jboss/resteasy/microprofile/client/header/ClientHeaderGenerator.java
@@ -22,6 +22,7 @@
import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;
+
import javax.ws.rs.core.MultivaluedMap;
import org.eclipse.microprofile.rest.client.RestClientDefinitionException;
@@ -40,7 +41,7 @@ class ClientHeaderGenerator {
private final List staticValues;
ClientHeaderGenerator(final ClientHeaderParam anno, final Class> interfaceClass, final Object clientProxy,
- final HeaderFillerFactory fillerFactory) {
+ final HeaderFillerFactory fillerFactory) {
headerName = anno.name();
required = anno.required();
String[] values = anno.value();
@@ -58,7 +59,7 @@ class ClientHeaderGenerator {
}
private void checkForMethodCallsInHeaderValues(final String[] values, final Class> location,
- final String headerName) {
+ final String headerName) {
if (Stream.of(values).anyMatch(this::isMethodCall)) {
throw new RestClientDefinitionException("A method call defined as one multiple values for header on "
+ location.getSimpleName() + " for header '" + headerName + "'");
@@ -72,10 +73,9 @@ private boolean isMethodCall(final String headerValue) {
}
public void fillHeaders(final MultivaluedMap headers) {
- List headerValues =
- filler != null
- ? filler.generateValues()
- : staticValues;
+ List headerValues = filler != null
+ ? filler.generateValues()
+ : staticValues;
if (!headerValues.isEmpty() && headers.get(headerName) == null) {
headers.put(headerName, headerValues);
diff --git a/rest-client-base/src/main/java/org/jboss/resteasy/microprofile/client/header/ClientHeaderProvider.java b/rest-client-base/src/main/java/org/jboss/resteasy/microprofile/client/header/ClientHeaderProvider.java
index 00847af..769915c 100644
--- a/rest-client-base/src/main/java/org/jboss/resteasy/microprofile/client/header/ClientHeaderProvider.java
+++ b/rest-client-base/src/main/java/org/jboss/resteasy/microprofile/client/header/ClientHeaderProvider.java
@@ -28,6 +28,7 @@
import java.util.Optional;
import java.util.Set;
import java.util.stream.Stream;
+
import javax.ws.rs.core.MultivaluedMap;
import org.eclipse.microprofile.rest.client.RestClientDefinitionException;
@@ -36,7 +37,7 @@
public class ClientHeaderProvider {
static Optional forMethod(final Method method, final Object clientProxy,
- HeaderFillerFactory fillerFactory) {
+ HeaderFillerFactory fillerFactory) {
Class> declaringClass = method.getDeclaringClass();
ClientHeaderParam[] methodAnnotations = method.getAnnotationsByType(ClientHeaderParam.class);
@@ -49,14 +50,16 @@ static Optional forMethod(final Method method, final Objec
throw new RestClientDefinitionException("Duplicate " + ClientHeaderParam.class.getSimpleName() +
" annotation definitions found on " + method);
}
- generators.put(annotation.name(), new ClientHeaderGenerator(annotation, declaringClass, clientProxy, fillerFactory));
+ generators.put(annotation.name(),
+ new ClientHeaderGenerator(annotation, declaringClass, clientProxy, fillerFactory));
}
checkForDuplicateClassLevelAnnotations(classAnnotations, declaringClass);
Stream.of(classAnnotations)
.filter(a -> !generators.containsKey(a.name()))
- .forEach(a -> generators.put(a.name(), new ClientHeaderGenerator(a, declaringClass, clientProxy, fillerFactory)));
+ .forEach(a -> generators.put(a.name(),
+ new ClientHeaderGenerator(a, declaringClass, clientProxy, fillerFactory)));
return generators.isEmpty()
? Optional.empty()
@@ -64,7 +67,7 @@ static Optional forMethod(final Method method, final Objec
}
private static void checkForDuplicateClassLevelAnnotations(final ClientHeaderParam[] classAnnotations,
- final Class> declaringClass) {
+ final Class> declaringClass) {
Set headerNames = new HashSet<>();
Arrays.stream(classAnnotations)
.map(ClientHeaderParam::name)
@@ -75,8 +78,7 @@ private static void checkForDuplicateClassLevelAnnotations(final ClientHeaderPar
"Duplicate ClientHeaderParam definition for header name " + name + " on class "
+ declaringClass.getCanonicalName());
}
- }
- );
+ });
}
private final Collection generators;
diff --git a/rest-client-base/src/main/java/org/jboss/resteasy/microprofile/client/header/ClientHeaderProviders.java b/rest-client-base/src/main/java/org/jboss/resteasy/microprofile/client/header/ClientHeaderProviders.java
index d37d091..c85bdf0 100644
--- a/rest-client-base/src/main/java/org/jboss/resteasy/microprofile/client/header/ClientHeaderProviders.java
+++ b/rest-client-base/src/main/java/org/jboss/resteasy/microprofile/client/header/ClientHeaderProviders.java
@@ -26,6 +26,7 @@
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Stream;
+
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;
@@ -71,7 +72,8 @@ public static Optional getFactory(Class> aClass) {
/**
* Register, in a static map, {@link ClientHeaderProvider}`s for the given class and all of its methods
*
- * @param clientClass a class to scan for {@link org.eclipse.microprofile.rest.client.annotation.ClientHeaderParam} and {@link RegisterClientHeaders}
+ * @param clientClass a class to scan for {@link org.eclipse.microprofile.rest.client.annotation.ClientHeaderParam} and
+ * {@link RegisterClientHeaders}
* @param clientProxy proxy of the clientClass, used to handle the default methods
*
* @deprecated use {@link #registerForClass(Class, Object, BeanManager)}
@@ -84,7 +86,8 @@ public static void registerForClass(Class> clientClass, Object clientProxy) {
/**
* Register, in a static map, {@link ClientHeaderProvider}`s for the given class and all of its methods
*
- * @param clientClass a class to scan for {@link org.eclipse.microprofile.rest.client.annotation.ClientHeaderParam} and {@link RegisterClientHeaders}
+ * @param clientClass a class to scan for {@link org.eclipse.microprofile.rest.client.annotation.ClientHeaderParam} and
+ * {@link RegisterClientHeaders}
* @param clientProxy proxy of the clientClass, used to handle the default methods
* @param beanManager the bean manager used to construct CDI beans
*/
@@ -104,26 +107,25 @@ private static void registerHeaderFactory(Class> aClass, BeanManager beanManag
}
private static Optional getCustomHeadersFactory(RegisterClientHeaders annotation,
- Class> source, BeanManager beanManager) {
+ Class> source, BeanManager beanManager) {
Class extends ClientHeadersFactory> factoryClass = annotation.value();
try {
return Optional.of(construct(factoryClass, beanManager));
} catch (InstantiationException | IllegalAccessException e) {
throw new RestClientDefinitionException(
- "Failed to instantiate " + factoryClass.getCanonicalName() + ", the client header factory for " + source.getCanonicalName(),
- e
- );
+ "Failed to instantiate " + factoryClass.getCanonicalName() + ", the client header factory for "
+ + source.getCanonicalName(),
+ e);
}
}
private static void registerForMethod(Method method, Object clientProxy) {
ClientHeaderProvider.forMethod(method, clientProxy, fillerFactory).ifPresent(
- provider -> providersForMethod.put(method, provider)
- );
+ provider -> providersForMethod.put(method, provider));
}
private static ClientHeadersFactory construct(final Class extends ClientHeadersFactory> factory,
- final BeanManager manager)
+ final BeanManager manager)
throws IllegalAccessException, InstantiationException {
if (manager != null) {
Set> beans = manager.getBeans(factory);
diff --git a/rest-client-base/src/main/java/org/jboss/resteasy/microprofile/client/header/ClientHeadersRequestFilter.java b/rest-client-base/src/main/java/org/jboss/resteasy/microprofile/client/header/ClientHeadersRequestFilter.java
index 1861e5b..1a73070 100644
--- a/rest-client-base/src/main/java/org/jboss/resteasy/microprofile/client/header/ClientHeadersRequestFilter.java
+++ b/rest-client-base/src/main/java/org/jboss/resteasy/microprofile/client/header/ClientHeadersRequestFilter.java
@@ -25,6 +25,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
+
import javax.annotation.Priority;
import javax.ws.rs.client.ClientRequestContext;
import javax.ws.rs.client.ClientRequestFilter;
@@ -36,7 +37,6 @@
import org.jboss.resteasy.microprofile.client.impl.MpClientInvocation;
import org.jboss.resteasy.microprofile.client.utils.ClientRequestContextUtils;
-
/**
* First the headers from `@ClientHeaderParam` annotations are applied,
* they can be overwritten by JAX-RS `@HeaderParam` (coming in the `requestContext`)
@@ -58,14 +58,15 @@ public void filter(ClientRequestContext requestContext) {
Optional handler = ClientHeaderProviders.getProvider(method);
handler.ifPresent(h -> h.addHeaders(headers));
- Optional factory = ClientHeaderProviders.getFactory(ClientRequestContextUtils.getDeclaringClass(requestContext));
+ Optional factory = ClientHeaderProviders
+ .getFactory(ClientRequestContextUtils.getDeclaringClass(requestContext));
requestContext.getHeaders().forEach(
- (key, values) -> headers.put(key, castToListOfStrings(values))
- );
+ (key, values) -> headers.put(key, castToListOfStrings(values)));
@SuppressWarnings("unchecked")
- MultivaluedMap containerHeaders = (MultivaluedMap) requestContext.getProperty(MpClientInvocation.CONTAINER_HEADERS);
+ MultivaluedMap containerHeaders = (MultivaluedMap) requestContext
+ .getProperty(MpClientInvocation.CONTAINER_HEADERS);
if (containerHeaders == null)
containerHeaders = EMPTY_MAP;
// stupid final rules
@@ -78,8 +79,7 @@ public void filter(ClientRequestContext requestContext) {
}
factory.ifPresent(f -> f.update(incomingHeaders, headers)
- .forEach((key, values) -> requestContext.getHeaders().put(key, castToListOfObjects(values)))
- );
+ .forEach((key, values) -> requestContext.getHeaders().put(key, castToListOfObjects(values))));
}
private static List