From 92a780437bcc908abaa872bdb471a73281e63bd0 Mon Sep 17 00:00:00 2001 From: Roberto Cortez Date: Thu, 23 Feb 2023 20:14:40 +0000 Subject: [PATCH] Ignore required documentation for @ConfigMapping default methods --- .../processor/ExtensionAnnotationProcessor.java | 10 ++++++---- .../extest/runtime/config/TestMappingBuildTime.java | 4 ++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/core/processor/src/main/java/io/quarkus/annotation/processor/ExtensionAnnotationProcessor.java b/core/processor/src/main/java/io/quarkus/annotation/processor/ExtensionAnnotationProcessor.java index 1ef4fb6b8e3b3..000b96d0fede8 100644 --- a/core/processor/src/main/java/io/quarkus/annotation/processor/ExtensionAnnotationProcessor.java +++ b/core/processor/src/main/java/io/quarkus/annotation/processor/ExtensionAnnotationProcessor.java @@ -512,7 +512,7 @@ private void processCtorConfigItem(ExecutableElement ctor, Properties javadocPro final String docComment = getRequiredJavadoc(ctor); final StringBuilder buf = new StringBuilder(); appendParamTypes(ctor, buf); - javadocProps.put(className + Constants.DOT + buf.toString(), docComment); + javadocProps.put(className + Constants.DOT + buf, docComment); } private void processMethodConfigItem(ExecutableElement method, Properties javadocProps, String className) { @@ -520,12 +520,14 @@ private void processMethodConfigItem(ExecutableElement method, Properties javado final StringBuilder buf = new StringBuilder(); buf.append(method.getSimpleName().toString()); appendParamTypes(method, buf); - javadocProps.put(className + Constants.DOT + buf.toString(), docComment); + javadocProps.put(className + Constants.DOT + buf, docComment); } private void processMethodConfigMapping(ExecutableElement method, Properties javadocProps, String className) { - final String docComment = getRequiredJavadoc(method); - javadocProps.put(className + Constants.DOT + method.getSimpleName().toString(), docComment); + if (method.getModifiers().contains(Modifier.ABSTRACT)) { + final String docComment = getRequiredJavadoc(method); + javadocProps.put(className + Constants.DOT + method.getSimpleName().toString(), docComment); + } } private void processConfigGroup(RoundEnvironment roundEnv, TypeElement annotation) { diff --git a/integration-tests/test-extension/extension/runtime/src/main/java/io/quarkus/extest/runtime/config/TestMappingBuildTime.java b/integration-tests/test-extension/extension/runtime/src/main/java/io/quarkus/extest/runtime/config/TestMappingBuildTime.java index 2701764b02835..a256fb4843b74 100644 --- a/integration-tests/test-extension/extension/runtime/src/main/java/io/quarkus/extest/runtime/config/TestMappingBuildTime.java +++ b/integration-tests/test-extension/extension/runtime/src/main/java/io/quarkus/extest/runtime/config/TestMappingBuildTime.java @@ -46,4 +46,8 @@ interface Group { */ String value(); } + + default void mustNotRequireDocs() { + + } }