Skip to content

Commit

Permalink
Javadoc: English, not Latin
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Dec 31, 2024
1 parent 911a171 commit 4580fc6
Show file tree
Hide file tree
Showing 51 changed files with 99 additions and 100 deletions.
2 changes: 1 addition & 1 deletion src/examples/Id.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

/**
* Test BCEL if an input file is identical to the outfile generated with BCEL. Of course there may some small
* differences, e.g., because BCEL generates local variable tables by default.
* differences, for example, because BCEL generates local variable tables by default.
*
* Try to:
*
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/org/apache/bcel/Const.java
Original file line number Diff line number Diff line change
Expand Up @@ -2899,20 +2899,20 @@ public final class Const {
public static final byte T_ADDRESS = 16;

/**
* The primitive type names corresponding to the T_XX constants, e.g., TYPE_NAMES[T_INT] = "int"
* The primitive type names corresponding to the T_XX constants, for example, TYPE_NAMES[T_INT] = "int"
*/
private static final String[] TYPE_NAMES = {ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, "boolean", "char", "float", "double", "byte", "short",
"int", "long", "void", "array", "object", "unknown", "address"};

/**
* The primitive class names corresponding to the T_XX constants, e.g., CLASS_TYPE_NAMES[T_INT] = "java.lang.Integer"
* The primitive class names corresponding to the T_XX constants, for example, CLASS_TYPE_NAMES[T_INT] = "java.lang.Integer"
*/
private static final String[] CLASS_TYPE_NAMES = {ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, "java.lang.Boolean", "java.lang.Character",
"java.lang.Float", "java.lang.Double", "java.lang.Byte", "java.lang.Short", "java.lang.Integer", "java.lang.Long", "java.lang.Void", ILLEGAL_TYPE,
ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE};

/**
* The signature characters corresponding to primitive types, e.g., SHORT_TYPE_NAMES[T_INT] = "I"
* The signature characters corresponding to primitive types, for example, SHORT_TYPE_NAMES[T_INT] = "I"
*/
public static final String[] SHORT_TYPE_NAMES = {ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, "Z", "C", "F", "D", "B", "S", "I", "J", "V",
ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE};
Expand Down Expand Up @@ -3207,7 +3207,7 @@ public static String getAttributeName(final int index) {
}

/**
* The primitive class names corresponding to the T_XX constants, e.g., CLASS_TYPE_NAMES[T_INT] = "java.lang.Integer"
* The primitive class names corresponding to the T_XX constants, for example, CLASS_TYPE_NAMES[T_INT] = "java.lang.Integer"
*
* @param index index into {@code CLASS_TYPE_NAMES}.
* @return the class name
Expand Down Expand Up @@ -3318,7 +3318,7 @@ public static String getShortTypeName(final int index) {
}

/**
* The primitive type names corresponding to the T_XX constants, e.g., TYPE_NAMES[T_INT] = "int"
* The primitive type names corresponding to the T_XX constants, for example, TYPE_NAMES[T_INT] = "int"
*
* @param index
* @return the type name
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/apache/bcel/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -2348,20 +2348,20 @@ public interface Constants {
byte T_ADDRESS = Const.T_ADDRESS;

/**
* The primitive type names corresponding to the T_XX constants, e.g., TYPE_NAMES[T_INT] = "int"
* The primitive type names corresponding to the T_XX constants, for example, TYPE_NAMES[T_INT] = "int"
*/
String[] TYPE_NAMES = {ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, "boolean", "char", "float", "double", "byte", "short", "int", "long", "void",
"array", "object", "unknown", "address"};

/**
* The primitive class names corresponding to the T_XX constants, e.g., CLASS_TYPE_NAMES[T_INT] = "java.lang.Integer"
* The primitive class names corresponding to the T_XX constants, for example, CLASS_TYPE_NAMES[T_INT] = "java.lang.Integer"
*/
String[] CLASS_TYPE_NAMES = {ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, "java.lang.Boolean", "java.lang.Character", "java.lang.Float",
"java.lang.Double", "java.lang.Byte", "java.lang.Short", "java.lang.Integer", "java.lang.Long", "java.lang.Void", ILLEGAL_TYPE, ILLEGAL_TYPE,
ILLEGAL_TYPE, ILLEGAL_TYPE};

