This is an automated email from the ASF dual-hosted git repository.

jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git


The following commit(s) were added to refs/heads/master by this push:
     new 23a0d0a219 Utility class modernization
23a0d0a219 is described below

commit 23a0d0a219a1967414fcd179b23b026bffcda33e
Author: James Bognar <[email protected]>
AuthorDate: Thu Nov 6 20:19:59 2025 -0500

    Utility class modernization
---
 .../apache/juneau/common/reflect/ClassInfo.java    | 27 ++++++++++---------
 .../juneau/common/reflect/ConstructorInfo.java     | 21 +++------------
 .../apache/juneau/common/reflect/FieldInfo.java    |  7 +++--
 .../apache/juneau/common/reflect/MethodInfo.java   | 12 ++++-----
 .../juneau/common/reflect/ParameterInfo.java       |  2 +-
 .../src/main/java/org/apache/juneau/BeanMeta.java  | 30 +++++++++++-----------
 .../java/org/apache/juneau/BeanPropertyMeta.java   | 10 ++++----
 .../main/java/org/apache/juneau/BeanRegistry.java  |  2 +-
 .../src/main/java/org/apache/juneau/ClassMeta.java | 26 +++++++++----------
 .../java/org/apache/juneau/swap/AutoListSwap.java  |  8 +++---
 .../java/org/apache/juneau/swap/AutoMapSwap.java   |  8 +++---
 .../org/apache/juneau/swap/AutoNumberSwap.java     |  8 +++---
 .../org/apache/juneau/swap/AutoObjectSwap.java     |  8 +++---
 .../java/org/apache/juneau/swap/SurrogateSwap.java |  2 +-
 .../rest/swagger/BasicSwaggerProviderSession.java  | 16 ++++++------
 15 files changed, 85 insertions(+), 102 deletions(-)

diff --git 
a/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/reflect/ClassInfo.java
 
