diff --git a/config/config/src/test/java/io/helidon/config/ConfigAsciidocGenerator.java b/config/config/src/test/java/io/helidon/config/ConfigAsciidocGenerator.java index 96e2d818399..5c9f17d381a 100644 --- a/config/config/src/test/java/io/helidon/config/ConfigAsciidocGenerator.java +++ b/config/config/src/test/java/io/helidon/config/ConfigAsciidocGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2021 Oracle and/or its affiliates. + * Copyright (c) 2017, 2024 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -300,7 +300,7 @@ private static void processMethods(SortedMap typeMethods = methods.computeIfAbsent(kindDesc, (tn) -> new HashMap<>()); if (typeMethods.containsKey(accessType)) { @@ -321,12 +321,6 @@ private static String formatParams(String text) { ; } - private static String methodToString(Method method) { - StringBuilder sb = new StringBuilder(method.getName()); - sb.append(" (").append(Arrays.toString(method.getParameters())).append(" ) : " + method.getGenericReturnType()); - return sb.toString(); - } - private static class KindDesc implements Comparable { private boolean generic; private String methodSuffix; @@ -389,27 +383,19 @@ public boolean accept(Method method) { } if (firstParamClass != null && method.getParameterCount() > 0) { Class currentFirstParameterClass = method.getParameters()[0].getType(); - if (firstParamClass.isAssignableFrom(currentFirstParameterClass)) { - return true; - } else { - //System.out.println("Not acceptable class: " + currentFirstParameterClass); - } + return firstParamClass.isAssignableFrom(currentFirstParameterClass); } return false; } } private static class MethodDesc { - private KindDesc kind; private String name; private String params; - private AccessType accessType; - public MethodDesc(KindDesc kind, String name, String params, AccessType accessType) { - this.kind = kind; + public MethodDesc(String name, String params) { this.name = name; this.params = params; - this.accessType = accessType; } public String format() { @@ -425,18 +411,14 @@ public String format() { } private enum AccessType { - COMMON("Common", false, false), - WITH_DEFAULT("With Default", true, false), - OPTIONAL("Optional", false, true); + COMMON("Common"), + WITH_DEFAULT("With Default"), + OPTIONAL("Optional"); private String desc; - private boolean withDefault; - private boolean optional; - AccessType(String desc, boolean withDefault, boolean optional) { + AccessType(String desc) { this.desc = desc; - this.withDefault = withDefault; - this.optional = optional; } public static AccessType of(boolean withDefault, boolean optional) {