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-compress.git
The following commit(s) were added to refs/heads/master by this push:
new 04fc7a683 Javadoc
04fc7a683 is described below
commit 04fc7a683d71065431b49c385349bac181c56770
Author: Gary D. Gregory <[email protected]>
AuthorDate: Fri Apr 18 20:54:38 2025 -0400
Javadoc
---
.../harmony/unpack200/bytecode/CPConstant.java | 5 +++++
.../unpack200/bytecode/CPConstantNumber.java | 12 ++++++++++++
.../harmony/unpack200/bytecode/CPDouble.java | 6 ++++++
.../harmony/unpack200/bytecode/CPFloat.java | 6 ++++++
.../harmony/unpack200/bytecode/CPInteger.java | 6 ++++++
.../harmony/unpack200/bytecode/CPLong.java | 6 ++++++
.../harmony/unpack200/bytecode/CPString.java | 6 ++++++
.../harmony/unpack200/bytecode/ClassFileEntry.java | 22 +++++++++++++++++++++-
.../unpack200/bytecode/ConstantPoolEntry.java | 9 +++++++++
.../unpack200/bytecode/forms/LookupSwitchForm.java | 3 +++
.../unpack200/bytecode/forms/SwitchForm.java | 3 +++
.../unpack200/bytecode/forms/TableSwitchForm.java | 3 +++
12 files changed, 86 insertions(+), 1 deletion(-)
diff --git
a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPConstant.java
b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPConstant.java
index 55a51d7b8..bd05bd2e1 100644
---
a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPConstant.java
+++
b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPConstant.java
@@ -52,6 +52,11 @@ public boolean equals(final Object obj) {
return Objects.equals(value, other.value);
}
+ /**
+ * Gets the value.
+ *
+ * @return the value.
+ */
protected Object getValue() {
return value;
}
diff --git
a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPConstantNumber.java
b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPConstantNumber.java
index f45f28f86..37e327b9d 100644
---
a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPConstantNumber.java
+++
b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPConstantNumber.java
@@ -23,10 +23,22 @@
*/
public abstract class CPConstantNumber extends CPConstant {
+ /**
+ * Constructs a new instance.
+ *
+ * @param tag One-byte tag indicates the kind of constant.
+ * @param value The value.
+ * @param globalIndex Global index.
+ */
public CPConstantNumber(final byte tag, final Object value, final int
globalIndex) {
super(tag, value, globalIndex);
}
+ /**
+ * The value as a Number.
+ *
+ * @return The value as a Number.
+ */
protected Number getNumber() {
return (Number) getValue();
}
diff --git
a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPDouble.java
b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPDouble.java
index ab64125f9..d1e015e06 100644
---
a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPDouble.java
+++
b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPDouble.java
@@ -26,6 +26,12 @@
*/
public class CPDouble extends CPConstantNumber {
+ /**
+ * Constructs a new instance.
+ *
+ * @param value The value.
+ * @param globalIndex Global index.
+ */
public CPDouble(final Double value, final int globalIndex) {
super(CP_Double, value, globalIndex);
}
diff --git
a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPFloat.java
b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPFloat.java
index 4da896b32..73dd7b3b6 100644
---
a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPFloat.java
+++
b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPFloat.java
@@ -26,6 +26,12 @@
*/
public class CPFloat extends CPConstantNumber {
+ /**
+ * Constructs a new instance.
+ *
+ * @param value The value.
+ * @param globalIndex Global index.
+ */
public CPFloat(final Float value, final int globalIndex) {
super(CP_Float, value, globalIndex);
}
diff --git
a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPInteger.java
b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPInteger.java
index e0b560d8b..eda00996b 100644
---
a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPInteger.java
+++
b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPInteger.java
@@ -26,6 +26,12 @@
*/
public class CPInteger extends CPConstantNumber {
+ /**
+ * Constructs a new instance.
+ *
+ * @param value The value.
+ * @param globalIndex Global index.
+ */
public CPInteger(final Integer value, final int globalIndex) {
super(CP_Integer, value, globalIndex);
}
diff --git
a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPLong.java
b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPLong.java
index 2ca6cf041..26f1563ef 100644
---
a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPLong.java
+++
b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPLong.java
@@ -26,6 +26,12 @@
*/
public class CPLong extends CPConstantNumber {
+ /**
+ * Constructs a new instance.
+ *
+ * @param value The value.
+ * @param globalIndex Global index.
+ */
public CPLong(final Long value, final int globalIndex) {
super(CP_Long, value, globalIndex);
}
diff --git
a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPString.java
b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPString.java
index 4cb6191f9..fa0ea0764 100644
---
a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPString.java
+++
b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPString.java
@@ -33,6 +33,12 @@ public class CPString extends CPConstant {
private int cachedHashCode;
+ /**
+ * Constructs a new instance.
+ *
+ * @param value The value.
+ * @param globalIndex Global index.
+ */
public CPString(final CPUTF8 value, final int globalIndex) {
super(CP_String, value, globalIndex);
this.name = value;
diff --git
a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/ClassFileEntry.java
b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/ClassFileEntry.java
index 83f755b43..36f6d02d8 100644
---
a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/ClassFileEntry.java
+++
b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/ClassFileEntry.java
@@ -26,9 +26,18 @@
*/
public abstract class ClassFileEntry {
+ /**
+ * An empty ClassFileEntry array.
+ */
protected static final ClassFileEntry[] NONE = {};
private boolean resolved;
+ /**
+ * Writes this instance to the output stream.
+ *
+ * @param dos the output stream.
+ * @throws IOException if an I/O error occurs.
+ */
protected abstract void doWrite(DataOutputStream dos) throws IOException;
@Override
@@ -46,6 +55,11 @@ protected ClassFileEntry[] getNestedClassFileEntries() {
@Override
public abstract int hashCode();
+ /**
+ * Delegates to super {@link #hashCode}.
+ *
+ * @return super {@link #hashCode}.
+ */
protected int objectHashCode() {
return super.hashCode();
}
@@ -53,7 +67,7 @@ protected int objectHashCode() {
/**
* Allows the constant pool entries to resolve their nested entries.
*
- * @param pool TODO
+ * @param pool The class constant pool.
*/
protected void resolve(final ClassConstantPool pool) {
resolved = true;
@@ -62,6 +76,12 @@ protected void resolve(final ClassConstantPool pool) {
@Override
public abstract String toString();
+ /**
+ * Writes this instance to the output stream.
+ *
+ * @param dos the output stream.
+ * @throws IOException if an I/O error occurs.
+ */
public final void write(final DataOutputStream dos) throws IOException {
if (!resolved) {
throw new IllegalStateException("Entry has not been resolved");
diff --git
a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/ConstantPoolEntry.java
b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/ConstantPoolEntry.java
index cefb88e25..8bf7d429a 100644
---
a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/ConstantPoolEntry.java
+++
b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/ConstantPoolEntry.java
@@ -86,6 +86,9 @@ public abstract class ConstantPoolEntry extends
ClassFileEntry {
*/
public static final byte CP_UTF8 = 1;
+ /**
+ * One-byte tag indicates the kind of constant.
+ */
byte tag;
/**
@@ -93,6 +96,12 @@ public abstract class ConstantPoolEntry extends
ClassFileEntry {
*/
protected int globalIndex;
+ /**
+ * Constructs a new instance.
+ *
+ * @param tag One-byte tag indicates the kind of constant.
+ * @param globalIndex Global index.
+ */
ConstantPoolEntry(final byte tag, final int globalIndex) {
this.tag = tag;
this.globalIndex = globalIndex;
diff --git
a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/forms/LookupSwitchForm.java
b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/forms/LookupSwitchForm.java
index eceace60c..625c9d08e 100644
---
a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/forms/LookupSwitchForm.java
+++
b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/forms/LookupSwitchForm.java
@@ -23,6 +23,9 @@
import org.apache.commons.compress.harmony.unpack200.bytecode.ByteCode;
import org.apache.commons.compress.harmony.unpack200.bytecode.OperandManager;
+/**
+ * Lookup switch instruction form.
+ */
public class LookupSwitchForm extends SwitchForm {
/**
diff --git
a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/forms/SwitchForm.java
b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/forms/SwitchForm.java
index ff3fe7f49..ebe662ae0 100644
---
a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/forms/SwitchForm.java
+++
b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/forms/SwitchForm.java
@@ -21,6 +21,9 @@
import org.apache.commons.compress.harmony.unpack200.bytecode.ByteCode;
import org.apache.commons.compress.harmony.unpack200.bytecode.CodeAttribute;
+/**
+ * Switch instruction form.
+ */
public abstract class SwitchForm extends VariableInstructionForm {
/**
diff --git
a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/forms/TableSwitchForm.java
b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/forms/TableSwitchForm.java
index 7e2271160..96ad82b08 100644
---
a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/forms/TableSwitchForm.java
+++
b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/forms/TableSwitchForm.java
@@ -23,6 +23,9 @@
import org.apache.commons.compress.harmony.unpack200.bytecode.ByteCode;
import org.apache.commons.compress.harmony.unpack200.bytecode.OperandManager;
+/**
+ * Table switch instruction form.
+ */
public class TableSwitchForm extends SwitchForm {
/**