You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "nbauma109 (via GitHub)" <gi...@apache.org> on 2026/02/01 16:22:57 UTC

[PR] Add getAttribute(final byte tag) to RecordComponentInfo [commons-bcel]

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: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add RecordComponentInfo.getAttribute(byte tag) [commons-bcel]

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #494:
URL: https://github.com/apache/commons-bcel/pull/494#issuecomment-3832057637

   Thank you @nbauma109.
   
   PR merged 🚀 


-- 
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: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add getAttribute(final byte tag) to RecordComponentInfo [commons-bcel]

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory merged PR #494:
URL: https://github.com/apache/commons-bcel/pull/494


-- 
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: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org