/**
* The signature characters corresponding to primitive types, e.g., SHORT_TYPE_NAMES[T_INT] = "I"
* The signature characters corresponding to primitive types, for example, SHORT_TYPE_NAMES[T_INT] = "I"
*/
String[] SHORT_TYPE_NAMES = {ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE, "Z", "C", "F", "D", "B", "S", "I", "J", "V", ILLEGAL_TYPE,
ILLEGAL_TYPE, ILLEGAL_TYPE};
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/apache/bcel/Repository.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.apache.bcel.util.SyntheticRepository;

/**
* The repository maintains informations about class interdependencies, e.g., whether a class is a sub-class of another.
* The repository maintains informations about class interdependencies, for example, whether a class is a sub-class of another.
* Delegates actual class loading to SyntheticRepository with current class path by default.
*
* @see org.apache.bcel.util.Repository
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/apache/bcel/classfile/ConstantObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
public interface ConstantObject {

/**
* Gets the object representing the constant, e.g., Long for ConstantLong.
* Gets the object representing the constant, for example, Long for ConstantLong.
*
* @param constantPool the constant.
* @return object representing the constant, e.g., Long for ConstantLong.
* @return object representing the constant, for example, Long for ConstantLong.
*/
Object getConstantValue(ConstantPool constantPool);
}
2 changes: 1 addition & 1 deletion src/main/java/org/apache/bcel/classfile/EmptyVisitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
package org.apache.bcel.classfile;

