nbauma109 opened a new pull request, #494:
URL: https://github.com/apache/commons-bcel/pull/494

   This PR aligns the API of `RecordComponentInfo` on the API of `JavaClass` / 
`FieldOrMethod`.
   
   Same as we would do :
   
   ```java
   Annotations visibles = 
javaClass.getAttribute(Const.ATTR_RUNTIME_VISIBLE_ANNOTATIONS);
   Annotations invisibles = 
javaClass.getAttribute(Const.ATTR_RUNTIME_INVISIBLE_ANNOTATIONS);
   ```
   
   or :
   
   ```java
   Annotations visibles = 
fieldOrMethod.getAttribute(Const.ATTR_RUNTIME_VISIBLE_ANNOTATIONS);
   Annotations invisibles = 
fieldOrMethod.getAttribute(Const.ATTR_RUNTIME_INVISIBLE_ANNOTATIONS);
   ```
   
   add the possibility to do :
   
   ```java
   Annotations visibles = 
recordComponentInfo.getAttribute(Const.ATTR_RUNTIME_VISIBLE_ANNOTATIONS);
   Annotations invisibles = 
recordComponentInfo.getAttribute(Const.ATTR_RUNTIME_INVISIBLE_ANNOTATIONS);
   ```
   
   instead of less readable syntax :
   
   ```java
   Annotations visibles = (Annotations) 
Stream.of(recordComponentInfo.getAttributes()).filter(RuntimeVisibleAnnotations.class::isInstance).findAny().orElse(null);
   Annotations invisibles = (Annotations) 
Stream.of(recordComponentInfo.getAttributes()).filter(RuntimeInvisibleAnnotations.class::isInstance).findAny().orElse(null);
   ```
   


-- 
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]

Reply via email to