b/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/reflect/ClassInfo.java
index 487f559316..1ff779fc7b 100644
--- 
a/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/reflect/ClassInfo.java
+++ 
b/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/reflect/ClassInfo.java
@@ -418,7 +418,7 @@ public class ClassInfo extends ElementInfo implements 
Annotatable {
         * @param action An action to perform on the entry.
         * @return This object.
         */
-       public <A extends Annotation> ClassInfo 
forEachAnnotation(AnnotationProvider annotationProvider, Class<A> type, 
Predicate<A> filter, Consumer<A> action) {
+       public <A extends Annotation> ClassInfo 
forEachAnnotation(AnnotationProvider2 annotationProvider, Class<A> type, 
Predicate<A> filter, Consumer<A> action) {
                if (annotationProvider == null)
                        throw unsupportedOp();
                A t2 = getPackageAnnotation(type);
@@ -426,10 +426,10 @@ public class ClassInfo extends ElementInfo implements 
Annotatable {
                        consumeIf(filter, action, t2);
                var interfaces2 = interfaces.get();
                for (int i = interfaces2.size() - 1; i >= 0; i--)
-                       
annotationProvider.getAnnotationProvider().findDeclaredParentFirst(type, 
interfaces2.get(i).inner()).map(x -> x.inner()).filter(x -> filter == null || 
filter.test(x)).forEach(x -> action.accept(x));
+                       annotationProvider.findDeclaredParentFirst(type, 
interfaces2.get(i).inner()).map(x -> x.inner()).filter(x -> filter == null || 
filter.test(x)).forEach(x -> action.accept(x));
                var parents2 = parents.get();
                for (int i = parents2.size() - 1; i >= 0; i--)
-                       
annotationProvider.getAnnotationProvider().findDeclaredParentFirst(type, 
parents2.get(i).inner()).map(x -> x.inner()).filter(x -> filter == null || 
filter.test(x)).forEach(x -> action.accept(x));
+                       annotationProvider.findDeclaredParentFirst(type, 
parents2.get(i).inner()).map(x -> x.inner()).filter(x -> filter == null || 
filter.test(x)).forEach(x -> action.accept(x));
                return this;
        }
 
@@ -478,7 +478,7 @@ public class ClassInfo extends ElementInfo implements 
Annotatable {
         * @param type The annotation to look for.
         * @return The annotation if found, or <jk>null</jk> if not.
         */
-       public <A extends Annotation> A getAnnotation(AnnotationProvider 
annotationProvider, Class<A> type) {
+       public <A extends Annotation> A getAnnotation(AnnotationProvider2 
annotationProvider, Class<A> type) {
                return findAnnotation(annotationProvider, type);
        }
 
@@ -493,7 +493,7 @@ public class ClassInfo extends ElementInfo implements 
Annotatable {
         * @param type The annotation type to look for.
         * @return The matching annotations.
         */
-       public <A extends Annotation> List<A> getAnnotations(AnnotationProvider 
annotationProvider, Class<A> type) {
+       public <A extends Annotation> List<A> 
getAnnotations(AnnotationProvider2 annotationProvider, Class<A> type) {
                List<A> l = list();
                forEachAnnotation(annotationProvider, type, x -> true, x -> 
l.add(x));
                return l;
@@ -1661,11 +1661,11 @@ public class ClassInfo extends ElementInfo implements 
Annotatable {
         * @param type The annotation to look for.
         * @return The <jk>true</jk> if annotation if found.
         */
-       public <A extends Annotation> boolean hasAnnotation(AnnotationProvider 
annotationProvider, Class<A> type) {
+       public <A extends Annotation> boolean hasAnnotation(AnnotationProvider2 
annotationProvider, Class<A> type) {
                if (annotationProvider == null)
                        throw unsupportedOp();
                // Inline Context.firstAnnotation() call
-               return nn(annotationProvider.getAnnotationProvider().find(type, 
c).map(x -> x.inner()).filter(x -> true).findFirst().orElse(null));
+               return nn(annotationProvider.find(type, c).map(x -> 
x.inner()).filter(x -> true).findFirst().orElse(null));
        }
 
        /**
@@ -2173,22 +2173,22 @@ public class ClassInfo extends ElementInfo implements 
Annotatable {
         * @param filter A predicate to apply to the entries to determine if 
annotation should be returned.  Can be <jk>null</jk>.
         * @return This object.
         */
-       public <A extends Annotation> A lastAnnotation(AnnotationProvider 
annotationProvider, Class<A> type, Predicate<A> filter) {
+       public <A extends Annotation> A lastAnnotation(AnnotationProvider2 
annotationProvider, Class<A> type, Predicate<A> filter) {
                if (annotationProvider == null)
                        throw unsupportedOp();
                A x = null;
-               x = annotationProvider.getAnnotationProvider().find(type, 
inner()).map(y -> y.inner()).filter(y -> 
filter.test(y)).findFirst().orElse(null);
+               x = annotationProvider.find(type, inner()).map(y -> 
y.inner()).filter(y -> filter.test(y)).findFirst().orElse(null);
                if (nn(x) && test(filter, x))
                        return x;
                var parents2 = parents.get();
                for (var parent : parents2) {
-                       x = 
annotationProvider.getAnnotationProvider().find(type, parent.inner()).map(y -> 
y.inner()).filter(y -> filter.test(y)).findFirst().orElse(null);
+                       x = annotationProvider.find(type, parent.inner()).map(y 
-> y.inner()).filter(y -> filter.test(y)).findFirst().orElse(null);
                        if (nn(x))
                                return x;
                }
                var interfaces2 = interfaces.get();
                for (var element : interfaces2) {
-                       x = 
annotationProvider.getAnnotationProvider().find(type, element.inner()).map(y -> 
y.inner()).filter(y -> filter.test(y)).findFirst().orElse(null);
+                       x = annotationProvider.find(type, 
element.inner()).map(y -> y.inner()).filter(y -> 
filter.test(y)).findFirst().orElse(null);
                        if (nn(x))
                                return x;
                }
@@ -2335,13 +2335,12 @@ public class ClassInfo extends ElementInfo implements 
Annotatable {
                return c == null ? null : of(c.componentType());
        }
 
-       private <A extends Annotation> A findAnnotation(AnnotationProvider ap, 
Class<A> a) {
+       private <A extends Annotation> A findAnnotation(AnnotationProvider2 ap, 
Class<A> a) {
                if (a == null)
                        return null;
                if (ap == null)
                        throw unsupportedOp();
-               // Inline Context.firstDeclaredAnnotation() call
-               A t = ap.getAnnotationProvider().findDeclared(a, c).map(x -> 
x.inner()).filter(x -> true).findFirst().orElse(null);
+               A t = ap.findDeclared(a, c).map(x -> x.inner()).filter(x -> 
true).findFirst().orElse(null);
                if (nn(t))
                        return t;
                ClassInfo sci = getSuperclass();
diff --git 
a/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/reflect/ConstructorInfo.java
 
b/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/reflect/ConstructorInfo.java
index 1fed8f9282..233ebb79fa 100644
--- 
a/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/reflect/ConstructorInfo.java
+++ 
b/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/reflect/ConstructorInfo.java
@@ -126,20 +126,6 @@ public class ConstructorInfo extends ExecutableInfo 
implements Comparable<Constr
                return i;
        }
 
-       /**
-        * Finds the annotation of the specified type defined on this 
constructor.
-        *
-        * @param <A> The annotation type to look for.
-        * @param annotationProvider The annotation provider.
-        * @param type The annotation to look for.
-        * @return The first annotation found, or <jk>null</jk> if it doesn't 
exist.
-        */
-       public <A extends Annotation> A getAnnotation(AnnotationProvider 
annotationProvider, Class<A> type) {
-               Value<A> t = Value.empty();
-               annotationProvider.getAnnotationProvider().find(type, c).map(x 
-> x.inner()).filter(x -> true).forEach(x -> t.set(x));
-               return t.orElse(null);
-       }
-
        /**
         * Returns <jk>true</jk> if the specified annotation is present on this 
constructor.
         *
@@ -148,9 +134,8 @@ public class ConstructorInfo extends ExecutableInfo 
implements Comparable<Constr
         * @param type The annotation to look for.
         * @return <jk>true</jk> if the specified annotation is present on this 
constructor.
         */
-       public <A extends Annotation> boolean hasAnnotation(AnnotationProvider 
annotationProvider, Class<A> type) {
-               // Inline Context.firstAnnotation() call
-               return nn(annotationProvider.getAnnotationProvider().find(type, 
c).map(x -> x.inner()).filter(x -> true).findFirst().orElse(null));
+       public <A extends Annotation> boolean hasAnnotation(AnnotationProvider2 
annotationProvider, Class<A> type) {
+               return nn(annotationProvider.find(type, c).map(x -> 
x.inner()).filter(x -> true).findFirst().orElse(null));
        }
 
        /**
@@ -161,7 +146,7 @@ public class ConstructorInfo extends ExecutableInfo 
implements Comparable<Constr
         * @param type The annotation to look for.
         * @return <jk>true</jk> if the specified annotation is not present on 
this constructor.
         */
-       public <A extends Annotation> boolean 
hasNoAnnotation(AnnotationProvider annotationProvider, Class<A> type) {
+       public <A extends Annotation> boolean 
hasNoAnnotation(AnnotationProvider2 annotationProvider, Class<A> type) {
                return ! hasAnnotation(annotationProvider, type);
        }
 
diff --git 
a/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/reflect/FieldInfo.java
 
b/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/reflect/FieldInfo.java
index e3c4489d4a..4978c094bc 100644
--- 
a/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/reflect/FieldInfo.java
+++ 
b/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/reflect/FieldInfo.java
@@ -222,9 +222,8 @@ public class FieldInfo extends AccessibleInfo implements 
Comparable<FieldInfo>,
         * @param type The annotation to look for.
         * @return <jk>true</jk> if the specified annotation is present.
         */
-       public <A extends Annotation> boolean hasAnnotation(AnnotationProvider 
annotationProvider, Class<A> type) {
-               // Inline Context.firstAnnotation() call
-               return nn(annotationProvider.getAnnotationProvider().find(type, 
f).map(x -> x.inner()).filter(x -> true).findFirst().orElse(null));
+       public <A extends Annotation> boolean hasAnnotation(AnnotationProvider2 
annotationProvider, Class<A> type) {
+               return nn(annotationProvider.find(type, f).map(x -> 
x.inner()).filter(x -> true).findFirst().orElse(null));
        }
 
        /**
@@ -256,7 +255,7 @@ public class FieldInfo extends AccessibleInfo implements 
Comparable<FieldInfo>,
         * @param type The annotation to look for.
         * @return <jk>true</jk> if the specified annotation is not present.
         */
-       public <A extends Annotation> boolean 
hasNoAnnotation(AnnotationProvider annotationProvider, Class<A> type) {
+       public <A extends Annotation> boolean 
hasNoAnnotation(AnnotationProvider2 annotationProvider, Class<A> type) {
                return ! hasAnnotation(annotationProvider, type);
        }
 
diff --git 
a/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/reflect/MethodInfo.java
 
b/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/reflect/MethodInfo.java
index a827b9e688..5f2c6f4098 100644
--- 
a/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/reflect/MethodInfo.java
+++ 
b/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/reflect/MethodInfo.java
@@ -427,7 +427,7 @@ public class MethodInfo extends ExecutableInfo implements 
Comparable<MethodInfo>
         * @param action An action to perform on the entry.
         * @return This object.
         */
-       public <A extends Annotation> void forEachAnnotation(AnnotationProvider 
annotationProvider, Class<A> type, Predicate<A> filter, Consumer<A> action) {
+       public <A extends Annotation> void 
forEachAnnotation(AnnotationProvider2 annotationProvider, Class<A> type, 
Predicate<A> filter, Consumer<A> action) {
                declaringClass.forEachAnnotation(annotationProvider, type, 
filter, action);
                rstream(matchingCache.get())
                        .flatMap(m -> m.getDeclaredAnnotationInfos().stream())
@@ -474,10 +474,10 @@ public class MethodInfo extends ExecutableInfo implements 
Comparable<MethodInfo>
         * @param type The annotation to look for.
         * @return The first annotation found, or <jk>null</jk> if it doesn't 
exist.
         */
-       public <A extends Annotation> A getAnnotation(AnnotationProvider 
annotationProvider, Class<A> type) {
+       public <A extends Annotation> A getAnnotation(AnnotationProvider2 
annotationProvider, Class<A> type) {
                // Inline Context.firstAnnotation() call
                return matchingCache.get().stream()
-                       .map(m2 -> 
annotationProvider.getAnnotationProvider().find(type, m2.inner()).map(x -> 
x.inner()).filter(x -> true).findFirst().orElse(null))
+                       .map(m2 -> annotationProvider.find(type, 
m2.inner()).map(x -> x.inner()).filter(x -> true).findFirst().orElse(null))
                        .filter(Objects::nonNull)
                        .findFirst()
                        .orElse(null);
@@ -588,10 +588,10 @@ public class MethodInfo extends ExecutableInfo implements 
Comparable<MethodInfo>
         * @param type The annotation to look for.
         * @return <jk>true</jk> if the specified annotation is present on this 
method.
         */
-       public <A extends Annotation> boolean hasAnnotation(AnnotationProvider 
annotationProvider, Class<A> type) {
+       public <A extends Annotation> boolean hasAnnotation(AnnotationProvider2 
annotationProvider, Class<A> type) {
                // Inline Context.firstAnnotation() call
                for (var m2 : matchingCache.get())
-                       if 
(nn(annotationProvider.getAnnotationProvider().find(type, m2.inner()).map(x -> 
x.inner()).filter(x -> true).findFirst().orElse(null)))
+                       if (nn(annotationProvider.find(type, m2.inner()).map(x 
-> x.inner()).filter(x -> true).findFirst().orElse(null)))
                                return true;
                return false;
        }
@@ -652,7 +652,7 @@ public class MethodInfo extends ExecutableInfo implements 
Comparable<MethodInfo>
         * @param type The annotation to look for.
         * @return <jk>true</jk> if the specified annotation is not present on 
this method.
         */
-       public <A extends Annotation> boolean 
hasNoAnnotation(AnnotationProvider annotationProvider, Class<A> type) {
+       public <A extends Annotation> boolean 
hasNoAnnotation(AnnotationProvider2 annotationProvider, Class<A> type) {
                return ! hasAnnotation(annotationProvider, type);
        }
 
diff --git 
a/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/reflect/ParameterInfo.java
 
b/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/reflect/ParameterInfo.java
index 88f96734fd..f5ee55ba56 100644
--- 
a/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/reflect/ParameterInfo.java
+++ 
b/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/reflect/ParameterInfo.java
@@ -806,7 +806,7 @@ public class ParameterInfo extends ElementInfo implements 
Annotatable {
                return list;
        }
 
-       private <A extends Annotation> ParameterInfo 
forEachAnnotation(AnnotationProvider ap, Class<A> a, Predicate<A> filter, 
Consumer<A> action) {
+       private <A extends Annotation> ParameterInfo 
forEachAnnotation(AnnotationProvider2 ap, Class<A> a, Predicate<A> filter, 
Consumer<A> action) {
                if (executable.isConstructor) {
                        var ci = 
executable.getParameter(index).getParameterType().unwrap(Value.class, 
Optional.class);
                        var annotationInfos = getAnnotationInfos();
diff --git 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMeta.java 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMeta.java
index 8173b42b69..59c434b924 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMeta.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMeta.java
@@ -230,8 +230,8 @@ public class BeanMeta<T> {
 
                                Map<String,BeanPropertyMeta.Builder> 
normalProps = map();
 
-                               boolean hasBean = ci.hasAnnotation(ctx, 
Bean.class);
-                               boolean hasBeanIgnore = ci.hasAnnotation(ctx, 
BeanIgnore.class);
+                               boolean hasBean = 
ci.hasAnnotation(ctx.getAnnotationProvider(), Bean.class);
+                               boolean hasBeanIgnore = 
ci.hasAnnotation(ctx.getAnnotationProvider(), BeanIgnore.class);
 
                                /// See if this class matches one the patterns 
in the exclude-class list.
                                if (ctx.isNotABean(c))
@@ -248,7 +248,7 @@ public class BeanMeta<T> {
                                        return "Class is not serializable";
 
                                // Look for @Beanc constructor on public 
constructors.
-                               ci.getPublicConstructors().stream().filter(x -> 
x.hasAnnotation(ctx, Beanc.class)).forEach(x -> {
+                               ci.getPublicConstructors().stream().filter(x -> 
x.hasAnnotation(ctx.getAnnotationProvider(), Beanc.class)).forEach(x -> {
                                        if (nn(constructor))
                                                throw new 
BeanRuntimeException(c, "Multiple instances of '@Beanc' found.");
                                        constructor = x;
@@ -272,13 +272,13 @@ public class BeanMeta<T> {
 
                                // Look for @Beanc on all other constructors.
                                if (constructor == null) {
-                                       
ci.getDeclaredConstructors().stream().filter(x -> x.hasAnnotation(ctx, 
Beanc.class)).forEach(x -> {
+                                       
ci.getDeclaredConstructors().stream().filter(x -> 
x.hasAnnotation(ctx.getAnnotationProvider(), Beanc.class)).forEach(x -> {
                                                if (nn(constructor))
                                                        throw new 
BeanRuntimeException(c, "Multiple instances of '@Beanc' found.");
                                                constructor = x;
                                                constructorArgs = new String[0];
                                                // Inline 
Context.forEachAnnotation() call
-                               ctx.getAnnotationProvider().find(Beanc.class, 
x.inner()).map(x2 -> x2.inner()).filter(y -> ! 
y.properties().isEmpty()).forEach(z -> constructorArgs = 
splita(z.properties()));
+                                               
ctx.getAnnotationProvider().find(Beanc.class, x.inner()).map(x2 -> 
x2.inner()).filter(y -> ! y.properties().isEmpty()).forEach(z -> 
constructorArgs = splita(z.properties()));
                                                if (! 
x.hasNumParameters(constructorArgs.length)) {
                                                        if 
(constructorArgs.length != 0)
                                                        throw new 
BeanRuntimeException(c, "Number of properties defined in '@Beanc' annotation 
does not match number of parameters in constructor.");
@@ -570,10 +570,10 @@ public class BeanMeta<T> {
                        // @formatter:off
                        c2.getDeclaredFields().stream()
                                .filter(x -> x.isNotStatic()
-                               && (x.isNotTransient() || noIgnoreTransients)
-                               && (x.hasNoAnnotation(Transient.class) || 
noIgnoreTransients)
-                               && x.hasNoAnnotation(ctx, BeanIgnore.class)
-                               && (v.isVisible(x.inner()) || 
x.hasAnnotation(ctx, Beanp.class)))
+                       && (x.isNotTransient() || noIgnoreTransients)
+                       && (x.hasNoAnnotation(Transient.class) || 
noIgnoreTransients)
+                       && x.hasNoAnnotation(ctx.getAnnotationProvider(), 
BeanIgnore.class)
+                       && (v.isVisible(x.inner()) || 
x.hasAnnotation(ctx.getAnnotationProvider(), Beanp.class)))
                                .forEach(x -> l.add(x.inner())
                        );
                        // @formatter:on
@@ -595,9 +595,9 @@ public class BeanMeta<T> {
 
                forEachClass(ClassInfo.of(c), stopClass, c2 -> {
                        for (var m : c2.getDeclaredMethods()) {
-                               if (m.isStatic() || m.isBridge() || 
m.getParameterCount() > 2 || m.hasAnnotation(ctx, BeanIgnore.class))
+                               if (m.isStatic() || m.isBridge() || 
m.getParameterCount() > 2 || m.hasAnnotation(ctx.getAnnotationProvider(), 
BeanIgnore.class))
                                        continue;
-                               Transient t = m.getAnnotation(ctx, 
Transient.class);
+                               Transient t = 
m.getAnnotation(ctx.getAnnotationProvider(), Transient.class);
                                if (nn(t) && t.value())
                                        continue;
 
@@ -706,10 +706,10 @@ public class BeanMeta<T> {
                        // @formatter:off
                        FieldInfo f = c2.getDeclaredField(
                                x -> x.isNotStatic()
-                               && (x.isNotTransient() || noIgnoreTransients)
-                               && (x.hasNoAnnotation(Transient.class) || 
noIgnoreTransients)
-                               && x.hasNoAnnotation(ctx, BeanIgnore.class)
-                               && x.hasName(name)
+                       && (x.isNotTransient() || noIgnoreTransients)
+                       && (x.hasNoAnnotation(Transient.class) || 
noIgnoreTransients)
+                       && x.hasNoAnnotation(ctx.getAnnotationProvider(), 
BeanIgnore.class)
+                       && x.hasName(name)
                        );
                        // @formatter:on
                        if (nn(f))
diff --git 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanPropertyMeta.java
 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanPropertyMeta.java
index ef64114136..bdba1ed0f5 100644
--- 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanPropertyMeta.java
+++ 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanPropertyMeta.java
@@ -679,10 +679,10 @@ public class BeanPropertyMeta implements 
Comparable<BeanPropertyMeta> {
                BeanContext bc = beanContext;
                if (a == null)
                        return l;
-               getBeanMeta().getClassMeta().getInfo().forEachAnnotation(bc, a, 
x -> true, x -> l.add(x));
+               
getBeanMeta().getClassMeta().getInfo().forEachAnnotation(bc.getAnnotationProvider(),
 a, x -> true, x -> l.add(x));
                if (nn(field)) {
                        bc.getAnnotationProvider().find(a, field).map(x -> 
x.inner()).filter(x -> true).forEach(x -> l.add(x));
-                       ClassInfo.of(field.getType()).forEachAnnotation(bc, a, 
x -> true, x -> l.add(x));
+                       
ClassInfo.of(field.getType()).forEachAnnotation(bc.getAnnotationProvider(), a, 
x -> true, x -> l.add(x));
                }
                if (nn(getter)) {
                        // Walk up the inheritance hierarchy for the getter 
method
@@ -690,7 +690,7 @@ public class BeanPropertyMeta implements 
Comparable<BeanPropertyMeta> {
                                bc.getAnnotationProvider().find(a, 
parentGetter).map(x -> x.inner()).filter(x -> true).forEach(x -> l.add(x));
                        });
                        bc.getAnnotationProvider().find(a, getter).map(x -> 
x.inner()).filter(x -> true).forEach(x -> l.add(x));
-                       
ClassInfo.of(getter.getReturnType()).forEachAnnotation(bc, a, x -> true, x -> 
l.add(x));
+                       
ClassInfo.of(getter.getReturnType()).forEachAnnotation(bc.getAnnotationProvider(),
 a, x -> true, x -> l.add(x));
                }
                if (nn(setter)) {
                        // Walk up the inheritance hierarchy for the setter 
method
@@ -698,7 +698,7 @@ public class BeanPropertyMeta implements 
Comparable<BeanPropertyMeta> {
                                bc.getAnnotationProvider().find(a, 
parentSetter).map(x -> x.inner()).filter(x -> true).forEach(x -> l.add(x));
                        });
                        bc.getAnnotationProvider().find(a, setter).map(x -> 
x.inner()).filter(x -> true).forEach(x -> l.add(x));
-                       
ClassInfo.of(setter.getReturnType()).forEachAnnotation(bc, a, x -> true, x -> 
l.add(x));
+                       
ClassInfo.of(setter.getReturnType()).forEachAnnotation(bc.getAnnotationProvider(),
 a, x -> true, x -> l.add(x));
                }
                if (nn(extraKeys)) {
                        // Walk up the inheritance hierarchy for the extraKeys 
method
@@ -706,7 +706,7 @@ public class BeanPropertyMeta implements 
Comparable<BeanPropertyMeta> {
                                bc.getAnnotationProvider().find(a, 
parentExtraKeys).map(x -> x.inner()).filter(x -> true).forEach(x -> l.add(x));
                        });
                        bc.getAnnotationProvider().find(a, extraKeys).map(x -> 
x.inner()).filter(x -> true).forEach(x -> l.add(x));
-                       
ClassInfo.of(extraKeys.getReturnType()).forEachAnnotation(bc, a, x -> true, x 
-> l.add(x));
+                       
ClassInfo.of(extraKeys.getReturnType()).forEachAnnotation(bc.getAnnotationProvider(),
 a, x -> true, x -> l.add(x));
                }
 
                return l;
diff --git 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanRegistry.java 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanRegistry.java
index bafa93bcb8..c3ccf49c07 100644
--- 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanRegistry.java
+++ 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanRegistry.java
@@ -150,7 +150,7 @@ public class BeanRegistry {
                                        });
                                } else {
                                        Value<String> typeName = Value.empty();
-                                       ci.forEachAnnotation(beanContext, 
Bean.class, x -> isNotEmpty(x.typeName()), x -> typeName.set(x.typeName()));
+                                       
ci.forEachAnnotation(beanContext.getAnnotationProvider(), Bean.class, x -> 
isNotEmpty(x.typeName()), x -> typeName.set(x.typeName()));
                                        addToMap(typeName.orElseThrow(() -> new 
BeanRuntimeException("Class ''{0}'' was passed to BeanRegistry but it doesn't 
have a @Bean(typeName) annotation defined.", cn(c))),
                                                beanContext.getClassMeta(c));
                                }
diff --git 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ClassMeta.java 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ClassMeta.java
index 77993e7e06..0cda1d3e3f 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ClassMeta.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ClassMeta.java
@@ -163,7 +163,7 @@ public class ClassMeta<T> implements Type {
                                        cc = DATE;
                                else if (c.isArray())
                                        cc = ARRAY;
-                               else if (ci.isChildOfAny(URL.class, URI.class) 
|| ci.hasAnnotation(bc, Uri.class))
+                               else if (ci.isChildOfAny(URL.class, URI.class) 
|| ci.hasAnnotation(bc.getAnnotationProvider(), Uri.class))
                                        cc = URI;
                                else if (ci.isChildOf(Reader.class))
                                        cc = READER;
@@ -206,19 +206,19 @@ public class ClassMeta<T> implements Type {
                        .orElse(null);
                        // @formatter:on
 
-                       ci.getAllFields().stream().filter(x -> 
x.hasAnnotation(bc, ParentProperty.class)).forEach(x -> {
+                       ci.getAllFields().stream().filter(x -> 
x.hasAnnotation(bc.getAnnotationProvider(), ParentProperty.class)).forEach(x -> 
{
                                if (x.isStatic())
                                        throw new ClassMetaRuntimeException(c, 
"@ParentProperty used on invalid field ''{0}''.  Must be static.", x);
                                parentPropertyMethod = new 
Setter.FieldSetter(x.accessible().inner());
                        });
 
-                       ci.getAllFields().stream().filter(x -> 
x.hasAnnotation(bc, NameProperty.class)).forEach(x -> {
+                       ci.getAllFields().stream().filter(x -> 
x.hasAnnotation(bc.getAnnotationProvider(), NameProperty.class)).forEach(x -> {
                                if (x.isStatic())
                                        throw new ClassMetaRuntimeException(c, 
"@NameProperty used on invalid field ''{0}''.  Must be static.", x);
                                namePropertyMethod = new 
Setter.FieldSetter(x.accessible().inner());
                        });
 
-                       ci.getDeclaredFields().stream().filter(x -> 
x.hasAnnotation(bc, Example.class)).forEach(x -> {
+                       ci.getDeclaredFields().stream().filter(x -> 
x.hasAnnotation(bc.getAnnotationProvider(), Example.class)).forEach(x -> {
                                if (! (x.isStatic() && 
ci.isParentOf(x.getType().inner())))
                                        throw new ClassMetaRuntimeException(c, 
"@Example used on invalid field ''{0}''.  Must be static and an instance of the 
type.", x);
                                exampleField = x.accessible().inner();
@@ -228,13 +228,13 @@ public class ClassMeta<T> implements Type {
                        List<MethodInfo> methods = ci.getMethods();
                        for (int i = methods.size() - 1; i >= 0; i--) {
                                MethodInfo m = methods.get(i);
-                               if (m.hasAnnotation(bc, ParentProperty.class)) {
+                               if (m.hasAnnotation(bc.getAnnotationProvider(), 
ParentProperty.class)) {
                                        if (m.isStatic() || ! 
m.hasNumParameters(1))
                                                throw new 
ClassMetaRuntimeException(c, "@ParentProperty used on invalid method ''{0}''.  
Must not be static and have one argument.", m);
                                        m.setAccessible();
                                        parentPropertyMethod = new 
Setter.MethodSetter(m.inner());
                                }
-                               if (m.hasAnnotation(bc, NameProperty.class)) {
+                               if (m.hasAnnotation(bc.getAnnotationProvider(), 
NameProperty.class)) {
                                        if (m.isStatic() || ! 
m.hasNumParameters(1))
                                                throw new 
ClassMetaRuntimeException(c, "@NameProperty used on invalid method ''{0}''.  
Must not be static and have one argument.", m);
                                        m.setAccessible();
@@ -242,7 +242,7 @@ public class ClassMeta<T> implements Type {
                                }
                        }
 
-                       ci.getDeclaredMethods().stream().filter(m -> 
m.hasAnnotation(bc, Example.class)).forEach(m -> {
+                       ci.getDeclaredMethods().stream().filter(m -> 
m.hasAnnotation(bc.getAnnotationProvider(), Example.class)).forEach(m -> {
                                if (! (m.isStatic() && 
m.hasParameterTypesLenient(BeanSession.class) && 
ci.isParentOf(m.getReturnType().inner())))
                                        throw new ClassMetaRuntimeException(c, 
"@Example used on invalid method ''{0}''.  Must be static and return an 
instance of the declaring class.", m.toString());
                                m.setAccessible();
@@ -466,7 +466,7 @@ public class ClassMeta<T> implements Type {
 
                private BeanFilter findBeanFilter(BeanContext bc) {
                        try {
-                               List<Bean> ba = info.getAnnotations(bc, 
Bean.class);
+                               List<Bean> ba = 
info.getAnnotations(bc.getAnnotationProvider(), Bean.class);
                                if (! ba.isEmpty())
                                        return 
BeanFilter.create(innerClass).applyAnnotations(ba).build();
                        } catch (Exception e) {
@@ -481,7 +481,7 @@ public class ClassMeta<T> implements Type {
 
                private MarshalledFilter findMarshalledFilter(BeanContext bc) {
                        try {
-                               List<Marshalled> ba = info.getAnnotations(bc, 
Marshalled.class);
+                               List<Marshalled> ba = 
info.getAnnotations(bc.getAnnotationProvider(), Marshalled.class);
                                if (! ba.isEmpty())
                                        return 
MarshalledFilter.create(innerClass).applyAnnotations(ba).build();
                        } catch (Exception e) {
@@ -1115,8 +1115,8 @@ public class ClassMeta<T> implements Type {
                Optional<A> o = (Optional<A>)annotationLastMap.get(a);
                if (o == null) {
                        if (beanContext == null)
-                               return info.getAnnotation(BeanContext.DEFAULT, 
a);
-                       o = opt(info.getAnnotation(beanContext, a));
+                               return 
info.getAnnotation(BeanContext.DEFAULT.getAnnotationProvider(), a);
+                       o = 
opt(info.getAnnotation(beanContext.getAnnotationProvider(), a));
                        annotationLastMap.put(a, o);
                }
                return o.orElse(null);
@@ -1761,7 +1761,7 @@ public class ClassMeta<T> implements Type {
                A[] array = annotationArray(type);
                if (array == null) {
                        if (beanContext == null)
-                               return 
Optional.ofNullable(info.lastAnnotation(BeanContext.DEFAULT, type, filter));
+                               return 
Optional.ofNullable(info.lastAnnotation(type, filter));
                        return Optional.empty();
                }
                for (int i = array.length - 1; i >= 0; i--)
@@ -1935,7 +1935,7 @@ public class ClassMeta<T> implements Type {
                A[] array = (A[])annotationArrayMap.get(type);
                if (array == null && nn(beanContext)) {
                        List<A> l = list();
-                       info.forEachAnnotation(beanContext, type, x -> true, x 
-> l.add(x));
+                       
info.forEachAnnotation(beanContext.getAnnotationProvider(), type, x -> true, x 
-> l.add(x));
                        array = (A[])Array.newInstance(type, l.size());
                        for (int i = 0; i < l.size(); i++)
                                Array.set(array, i, l.get(i));
diff --git 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/AutoListSwap.java
 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/AutoListSwap.java
index 974871cd68..3a14d76c32 100644
--- 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/AutoListSwap.java
+++ 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/AutoListSwap.java
@@ -133,7 +133,7 @@ public class AutoListSwap<T> extends ObjectSwap<T,List<?>> {
                        && mi.hasAnyName(SWAP_METHOD_NAMES)
                        && mi.hasReturnTypeParent(List.class)
                        && mi.hasParameterTypesLenient(BeanSession.class)
-                       && mi.hasNoAnnotation(bc, BeanIgnore.class);
+                       && mi.hasNoAnnotation(bc.getAnnotationProvider(), 
BeanIgnore.class);
                // @formatter:on
        }
 
@@ -143,7 +143,7 @@ public class AutoListSwap<T> extends ObjectSwap<T,List<?>> {
                        cs.isNotDeprecated()
                        && cs.isVisible(bc.getBeanConstructorVisibility())
                        && cs.hasMatchingParameterTypes(rt)
-                       && cs.hasNoAnnotation(bc, BeanIgnore.class);
+                       && cs.hasNoAnnotation(bc.getAnnotationProvider(), 
BeanIgnore.class);
                // @formatter:on
        }
 
@@ -156,12 +156,12 @@ public class AutoListSwap<T> extends 
ObjectSwap<T,List<?>> {
                        && mi.hasAnyName(UNSWAP_METHOD_NAMES)
                        && mi.hasParameterTypesLenient(BeanSession.class, 
rt.inner())
                        && mi.hasReturnTypeParent(ci)
-                       && mi.hasNoAnnotation(bc, BeanIgnore.class);
+                       && mi.hasNoAnnotation(bc.getAnnotationProvider(), 
BeanIgnore.class);
                // @formatter:on
        }
 
        private static boolean shouldIgnore(BeanContext bc, ClassInfo ci) {
-               return ci.hasAnnotation(bc, BeanIgnore.class) || 
ci.isNonStaticMemberClass();
+               return ci.hasAnnotation(bc.getAnnotationProvider(), 
BeanIgnore.class) || ci.isNonStaticMemberClass();
        }
 
        
//------------------------------------------------------------------------------------------------------------------
diff --git 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/AutoMapSwap.java
 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/AutoMapSwap.java
index d3d9bc42a5..a9d32c15d5 100644
--- 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/AutoMapSwap.java
+++ 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/AutoMapSwap.java
@@ -133,7 +133,7 @@ public class AutoMapSwap<T> extends ObjectSwap<T,Map<?,?>> {
                        && mi.hasAnyName(SWAP_METHOD_NAMES)
                        && mi.hasReturnTypeParent(Map.class)
                        && mi.hasParameterTypesLenient(BeanSession.class)
-                       && mi.hasNoAnnotation(bc, BeanIgnore.class);
+                       && mi.hasNoAnnotation(bc.getAnnotationProvider(), 
BeanIgnore.class);
                // @formatter:on
        }
 
@@ -143,7 +143,7 @@ public class AutoMapSwap<T> extends ObjectSwap<T,Map<?,?>> {
                        cs.isNotDeprecated()
                        && cs.isVisible(bc.getBeanConstructorVisibility())
                        && cs.hasMatchingParameterTypes(rt)
-                       && cs.hasNoAnnotation(bc, BeanIgnore.class);
+                       && cs.hasNoAnnotation(bc.getAnnotationProvider(), 
BeanIgnore.class);
                // @formatter:on
        }
 
@@ -156,12 +156,12 @@ public class AutoMapSwap<T> extends 
ObjectSwap<T,Map<?,?>> {
                        && mi.hasAnyName(UNSWAP_METHOD_NAMES)
                        && mi.hasParameterTypesLenient(BeanSession.class, 
rt.inner())
                        && mi.hasReturnTypeParent(ci)
-                       && mi.hasNoAnnotation(bc, BeanIgnore.class);
+                       && mi.hasNoAnnotation(bc.getAnnotationProvider(), 
BeanIgnore.class);
                // @formatter:on
        }
 
        private static boolean shouldIgnore(BeanContext bc, ClassInfo ci) {
-               return ci.hasAnnotation(bc, BeanIgnore.class) || 
ci.isNonStaticMemberClass();
+               return ci.hasAnnotation(bc.getAnnotationProvider(), 
BeanIgnore.class) || ci.isNonStaticMemberClass();
        }
 
        
//------------------------------------------------------------------------------------------------------------------
diff --git 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/AutoNumberSwap.java
 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/AutoNumberSwap.java
index 5bb4296bc4..bf707e94b1 100644
--- 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/AutoNumberSwap.java
+++ 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/AutoNumberSwap.java
@@ -158,7 +158,7 @@ public class AutoNumberSwap<T> extends ObjectSwap<T,Number> 
{
                        && (rt.isChildOf(Number.class) || (rt.isPrimitive() && 
rt.isAny(int.class, short.class, long.class, float.class, double.class, 
byte.class)))
                        && mi.hasAnyName(SWAP_METHOD_NAMES)
                        && mi.hasParameterTypesLenient(BeanSession.class)
-                       && mi.hasNoAnnotation(bc, BeanIgnore.class);
+                       && mi.hasNoAnnotation(bc.getAnnotationProvider(), 
BeanIgnore.class);
                // @formatter:on
        }
 
@@ -168,7 +168,7 @@ public class AutoNumberSwap<T> extends ObjectSwap<T,Number> 
{
                        cs.isNotDeprecated()
                        && cs.isVisible(bc.getBeanConstructorVisibility())
                        && cs.hasMatchingParameterTypes(rt)
-                       && cs.hasNoAnnotation(bc, BeanIgnore.class);
+                       && cs.hasNoAnnotation(bc.getAnnotationProvider(), 
BeanIgnore.class);
                // @formatter:on
        }
 
@@ -181,14 +181,14 @@ public class AutoNumberSwap<T> extends 
ObjectSwap<T,Number> {
                        && mi.hasAnyName(UNSWAP_METHOD_NAMES)
                        && mi.hasParameterTypesLenient(BeanSession.class, 
rt.inner())
                        && mi.hasReturnTypeParent(ci)
-                       && mi.hasNoAnnotation(bc, BeanIgnore.class);
+                       && mi.hasNoAnnotation(bc.getAnnotationProvider(), 
BeanIgnore.class);
                // @formatter:on
        }
 
        private static boolean shouldIgnore(BeanContext bc, ClassInfo ci) {
                // @formatter:off
                return
-                       ci.hasAnnotation(bc, BeanIgnore.class)
+                       ci.hasAnnotation(bc.getAnnotationProvider(), 
BeanIgnore.class)
                        || ci.isNonStaticMemberClass()
                        || ci.isPrimitive()
                        || ci.isChildOf(Number.class);
diff --git 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/AutoObjectSwap.java
 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/AutoObjectSwap.java
index 6c158384ff..81754f114c 100644
--- 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/AutoObjectSwap.java
+++ 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/AutoObjectSwap.java
@@ -134,7 +134,7 @@ public class AutoObjectSwap<T> extends ObjectSwap<T,Object> 
{
                        && mi.isVisible(bc.getBeanMethodVisibility())
                        && mi.hasAnyName(SWAP_METHOD_NAMES)
                        && mi.hasParameterTypesLenient(BeanSession.class)
-                       && mi.hasNoAnnotation(bc, BeanIgnore.class);
+                       && mi.hasNoAnnotation(bc.getAnnotationProvider(), 
BeanIgnore.class);
                // @formatter:on
        }
 
@@ -144,7 +144,7 @@ public class AutoObjectSwap<T> extends ObjectSwap<T,Object> 
{
                        cs.isNotDeprecated()
                        && cs.isVisible(bc.getBeanConstructorVisibility())
                        && cs.hasMatchingParameterTypes(rt)
-                       && cs.hasNoAnnotation(bc, BeanIgnore.class);
+                       && cs.hasNoAnnotation(bc.getAnnotationProvider(), 
BeanIgnore.class);
                // @formatter:on
        }
 
@@ -157,12 +157,12 @@ public class AutoObjectSwap<T> extends 
ObjectSwap<T,Object> {
                        && mi.hasAnyName(UNSWAP_METHOD_NAMES)
                        && mi.hasParameterTypesLenient(BeanSession.class, 
rt.inner())
                        && mi.hasReturnTypeParent(ci)
-                       && mi.hasNoAnnotation(bc, BeanIgnore.class);
+                       && mi.hasNoAnnotation(bc.getAnnotationProvider(), 
BeanIgnore.class);
                // @formatter:on
        }
 
        private static boolean shouldIgnore(BeanContext bc, ClassInfo ci) {
-               return ci.hasAnnotation(bc, BeanIgnore.class) || 
ci.isNonStaticMemberClass();
+               return ci.hasAnnotation(bc.getAnnotationProvider(), 
BeanIgnore.class) || ci.isNonStaticMemberClass();
        }
 
        
//------------------------------------------------------------------------------------------------------------------
diff --git 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/SurrogateSwap.java
 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/SurrogateSwap.java
index 6b063664dc..99eff33f27 100644
--- 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/SurrogateSwap.java
+++ 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/swap/SurrogateSwap.java
@@ -54,7 +54,7 @@ public class SurrogateSwap<T,F> extends ObjectSwap<T,F> {
        public static List<SurrogateSwap<?,?>> findObjectSwaps(Class<?> c, 
BeanContext bc) {
                List<SurrogateSwap<?,?>> l = new LinkedList<>();
                var ci = ClassInfo.of(c);
-               ci.getPublicConstructors().stream().filter(x -> 
x.hasNoAnnotation(bc, BeanIgnore.class) && x.hasNumParameters(1) && 
x.isPublic()).forEach(x -> {
+               ci.getPublicConstructors().stream().filter(x -> 
x.hasNoAnnotation(bc.getAnnotationProvider(), BeanIgnore.class) && 
x.hasNumParameters(1) && x.isPublic()).forEach(x -> {
                        var pt = x.getParameter(0).getParameterType().inner();
                        if (! pt.equals(c.getDeclaringClass())) {
                                // Find the unswap method if there is one.
diff --git 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/swagger/BasicSwaggerProviderSession.java
 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/swagger/BasicSwaggerProviderSession.java
index d327cf9f62..cbb78aa40d 100644
--- 
a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/swagger/BasicSwaggerProviderSession.java
+++ 
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/swagger/BasicSwaggerProviderSession.java
@@ -156,7 +156,7 @@ public class BasicSwaggerProviderSession {
                        omSwagger = new JsonMap();
 
                // Combine it with @Rest(swagger)
-               for (var rr : rci.getAnnotations(context, Rest.class)) {
+               for (var rr : 
rci.getAnnotations(context.getAnnotationProvider(), Rest.class)) {
 
                        JsonMap sInfo = omSwagger.getMap("info", true);
 
@@ -432,8 +432,8 @@ public class BasicSwaggerProviderSession {
 
                        for (var eci : mi.getExceptionTypes()) {
                                if (eci.hasAnnotation(Response.class)) {
-                                       List<Response> la = 
eci.getAnnotations(context, Response.class);
-                                       List<StatusCode> la2 = 
eci.getAnnotations(context, StatusCode.class);
+                                       List<Response> la = 
eci.getAnnotations(context.getAnnotationProvider(), Response.class);
+                                       List<StatusCode> la2 = 
eci.getAnnotations(context.getAnnotationProvider(), StatusCode.class);
                                        Set<Integer> codes = getCodes(la2, 500);
                                        for (var a : la) {
                                                for (var code : codes) {
@@ -455,7 +455,7 @@ public class BasicSwaggerProviderSession {
                                                        String ha = a.name();
                                                        for (var code : codes) {
                                                                JsonMap header 
= responses.getMap(String.valueOf(code), true).getMap("headers", 
true).getMap(ha, true);
-                                                               
ecmi.forEachAnnotation(context, Schema.class, x -> true, x -> merge(header, x));
+                                                               
ecmi.forEachAnnotation(context.getAnnotationProvider(), Schema.class, x -> 
true, x -> merge(header, x));
                                                                
rstream(ecmi.getReturnType().unwrap(Value.class, 
Optional.class).getAnnotationInfos()).map(x -> 
x.cast(Schema.class)).filter(Objects::nonNull).map(AnnotationInfo::inner).forEach(x
 -> merge(header, x));
                                                                
pushupSchemaFields(RESPONSE_HEADER, header, getSchema(header.getMap("schema"), 
ecmi.getReturnType().unwrap(Value.class, Optional.class).innerType(), bs));
                                                        }
@@ -466,16 +466,16 @@ public class BasicSwaggerProviderSession {
 
                        if (mi.hasAnnotation(Response.class) || 
mi.getReturnType().unwrap(Value.class, 
Optional.class).hasAnnotation(Response.class)) {
                                List<Response> la = list();
-                               mi.forEachAnnotation(context, Response.class, x 
-> true, x -> la.add(x));
+                               
mi.forEachAnnotation(context.getAnnotationProvider(), Response.class, x -> 
true, x -> la.add(x));
                                List<StatusCode> la2 = list();
-                               mi.forEachAnnotation(context, StatusCode.class, 
x -> true, x -> la2.add(x));
+                               
mi.forEachAnnotation(context.getAnnotationProvider(), StatusCode.class, x -> 
true, x -> la2.add(x));
                                Set<Integer> codes = getCodes(la2, 200);
                                for (var a : la) {
                                        for (var code : codes) {
                                                JsonMap om = 
responses.getMap(String.valueOf(code), true);
                                                merge(om, a);
                                                JsonMap schema = 
getSchema(om.getMap("schema"), m.getGenericReturnType(), bs);
-                                               mi.forEachAnnotation(context, 
Schema.class, x -> true, x -> merge(schema, x));
+                                               
mi.forEachAnnotation(context.getAnnotationProvider(), Schema.class, x -> true, 
x -> merge(schema, x));
                                                pushupSchemaFields(RESPONSE, 
om, schema);
                                                om.appendIf(nem, "schema", 
schema);
                                                addBodyExamples(sm, om, true, 
m.getGenericReturnType(), locale);
@@ -491,7 +491,7 @@ public class BasicSwaggerProviderSession {
                                                        if (! isMulti(a)) {
                                                                for (var code : 
codes) {
                                                                        JsonMap 
header = responses.getMap(String.valueOf(code), true).getMap("headers", 
true).getMap(ha, true);
-                                                                       
ecmi.forEachAnnotation(context, Schema.class, x -> true, x -> merge(header, x));
+                                                                       
ecmi.forEachAnnotation(context.getAnnotationProvider(), Schema.class, x -> 
true, x -> merge(header, x));
                                                                        
rstream(ecmi.getReturnType().unwrap(Value.class, 
Optional.class).getAnnotationInfos()).map(x -> 
x.cast(Schema.class)).filter(Objects::nonNull).map(AnnotationInfo::inner).forEach(x
 -> merge(header, x));
                                                                        
merge(header, a.schema());
                                                                        
pushupSchemaFields(RESPONSE_HEADER, header, getSchema(header, 
ecmi.getReturnType().innerType(), bs));


Reply via email to