/**
* Visitor with empty method bodies, can be extended and used in conjunction with the DescendingVisitor class, e.g. By
* Visitor with empty method bodies, can be extended and used in conjunction with the DescendingVisitor class, for example. By
* courtesy of David Spencer.
*
* @see DescendingVisitor
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/apache/bcel/classfile/Method.java
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public int hashCode() {

/**
* Return string representation close to declaration format, 'public static void main(String[] args) throws
* IOException', e.g.
* IOException', for example.
*
* @return String representation of the method.
*/
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/apache/bcel/classfile/Utility.java
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public static String codeToString(final byte[] code, final ConstantPool constant
* @param constantPool Array of constants
* @param index offset in 'code' array <EM>(number of opcodes, not bytes!)</EM>
* @param length number of opcodes to decompile, -1 for all
* @param verbose be verbose, e.g. print constant pool index
* @param verbose be verbose, for example print constant pool index
* @return String representation of byte codes
*/
public static String codeToString(final byte[] code, final ConstantPool constantPool, final int index, final int length, final boolean verbose) {
Expand Down Expand Up @@ -277,7 +277,7 @@ public static String codeToString(final ByteSequence bytes, final ConstantPool c
*
* @param bytes stream of bytes
* @param constantPool Array of constants
* @param verbose be verbose, e.g. print constant pool index
* @param verbose be verbose, for example print constant pool index
* @return String representation of byte code
* @throws IOException if a failure from reading from the bytes argument occurs
*/
Expand Down Expand Up @@ -759,7 +759,7 @@ public static String format(final int i, final int length, final boolean leftJus
*/

/**
* Parse Java type such as "char", or "java.lang.String[]" and return the signature in byte code format, e.g. "C" or
* Parse Java type such as "char", or "java.lang.String[]" and return the signature in byte code format, for example "C" or
* "[Ljava/lang/String;" respectively.
*
* @param type Java type
Expand Down Expand Up @@ -1195,7 +1195,7 @@ public static String signatureToString(final String signature, final boolean cho
* Convert bytes into hexadecimal string
*
* @param bytes an array of bytes to convert to hexadecimal
* @return bytes as hexadecimal string, e.g. 00 fa 12 ...
* @return bytes as hexadecimal string, for example 00 fa 12 ...
*/
public static String toHexString(final byte[] bytes) {
final StringBuilder buf = new StringBuilder();
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/apache/bcel/generic/ArrayType.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ public final class ArrayType extends ReferenceType {
private final Type basicType;

/**
* Convenience constructor for array type, e.g. int[]
* Convenience constructor for array type, for example int[]
*
* @param type array type, e.g. T_INT
* @param type array type, for example T_INT
* @param dimensions array dimensions
*/
public ArrayType(final byte type, final int dimensions) {
this(BasicType.getType(type), dimensions);
}

/**
* Convenience constructor for reference array type, e.g. Object[]
* Convenience constructor for reference array type, for example Object[]
*
* @param className complete name of class ({@link String}, for example)
* @param dimensions array dimensions
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/apache/bcel/generic/BIPUSH.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public Number getValue() {
}

/**
* Read needed data (e.g. index) from file.
* Read needed data (for example index) from file.
*/
@Override
protected void initFromFile(final ByteSequence bytes, final boolean wide) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ protected int getTargetOffset(final InstructionHandle target) {
}

/**
* Read needed data (e.g. index) from file. Conversion to a InstructionHandle is done in InstructionList(byte[]).
* Read needed data (for example index) from file. Conversion to a InstructionHandle is done in InstructionList(byte[]).
*
* @param bytes input stream
* @param wide wide prefix?
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/apache/bcel/generic/ClassGen.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public static void setComparator(final BCELComparator<ClassGen> comparator) {
/**
* Constructs a new instance from an existing class.
*
* @param clazz JavaClass object (e.g. read from file)
* @param clazz JavaClass object (for example read from file)
*/
public ClassGen(final JavaClass clazz) {
super(clazz.getAccessFlags());
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/apache/bcel/generic/ConstantPoolGen.java
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,7 @@ public ConstantPoolGen(final ConstantPool cp) {
}

/**
* Add a reference to an array class (e.g. String[][]) as needed by MULTIANEWARRAY instruction, e.g. to the
* ConstantPool.
* Add a reference to an array class (for example, String[][]) as needed by MULTIANEWARRAY instruction, for example, to the ConstantPool.
*
* @param type type of array class
* @return index of entry
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/apache/bcel/generic/FieldOrMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected FieldOrMethod(final short opcode, final int index) {
/**
* @return name of the referenced class/interface
* @deprecated If the instruction references an array class, this method will return "java.lang.Object". For code
* generated by Java 1.5, this answer is sometimes wrong (e.g., if the "clone()" method is called on an
* generated by Java 1.5, this answer is sometimes wrong (for example, if the "clone()" method is called on an
* array). A better idea is to use the {@link #getReferenceType(ConstantPoolGen)} method, which correctly
* distinguishes between class types and array types.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/apache/bcel/generic/GOTO_W.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void dump(final DataOutputStream out) throws IOException {
}

/**
* Read needed data (e.g. index) from file.
* Read needed data (for example index) from file.
*/
@Override
protected void initFromFile(final ByteSequence bytes, final boolean wide) throws IOException {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/apache/bcel/generic/IFEQ.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void accept(final Visitor v) {
}

/**
* @return negation of instruction, e.g. IFEQ.negate() == IFNE
* @return negation of instruction, for example IFEQ.negate() == IFNE
*/
@Override
public IfInstruction negate() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/apache/bcel/generic/IINC.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public Type getType(final ConstantPoolGen cp) {
}

/**
* Reads needed data (e.g. index) from file.
* Reads needed data (for example index) from file.
*/
@Override
protected void initFromFile(final ByteSequence bytes, final boolean wide) throws IOException {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/apache/bcel/generic/IfInstruction.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected IfInstruction(final short opcode, final InstructionHandle target) {
}

/**
* @return negation of instruction, e.g. IFEQ.negate() == IFNE
* @return negation of instruction, for example IFEQ.negate() == IFNE
*/
public abstract IfInstruction negate();
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
package org.apache.bcel.generic;

/**
* Denote entity that refers to an index, e.g. local variable instructions, RET, CPInstruction, etc.
* Denote entity that refers to an index, for example local variable instructions, RET, CPInstruction, etc.
*/
public interface IndexedInstruction {

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/apache/bcel/generic/Instruction.java
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ public int hashCode() {
}

/**
* Reads needed data (e.g. index) from file.
* Reads needed data (for example index) from file.
*
* @param bytes byte sequence to read from
* @param wide "wide" instruction flag
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/apache/bcel/generic/InstructionConst.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public final class InstructionConst {

/**
* You can use these constants in multiple places safely, if you can guarantee that you will never alter their internal
* values, e.g. call setIndex().
* values, for example call setIndex().
*/
public static final LocalVariableInstruction THIS = new ALOAD(0);
public static final LocalVariableInstruction ALOAD_0 = THIS;
Expand Down Expand Up @@ -284,7 +284,7 @@ public final class InstructionConst {
/**
* Gets the Instruction.
*
* @param index the index, e.g. {@link Const#RETURN}
* @param index the index, for example {@link Const#RETURN}
* @return the entry from the private INSTRUCTIONS table
*/
public static Instruction getInstruction(final int index) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class Clinit {

/**
* You can use these constants in multiple places safely, if you can guarantee that you will never alter their internal
* values, e.g. call setIndex().
* values, for example call setIndex().
*/
LocalVariableInstruction THIS = InstructionConst.THIS;
LocalVariableInstruction ALOAD_0 = InstructionConst.ALOAD_0;
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/org/apache/bcel/generic/InstructionFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.apache.bcel.Const;

/**
* Instances of this class may be used, e.g., to generate typed versions of instructions. Its main purpose is to be used
* Instances of this class may be used, for example, to generate typed versions of instructions. Its main purpose is to be used
* as the byte code generating backend of a compiler. You can subclass it to add your own create methods.
* <p>
* Note: The static createXXX methods return singleton instances from the {@link InstructionConst} class.
Expand Down Expand Up @@ -308,21 +308,21 @@ public static BranchInstruction createBranchInstruction(final short opcode, fina
}

/**
* @param size size of operand, either 1 (int, e.g.) or 2 (double)
* @param size size of operand, either 1 (int, for example) or 2 (double)
*/
public static StackInstruction createDup(final int size) {
return size == 2 ? InstructionConst.DUP2 : InstructionConst.DUP;
}

/**
* @param size size of operand, either 1 (int, e.g.) or 2 (double)
* @param size size of operand, either 1 (int, for example) or 2 (double)
*/
public static StackInstruction createDup_1(final int size) {
return size == 2 ? InstructionConst.DUP2_X1 : InstructionConst.DUP_X1;
}

/**
* @param size size of operand, either 1 (int, e.g.) or 2 (double)
* @param size size of operand, either 1 (int, for example) or 2 (double)
*/
public static StackInstruction createDup_2(final int size) {
return size == 2 ? InstructionConst.DUP2_X2 : InstructionConst.DUP_X2;
Expand Down Expand Up @@ -381,7 +381,7 @@ public static Instruction createNull(final Type type) {
}

/**
* @param size size of operand, either 1 (int, e.g.) or 2 (double)
* @param size size of operand, either 1 (int, for example) or 2 (double)
*/
public static StackInstruction createPop(final int size) {
return size == 2 ? InstructionConst.POP2 : InstructionConst.POP;
Expand Down Expand Up @@ -505,7 +505,7 @@ public Instruction createAppend(final Type type) {
}

/**
* Create conversion operation for two stack operands, this may be an I2C, instruction, e.g., if the operands are basic
* Create conversion operation for two stack operands, this may be an I2C, instruction, for example, if the operands are basic
* types and CHECKCAST if they are reference types.
*/
public Instruction createCast(final Type srcType, final Type destType) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/apache/bcel/generic/InstructionList.java
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ private void remove(final InstructionHandle prev, InstructionHandle next) throws
last.setNext(null);
final List<InstructionHandle> targetList = new ArrayList<>();
for (InstructionHandle ih = first; ih != null; ih = ih.getNext()) {
ih.getInstruction().dispose(); // e.g. BranchInstructions release their targets
ih.getInstruction().dispose(); // for example BranchInstructions release their targets
}
final StringBuilder buf = new StringBuilder("{ ");
for (InstructionHandle ih = first; ih != null; ih = next) {
Expand Down Expand Up @@ -1076,7 +1076,7 @@ public void setPositions() { // TODO could be package-protected? (some test code
/**
* Give all instructions their position number (offset in byte stream), i.e., make the list ready to be dumped.
*
* @param check Perform sanity checks, e.g. if all targeted instructions really belong to this list
* @param check Perform sanity checks, for example if all targeted instructions really belong to this list
*/
public void setPositions(final boolean check) { // called by code in other packages
int maxAdditionalBytes = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/apache/bcel/generic/JSR_W.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void dump(final DataOutputStream out) throws IOException {
}

/**
* Read needed data (e.g. index) from file.
* Read needed data (for example index) from file.
*/
@Override
protected void initFromFile(final ByteSequence bytes, final boolean wide) throws IOException {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/apache/bcel/generic/LDC.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public Object getValue(final ConstantPoolGen cpg) {
}

/**
* Read needed data (e.g. index) from file.
* Read needed data (for example index) from file.
*/
@Override
protected void initFromFile(final ByteSequence bytes, final boolean wide) throws IOException {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/apache/bcel/generic/LOOKUPSWITCH.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void dump(final DataOutputStream out) throws IOException {
}

/**
* Read needed data (e.g. index) from file.
* Read needed data (for example index) from file.
*/
@Override
protected void initFromFile(final ByteSequence bytes, final boolean wide) throws IOException {
Expand Down
Loading

0 comments on commit 4580fc6

Please sign in to comment.