diff --git a/core/deployment/src/main/java/io/quarkus/deployment/recording/PropertyUtils.java b/core/deployment/src/main/java/io/quarkus/deployment/recording/PropertyUtils.java index 0d23928a7f080..835c7aff70a0a 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/recording/PropertyUtils.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/recording/PropertyUtils.java @@ -28,7 +28,12 @@ public Property[] apply(Class type) { if (i.getName().startsWith("get") && i.getName().length() > 3 && i.getParameterCount() == 0 && i.getReturnType() != void.class) { String name = Character.toLowerCase(i.getName().charAt(3)) + i.getName().substring(4); - getters.put(name, i); + Method existingGetter = getters.get(name); + // In some cases the overridden methods from supertypes can also appear in the array (for some reason). + // We want the most specific methods. + if (existingGetter == null || existingGetter.getReturnType().isAssignableFrom(i.getReturnType())) { + getters.put(name, i); + } } else if (i.getName().startsWith("is") && i.getName().length() > 3 && i.getParameterCount() == 0 && i.getReturnType() == boolean.class) { String name = Character.toLowerCase(i.getName().charAt(2)) + i.getName().substring(3);