From c3833f36ffcd9692c84e7fd823269a62e6191728 Mon Sep 17 00:00:00 2001 From: Stephane Epardaud Date: Tue, 19 Nov 2019 12:03:20 +0100 Subject: [PATCH] Added note on ServiceProviderBuildItem constructors to warn what they do --- .../nativeimage/ServiceProviderBuildItem.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/core/deployment/src/main/java/io/quarkus/deployment/builditem/nativeimage/ServiceProviderBuildItem.java b/core/deployment/src/main/java/io/quarkus/deployment/builditem/nativeimage/ServiceProviderBuildItem.java index 1beb85805e88c..16e0c43efa69e 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/builditem/nativeimage/ServiceProviderBuildItem.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/builditem/nativeimage/ServiceProviderBuildItem.java @@ -18,10 +18,26 @@ public final class ServiceProviderBuildItem extends MultiBuildItem { private final String serviceInterface; private final List providers; + /** + * Registers the specified service interface descriptor to be embedded and allow reflection (instantiation only) + * of the specified provider classes. Note that the service interface descriptor file has to exist and match the + * list of specified provider class names. + * + * @param serviceInterfaceClassName the interface whose service interface descriptor file we want to embed + * @param providerClassNames the list of provider class names that must already be mentioned in the file + */ public ServiceProviderBuildItem(String serviceInterfaceClassName, String... providerClassNames) { this(serviceInterfaceClassName, Arrays.asList(providerClassNames)); } + /** + * Registers the specified service interface descriptor to be embedded and allow reflection (instantiation only) + * of the specified provider classes. Note that the service interface descriptor file has to exist and match the + * list of specified provider class names. + * + * @param serviceInterfaceClassName the interface whose service interface descriptor file we want to embed + * @param providers the list of provider class names that must already be mentioned in the file + */ public ServiceProviderBuildItem(String serviceInterfaceClassName, List providers) { this.serviceInterface = Objects.requireNonNull(serviceInterfaceClassName, "The service interface must not be `null`"); this.providers = providers;