mbien commented on code in PR #7958:
URL: https://github.com/apache/netbeans/pull/7958#discussion_r1854630834


##########
enterprise/web.beans/src/org/netbeans/modules/web/beans/analysis/analyzer/AnnotationUtil.java:
##########


Review Comment:
   this class was retrofitted to use varargs at some point, but not all methods 
have them. I believe the changeset can be greately reduced by adding this:
   
       
   ```java
       public static boolean hasAnnotation(Element element, CompilationInfo 
info, String... annotations) {
           return getAnnotationMirror(element, info, annotations) != null;
       }
   ```
   this would get rid of many if-blocks.
   
   consider also _removing_ those two:
   ```java
       public static AnnotationMirror getAnnotationMirror(Element element,
               String annotation,CompilationInfo info )
       {
           return getAnnotationMirror(element, info, annotation);
       }
   ```
   ```java
       public static boolean hasAnnotation(Element element, String annotation,
               CompilationInfo info )
       {
           return getAnnotationMirror(element, info)!=null;
       }
   ```
   since it already exists as varargs variant with swapped params. This isn't 
public API I believe - should be fine.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to