diff --git a/core/src/main/java/org/jboss/jandex/AnnotationInstanceBuilder.java b/core/src/main/java/org/jboss/jandex/AnnotationInstanceBuilder.java index c70bae3f..e0333daa 100644 --- a/core/src/main/java/org/jboss/jandex/AnnotationInstanceBuilder.java +++ b/core/src/main/java/org/jboss/jandex/AnnotationInstanceBuilder.java @@ -591,8 +591,7 @@ public AnnotationInstanceBuilder add(String name, Class value) { throw new IllegalArgumentException("Annotation member '" + name + "' already added"); } - DotName className = DotName.createSimple(value.getName()); - Type clazz = Type.create(className, Type.Kind.CLASS); + Type clazz = Type.create(value); this.values.add(AnnotationValue.createClassValue(name, clazz)); return this; } @@ -614,8 +613,7 @@ public AnnotationInstanceBuilder add(String name, Class[] values) { AnnotationValue[] array = new AnnotationValue[values.length]; for (int i = 0; i < values.length; i++) { - DotName className = DotName.createSimple(values[i].getName()); - Type clazz = Type.create(className, Type.Kind.CLASS); + Type clazz = Type.create(values[i]); array[i] = AnnotationValue.createClassValue(name, clazz); } this.values.add(AnnotationValue.createArrayValue(name, array)); @@ -673,9 +671,9 @@ private void validateType(Type type) { if (kind == Type.Kind.VOID || kind == Type.Kind.PRIMITIVE || kind == Type.Kind.CLASS) { return; } - if (kind == Type.Kind.ARRAY && type.asArrayType().dimensions() == 1) { - Type.Kind constituent = type.asArrayType().constituent().kind(); - if (constituent == Type.Kind.PRIMITIVE || constituent == Type.Kind.CLASS) { + if (kind == Type.Kind.ARRAY) { + Type.Kind element = type.asArrayType().elementType().kind(); + if (element == Type.Kind.PRIMITIVE || element == Type.Kind.CLASS) { return; } } diff --git a/core/src/main/java/org/jboss/jandex/MethodInfo.java b/core/src/main/java/org/jboss/jandex/MethodInfo.java index 001394a0..c0fcf4be 100644 --- a/core/src/main/java/org/jboss/jandex/MethodInfo.java +++ b/core/src/main/java/org/jboss/jandex/MethodInfo.java @@ -35,9 +35,8 @@ * However, {@link #descriptorParameterTypes()} and {@link #descriptorParametersCount()} * may be used to obtain information about all parameters, including mandated and synthetic. *

- * As an exception to the rule above, in case of well known methods where no parameter - * is declared explicitly, the implicitly declared parameters are included. This currently - * applies to the implicitly declared parameters of: + * As an exception to the rule above, implicitly declared parameters are always included + * in case of methods that don't have an explicit parameter list. These are: *