File tree Expand file tree Collapse file tree
src/core/lombok/javac/handlers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1735,6 +1735,26 @@ public static List<JCAnnotation> findCopyableToBuilderSingularSetterAnnotations(
17351735 * Searches the given field node for annotations that are in the given list, and returns those.
17361736 */
17371737 private static List <JCAnnotation > findAnnotationsInList (JavacNode node , java .util .List <String > annotationsToFind ) {
1738+ JCAnnotation anno = null ;
1739+ String annoName = null ;
1740+ for (JavacNode child : node .down ()) {
1741+ if (child .getKind () == Kind .ANNOTATION ) {
1742+ if (anno != null ) {
1743+ annoName = "" ;
1744+ break ;
1745+ }
1746+ JCAnnotation annotation = (JCAnnotation ) child .get ();
1747+ annoName = annotation .annotationType .toString ();
1748+ anno = annotation ;
1749+ }
1750+ }
1751+
1752+ if (annoName == null ) return List .nil ();
1753+
1754+ if (!annoName .isEmpty ()) {
1755+ for (String bn : annotationsToFind ) if (typeMatches (bn , node , annoName )) return List .of (anno );
1756+ }
1757+
17381758 ListBuffer <JCAnnotation > result = new ListBuffer <JCAnnotation >();
17391759 for (JavacNode child : node .down ()) {
17401760 if (child .getKind () == Kind .ANNOTATION ) {
You can’t perform that action at this time.
0 commit comments