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 030e33074b Utility class modernization
030e33074b is described below

commit 030e33074b31dfd0421523b0083922e54cea75c8
Author: James Bognar <[email protected]>
AuthorDate: Thu Nov 6 15:15:59 2025 -0500

    Utility class modernization
---
 .../apache/juneau/common/reflect/ClassInfo.java    | 26 ++++------------------
 1 file changed, 4 insertions(+), 22 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 9aa5d4acd2..21ea48ec51 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
@@ -200,11 +200,8 @@ public class ClassInfo extends ElementInfo implements 
Annotatable {
        // All superclasses of this class in child-to-parent order, starting 
with this class.
        private final Supplier<List<ClassInfo>> parents = 
memoize(this::findParents);
 
-       // All annotations declared directly on this class.
-       private final Supplier<List<Annotation>> declaredAnnotations = 
memoize(() -> opt(c).map(x -> 
u(l(x.getDeclaredAnnotations()))).orElse(liste()));
-
        // All annotations declared directly on this class, wrapped in 
AnnotationInfo.
-       private final Supplier<List<AnnotationInfo>> declaredAnnotations2 = 
memoize(() -> (List)declaredAnnotations.get().stream().map(a -> 
AnnotationInfo.of(this, a)).toList());
+       private final Supplier<List<AnnotationInfo>> declaredAnnotations2 = 
memoize(() -> (List)opt(c).map(x -> 
u(l(x.getDeclaredAnnotations()))).orElse(liste()).stream().map(a -> 
AnnotationInfo.of(this, a)).toList());
 
        // Fully qualified class name with generics (e.g., 
"java.util.List<java.lang.String>").
        private final Supplier<String> fullName = memoize(() -> 
getNameFormatted(FULL, true, '$', BRACKETS));
@@ -2358,28 +2355,13 @@ public class ClassInfo extends ElementInfo implements 
Annotatable {
                return (t instanceof ParameterizedType t2 && t2.getRawType() == 
c) || (t instanceof Class && c.isAssignableFrom((Class<?>)t));
        }
 
-       /**
-        * Returns all annotations declared directly on this class.
-        *
-        * <p>
-        * This includes annotations explicitly applied to the class 
declaration, but excludes inherited annotations
-        * from parent classes.
-        *
-        * @return
-        *      An unmodifiable list of annotations declared directly on this 
class.
-        *      <br>List is empty if no annotations are declared.
-        *      <br>Results are in declaration order.
-        */
-       public List<Annotation> getDeclaredAnnotations() {
-               return declaredAnnotations.get();
-       }
-
        /**
         * Returns all annotations declared directly on this class, wrapped in 
{@link AnnotationInfo} objects.
         *
         * <p>
-        * This is equivalent to {@link #getDeclaredAnnotations()} but with 
each annotation wrapped for additional
-        * functionality such as annotation member access and metadata 
inspection.
+        * This includes annotations explicitly applied to the class 
declaration, but excludes inherited annotations
+        * from parent classes. Each annotation is wrapped for additional 
functionality such as annotation member
+        * access and metadata inspection.
         *
         * @return
         *      An unmodifiable list of {@link AnnotationInfo} wrappers for 
annotations declared directly on this class.

Reply via email to