From 15bddb2b84d412ed1cd0f61b780c056506f6dfa4 Mon Sep 17 00:00:00 2001 From: George Gastaldi Date: Mon, 28 Aug 2023 15:40:40 -0300 Subject: [PATCH] Use the correct annotation name in the error message (#980) - Also display the offending annotated element --- .../main/java/io/smallrye/config/ConfigMappingInterface.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implementation/src/main/java/io/smallrye/config/ConfigMappingInterface.java b/implementation/src/main/java/io/smallrye/config/ConfigMappingInterface.java index e3ef35b99..ab4864fe1 100644 --- a/implementation/src/main/java/io/smallrye/config/ConfigMappingInterface.java +++ b/implementation/src/main/java/io/smallrye/config/ConfigMappingInterface.java @@ -935,7 +935,7 @@ private static String getPropertyName(final AnnotatedElement element) { WithName annotation = element.getAnnotation(WithName.class); if (annotation != null) { if (useParent) { - throw new IllegalArgumentException("Cannot specify both @ParentConfigName and @ConfigName"); + throw new IllegalArgumentException("Cannot specify both @WithParentName and @WithName in '" + element + "'"); } String name = annotation.value(); if (!name.isEmpty()) {