markro49 commented on code in PR #290:
URL: https://github.com/apache/commons-bcel/pull/290#discussion_r1545496027
##########
src/main/java/org/apache/bcel/classfile/JavaClass.java:
##########
@@ -906,4 +911,28 @@ public String toString() {
}
return buf.toString();
}
+
+ /**
+ * Tests whether this class was declared as a record
+ *
+ * @return true if a record attribute is present, false otherwise.
+ * @since 6.9.0
+ */
+ public boolean isRecord() {
+ computeIsRecord();
+ return this.isRecord;
+ }
+
+ private void computeIsRecord() {
+ if (computedRecord) {
+ return;
+ }
+ for (final Attribute attribute : this.attributes) {
+ if (attribute instanceof Record) {
+ isRecord = true;
+ break;
+ }
+ }
+ this.computedRecord = false;
Review Comment:
shouldn't this be set to true?
--
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]