From bfdf18a9d770de0c60053d5e9eaf02e93a522086 Mon Sep 17 00:00:00 2001 From: amosshi Date: Tue, 12 Oct 2021 22:42:43 -0700 Subject: [PATCH] #9 AccessFlag and Private method --- .../org/freeinternals/format/classfile/AccessFlag.java | 9 +++++++++ .../format/classfile/attribute/RuntimeAnnotations.java | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/FormatCLASS/src/main/java/org/freeinternals/format/classfile/AccessFlag.java b/FormatCLASS/src/main/java/org/freeinternals/format/classfile/AccessFlag.java index 00cb60c..0c8ef9b 100644 --- a/FormatCLASS/src/main/java/org/freeinternals/format/classfile/AccessFlag.java +++ b/FormatCLASS/src/main/java/org/freeinternals/format/classfile/AccessFlag.java @@ -295,6 +295,15 @@ private AccessFlag(long i, String m) { this.modifier = m; } + /** + * Get int value of {@link #value}. + * + * @return int value of {@link #value} + */ + public int intValue() { + return Math.toIntExact(this.value); + } + /** * Check if the the accFlags matches the access flag or not. * diff --git a/FormatCLASS/src/main/java/org/freeinternals/format/classfile/attribute/RuntimeAnnotations.java b/FormatCLASS/src/main/java/org/freeinternals/format/classfile/attribute/RuntimeAnnotations.java index 278e1b3..c2abee6 100644 --- a/FormatCLASS/src/main/java/org/freeinternals/format/classfile/attribute/RuntimeAnnotations.java +++ b/FormatCLASS/src/main/java/org/freeinternals/format/classfile/attribute/RuntimeAnnotations.java @@ -25,7 +25,7 @@ public abstract class RuntimeAnnotations extends attribute_info { public final u2 num_annotations; - private final Annotation[] annotations; + public final Annotation[] annotations; RuntimeAnnotations(final u2 nameIndex, final String type, final PosDataInputStream posDataInputStream) throws IOException, FileFormatException { super(nameIndex, type, posDataInputStream);