This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-bcel.git
commit 6c2909a8f819a6deba3f2064988d9866d5634e91 Author: Gary Gregory <[email protected]> AuthorDate: Sat Jan 10 22:50:22 2026 -0500 Javadoc --- .../apache/bcel/generic/EnumElementValueGen.java | 61 ++++++++++++++++------ 1 file changed, 46 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/apache/bcel/generic/EnumElementValueGen.java b/src/main/java/org/apache/bcel/generic/EnumElementValueGen.java index 2220a9d5..70e710f1 100644 --- a/src/main/java/org/apache/bcel/generic/EnumElementValueGen.java +++ b/src/main/java/org/apache/bcel/generic/EnumElementValueGen.java @@ -36,6 +36,13 @@ public class EnumElementValueGen extends ElementValueGen { private final int valueIdx; + /** + * Constructs an EnumElementValueGen from an EnumElementValue. + * + * @param value the enum element value. + * @param cpool the constant pool. + * @param copyPoolEntries whether to copy pool entries. + */ public EnumElementValueGen(final EnumElementValue value, final ConstantPoolGen cpool, final boolean copyPoolEntries) { super(ENUM_CONSTANT, cpool); if (copyPoolEntries) { @@ -48,8 +55,12 @@ public class EnumElementValueGen extends ElementValueGen { } /** - * This ctor assumes the constant pool already contains the right type and value - as indicated by typeIdx and valueIdx. - * This ctor is used for deserialization + * This constructor assumes the constant pool already contains the right type and value - as indicated by typeIdx and valueIdx. + * This constructor is used for deserialization. + * + * @param typeIdx the type index. + * @param valueIdx the value index. + * @param cpool the constant pool. */ protected EnumElementValueGen(final int typeIdx, final int valueIdx, final ConstantPoolGen cpool) { super(ENUM_CONSTANT, cpool); @@ -60,6 +71,13 @@ public class EnumElementValueGen extends ElementValueGen { this.valueIdx = valueIdx; } + /** + * Constructs an EnumElementValueGen. + * + * @param t the object type. + * @param value the value. + * @param cpool the constant pool. + */ public EnumElementValueGen(final ObjectType t, final String value, final ConstantPoolGen cpool) { super(ENUM_CONSTANT, cpool); typeIdx = cpool.addUtf8(t.getSignature()); // was addClass(t); @@ -74,7 +92,9 @@ public class EnumElementValueGen extends ElementValueGen { } /** - * Return immutable variant of this EnumElementValue + * Returns immutable variant of this EnumElementValueGen. + * + * @return immutable variant. */ @Override public ElementValue getElementValue() { @@ -82,30 +102,41 @@ public class EnumElementValueGen extends ElementValueGen { return new EnumElementValue(super.getElementValueType(), typeIdx, valueIdx, getConstantPool().getConstantPool()); } - // BCELBUG: Should we need to call utility.signatureToString() on the output - // here? + /** + * Gets the enum type string. + * + * @return the enum type string. + */ public String getEnumTypeString() { - // Constant cc = getConstantPool().getConstant(typeIdx); - // ConstantClass cu8 = - // (ConstantClass) getConstantPool().getConstant(typeIdx); - // return - // ((ConstantUtf8) getConstantPool().getConstant(cu8.getNameIndex())).getBytes(); + // ...existing code... return ((ConstantUtf8) getConstantPool().getConstant(typeIdx)).getBytes(); - // return Utility.signatureToString(cu8.getBytes()); + // ...existing code... } + /** + * Gets the enum value string. + * + * @return the enum value string. + */ public String getEnumValueString() { return ((ConstantUtf8) getConstantPool().getConstant(valueIdx)).getBytes(); - // ConstantString cu8 = - // (ConstantString) getConstantPool().getConstant(valueIdx); - // return - // ((ConstantUtf8) getConstantPool().getConstant(cu8.getStringIndex())).getBytes(); + // ...existing code... } + /** + * Gets the type index. + * + * @return the type index. + */ public int getTypeIndex() { return typeIdx; } + /** + * Gets the value index. + * + * @return the value index. + */ public int getValueIndex() { return valueIdx; }
