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
The following commit(s) were added to refs/heads/master by this push: new f93a0dbd Use single quote ' instead of ` f93a0dbd is described below commit f93a0dbd61119e45782cc665d2b5889019b36c6d Author: Gary David Gregory (Code signing key) <ggreg...@apache.org> AuthorDate: Tue Nov 22 13:34:00 2022 -0500 Use single quote ' instead of ` --- src/examples/HelloWorldBuilder.java | 10 +-- src/examples/Mini/ASTExpr.java | 8 +-- src/examples/Mini/ASTFunDecl.java | 6 +- src/examples/Mini/ASTProgram.java | 8 +-- src/examples/Mini/Environment.java | 4 +- src/examples/Mini/MiniParser.java | 2 +- src/examples/PatchClass.java | 6 +- .../java/org/apache/bcel/classfile/Attribute.java | 4 +- src/main/java/org/apache/bcel/classfile/Code.java | 2 +- .../java/org/apache/bcel/classfile/Constant.java | 6 +- .../org/apache/bcel/classfile/ConstantPool.java | 8 +-- src/main/java/org/apache/bcel/classfile/Field.java | 2 +- .../java/org/apache/bcel/classfile/JavaClass.java | 6 +- .../org/apache/bcel/classfile/LocalVariable.java | 6 +- .../apache/bcel/classfile/LocalVariableTable.java | 2 +- .../java/org/apache/bcel/classfile/Method.java | 4 +- .../java/org/apache/bcel/classfile/Synthetic.java | 2 +- .../java/org/apache/bcel/classfile/Utility.java | 72 +++++++++++----------- .../java/org/apache/bcel/classfile/Visitor.java | 2 +- .../java/org/apache/bcel/generic/BasicType.java | 2 +- .../org/apache/bcel/generic/BranchInstruction.java | 4 +- .../java/org/apache/bcel/generic/ClassGen.java | 2 +- .../org/apache/bcel/generic/CodeExceptionGen.java | 2 +- .../apache/bcel/generic/CompoundInstruction.java | 4 +- .../org/apache/bcel/generic/ConstantPoolGen.java | 10 +-- .../java/org/apache/bcel/generic/FieldGen.java | 2 +- .../apache/bcel/generic/FieldGenOrMethodGen.java | 4 +- .../java/org/apache/bcel/generic/Instruction.java | 4 +- .../apache/bcel/generic/InstructionFactory.java | 2 +- .../org/apache/bcel/generic/InstructionHandle.java | 2 +- .../org/apache/bcel/generic/InstructionList.java | 10 +-- .../org/apache/bcel/generic/LineNumberGen.java | 2 +- .../org/apache/bcel/generic/LocalVariableGen.java | 6 +- .../java/org/apache/bcel/generic/MethodGen.java | 28 ++++----- src/main/java/org/apache/bcel/generic/Select.java | 6 +- src/main/java/org/apache/bcel/generic/Type.java | 12 ++-- .../java/org/apache/bcel/util/ByteSequence.java | 2 +- src/main/java/org/apache/bcel/util/Class2HTML.java | 4 +- .../org/apache/bcel/util/InstructionFinder.java | 4 +- .../java/org/apache/bcel/data/ConstantPoolX.java | 8 +-- 40 files changed, 140 insertions(+), 140 deletions(-) diff --git a/src/examples/HelloWorldBuilder.java b/src/examples/HelloWorldBuilder.java index 431561f2..c5d5721e 100644 --- a/src/examples/HelloWorldBuilder.java +++ b/src/examples/HelloWorldBuilder.java @@ -75,7 +75,7 @@ public class HelloWorldBuilder { final ObjectType iStream = new ObjectType("java.io.InputStream"); final ObjectType pStream = new ObjectType("java.io.PrintStream"); - // Create BufferedReader object and store it in local variable `in'. + // Create BufferedReader object and store it in local variable 'in'. il.append(factory.createNew("java.io.BufferedReader")); il.append(InstructionConst.DUP); // Use predefined constant, i.e. flyweight il.append(factory.createNew("java.io.InputStreamReader")); @@ -86,16 +86,16 @@ public class HelloWorldBuilder { il.append(factory.createInvoke("java.io.InputStreamReader", "<init>", Type.VOID, new Type[] {iStream}, Const.INVOKESPECIAL)); il.append(factory.createInvoke("java.io.BufferedReader", "<init>", Type.VOID, new Type[] {new ObjectType("java.io.Reader")}, Const.INVOKESPECIAL)); - // Create local variable `in' + // Create local variable 'in' LocalVariableGen lg = mg.addLocalVariable("in", new ObjectType("java.io.BufferedReader"), null, null); final int in = lg.getIndex(); - lg.setStart(il.append(new ASTORE(in))); // `i' valid from here + lg.setStart(il.append(new ASTORE(in))); // 'i' valid from here - // Create local variable `name' + // Create local variable 'name' lg = mg.addLocalVariable("name", Type.STRING, null, null); final int name = lg.getIndex(); il.append(InstructionConst.ACONST_NULL); - lg.setStart(il.append(new ASTORE(name))); // `name' valid from here + lg.setStart(il.append(new ASTORE(name))); // 'name' valid from here // try { ... final InstructionHandle tryStart = il.append(factory.createFieldAccess("java.lang.System", "out", pStream, Const.GETSTATIC)); diff --git a/src/examples/Mini/ASTExpr.java b/src/examples/Mini/ASTExpr.java index 0fd88372..03b31f13 100644 --- a/src/examples/Mini/ASTExpr.java +++ b/src/examples/Mini/ASTExpr.java @@ -35,9 +35,9 @@ import org.apache.bcel.generic.MethodGen; import org.apache.bcel.generic.PUSH; /** - * Represents arithmetic expressions such as `(a + 12 == b) OR c'. The parse tree is built initially by the parser and - * modified, i.e. compacted with `traverse()'. Each (Expr, Term, Factor) node with kind == -1 is replaced which its - * successor node, which is converted to type `Expr' + * Represents arithmetic expressions such as '(a + 12 == b) OR c'. The parse tree is built initially by the parser and + * modified, i.e. compacted with 'traverse()'. Each (Expr, Term, Factor) node with kind == -1 is replaced which its + * successor node, which is converted to type 'Expr' * * A node with kind == -1 denotes the fact that this expression node has just one child branch and thus may be replaced * by this branch (or leaf) directly without altering the expression semantics. Term and Factor nodes are used only to @@ -65,7 +65,7 @@ public class ASTExpr extends SimpleNode implements MiniParserConstants, MiniPars protected int line, column; - protected boolean is_simple; // true, if simple expression like `12 + f(a)' + protected boolean is_simple; // true, if simple expression like '12 + f(a)' /* * Not all children shall inherit this, exceptions are ASTIdent and ASTFunAppl, which look up the type in the diff --git a/src/examples/Mini/ASTFunDecl.java b/src/examples/Mini/ASTFunDecl.java index 48cd574b..52feecbb 100644 --- a/src/examples/Mini/ASTFunDecl.java +++ b/src/examples/Mini/ASTFunDecl.java @@ -165,7 +165,7 @@ public class ASTFunDecl extends SimpleNode implements MiniParserTreeConstants { private int line, column; - private boolean is_simple; // true, if simple expression like `12 + f(a)' + private boolean is_simple; // true, if simple expression like '12 + f(a)' private boolean is_recursive; // Not used yet, TODO @@ -200,7 +200,7 @@ public class ASTFunDecl extends SimpleNode implements MiniParserTreeConstants { final String fname = name.getName(); final InstructionList il = new InstructionList(); - Type[] args = {new ArrayType(Type.STRING, 1)}; // default for `main' + Type[] args = {new ArrayType(Type.STRING, 1)}; // default for 'main' String[] arg_names = {"$argv"}; if (fname.equals("main")) { @@ -466,7 +466,7 @@ public class ASTFunDecl extends SimpleNode implements MiniParserTreeConstants { /* * Update entry of this function, i.e. set argument references. The entry is already in there by garantuee, but may be - * of wrong type, i.e. the user defined a function `TRUE', e.g. and `TRUE' is of type `Variable'. + * of wrong type, i.e. the user defined a function 'TRUE', e.g. and 'TRUE' is of type 'Variable'. */ try { final Function fun = (Function) env.get(name.getName()); diff --git a/src/examples/Mini/ASTProgram.java b/src/examples/Mini/ASTProgram.java index fa79eb49..683063a2 100644 --- a/src/examples/Mini/ASTProgram.java +++ b/src/examples/Mini/ASTProgram.java @@ -157,7 +157,7 @@ public class ASTProgram extends SimpleNode implements MiniParserConstants, MiniP il.dispose(); // Dispose instruction handles for better memory utilization il = new InstructionList(); - il.append(new ALOAD(0)); // Push `this' + il.append(new ALOAD(0)); // Push 'this' il.append(new INVOKESPECIAL(cp.addMethodref("java.lang.Object", "<init>", "()V"))); il.append(new RETURN()); @@ -279,7 +279,7 @@ public class ASTProgram extends SimpleNode implements MiniParserConstants, MiniP if (fun != null) { MiniC.addError(f.getLine(), f.getColumn(), "Redeclaration of " + fun + "."); } else { - env.put(new Function(name, null)); // `args' will be set by FunDecl.traverse() + env.put(new Function(name, null)); // 'args' will be set by FunDecl.traverse() } } @@ -288,7 +288,7 @@ public class ASTProgram extends SimpleNode implements MiniParserConstants, MiniP for (int i = 0; i < fun_decls.length; i++) { fun_decls[i] = fun_decls[i].traverse((Environment) env.clone()); - // Look for `main' routine + // Look for 'main' routine fname = fun_decls[i].getName().getName(); if (fname.equals("main")) { main = (Function) env.get(fname); @@ -296,7 +296,7 @@ public class ASTProgram extends SimpleNode implements MiniParserConstants, MiniP } if (main == null) { - MiniC.addError(0, 0, "You didn't declare a `main' function."); + MiniC.addError(0, 0, "You didn't declare a 'main' function."); } else if (main.getNoArgs() != 0) { MiniC.addError(main.getLine(), main.getColumn(), "Main function has too many arguments declared."); } diff --git a/src/examples/Mini/Environment.java b/src/examples/Mini/Environment.java index cc0703ec..11faba8e 100644 --- a/src/examples/Mini/Environment.java +++ b/src/examples/Mini/Environment.java @@ -24,8 +24,8 @@ import java.util.Vector; * That environment contains all function definitions and identifiers. Hash keys are Strings (identifiers), which are * mapped to a table index. * - * The table consists of `SIZE' fields which have `SLOTS' subfields. Thus the maximum number of storable items is - * `SLOTS' * `SIZE'. + * The table consists of 'SIZE' fields which have 'SLOTS' subfields. Thus the maximum number of storable items is + * 'SLOTS' * 'SIZE'. */ public class Environment implements Cloneable { private static final int SIZE = 127; // Prime number large enough for most cases diff --git a/src/examples/Mini/MiniParser.java b/src/examples/Mini/MiniParser.java index 6496a2e8..44ba3111 100644 --- a/src/examples/Mini/MiniParser.java +++ b/src/examples/Mini/MiniParser.java @@ -993,7 +993,7 @@ public class MiniParser/* @bgen(jjtree) */ implements MiniParserTreeConstants, M } /* - * A program consists of a number of function declarations with a distinguished function `main' that starts the program. + * A program consists of a number of function declarations with a distinguished function 'main' that starts the program. */ static public void Program() throws ParseException { /* @bgen(jjtree) Program */ diff --git a/src/examples/PatchClass.java b/src/examples/PatchClass.java index b11f9610..d1c4b296 100644 --- a/src/examples/PatchClass.java +++ b/src/examples/PatchClass.java @@ -68,16 +68,16 @@ public class PatchClass { c = (ConstantUtf8) constantPool[i]; // Get the string str = c.getBytes(); - if ((index = str.indexOf(old)) != -1) { // `old' found in str + if ((index = str.indexOf(old)) != -1) { // 'old' found in str buf = new StringBuilder(); // target buffer oldIndex = 0; // String start offset // While we have something to replace while ((index = str.indexOf(old, oldIndex)) != -1) { buf.append(str.substring(oldIndex, index)); // append prefix - buf.append(replacement); // append `replacement' + buf.append(replacement); // append 'replacement' - oldIndex = index + old.length(); // Skip `old'.length chars + oldIndex = index + old.length(); // Skip 'old'.length chars } buf.append(str.substring(oldIndex)); // append rest of string diff --git a/src/main/java/org/apache/bcel/classfile/Attribute.java b/src/main/java/org/apache/bcel/classfile/Attribute.java index 14a76cc2..69168e2a 100644 --- a/src/main/java/org/apache/bcel/classfile/Attribute.java +++ b/src/main/java/org/apache/bcel/classfile/Attribute.java @@ -109,7 +109,7 @@ public abstract class Attribute implements Cloneable, Node { */ public static Attribute readAttribute(final DataInput dataInput, final ConstantPool constantPool) throws IOException { byte tag = Const.ATTR_UNKNOWN; // Unknown attribute - // Get class name from constant pool via `name_index' indirection + // Get class name from constant pool via 'name_index' indirection final int nameIndex = dataInput.readUnsignedShort(); final String name = constantPool.getConstantUtf8(nameIndex).getBytes(); @@ -124,7 +124,7 @@ public abstract class Attribute implements Cloneable, Node { } } - // Call proper constructor, depending on `tag' + // Call proper constructor, depending on 'tag' switch (tag) { case Const.ATTR_UNKNOWN: final Object r = READERS.get(name); diff --git a/src/main/java/org/apache/bcel/classfile/Code.java b/src/main/java/org/apache/bcel/classfile/Code.java index e46a2da8..09163047 100644 --- a/src/main/java/org/apache/bcel/classfile/Code.java +++ b/src/main/java/org/apache/bcel/classfile/Code.java @@ -98,7 +98,7 @@ public final class Code extends Attribute { exceptionTable[i] = new CodeException(file); } /* - * Read all attributes, currently `LineNumberTable' and `LocalVariableTable' + * Read all attributes, currently 'LineNumberTable' and 'LocalVariableTable' */ final int attributesCount = file.readUnsignedShort(); attributes = new Attribute[attributesCount]; diff --git a/src/main/java/org/apache/bcel/classfile/Constant.java b/src/main/java/org/apache/bcel/classfile/Constant.java index 3b97a29f..75bb4d14 100644 --- a/src/main/java/org/apache/bcel/classfile/Constant.java +++ b/src/main/java/org/apache/bcel/classfile/Constant.java @@ -112,11 +112,11 @@ public abstract class Constant implements Cloneable, Node { } /* - * In fact this tag is redundant since we can distinguish different `Constant' objects by their type, i.e., via - * `instanceof'. In some places we will use the tag for switch()es anyway. + * In fact this tag is redundant since we can distinguish different 'Constant' objects by their type, i.e., via + * 'instanceof'. In some places we will use the tag for switch()es anyway. * * First, we want match the specification as closely as possible. Second we need the tag as an index to select the - * corresponding class name from the `CONSTANT_NAMES' array. + * corresponding class name from the 'CONSTANT_NAMES' array. */ /** * @deprecated (since 6.0) will be made private; do not access directly, use getter/setter diff --git a/src/main/java/org/apache/bcel/classfile/ConstantPool.java b/src/main/java/org/apache/bcel/classfile/ConstantPool.java index b744a2bc..2ccabe01 100644 --- a/src/main/java/org/apache/bcel/classfile/ConstantPool.java +++ b/src/main/java/org/apache/bcel/classfile/ConstantPool.java @@ -193,7 +193,7 @@ public class ConstantPool implements Cloneable, Node, Iterable<Constant> { } /** - * Retrieves constant at `index' from constant pool and resolve it to a string representation. + * Retrieves constant at 'index' from constant pool and resolve it to a string representation. * * @param index of constant in constant pool * @param tag expected type @@ -283,7 +283,7 @@ public class ConstantPool implements Cloneable, Node, Iterable<Constant> { public <T extends Constant> T getConstant(final int index, final byte tag, final Class<T> castTo) throws ClassFormatException { final T c = getConstant(index); if (c.getTag() != tag) { - throw new ClassFormatException("Expected class `" + Const.getConstantName(tag) + "' at index " + index + " and got " + c); + throw new ClassFormatException("Expected class '" + Const.getConstantName(tag) + "' at index " + index + " and got " + c); } return c; } @@ -341,8 +341,8 @@ public class ConstantPool implements Cloneable, Node, Iterable<Constant> { } /** - * Gets string from constant pool and bypass the indirection of `ConstantClass' and `ConstantString' objects. I.e. these classes have an index field that - * points to another entry of the constant pool of type `ConstantUtf8' which contains the real data. + * Gets string from constant pool and bypass the indirection of 'ConstantClass' and 'ConstantString' objects. I.e. these classes have an index field that + * points to another entry of the constant pool of type 'ConstantUtf8' which contains the real data. * * @param index Index in constant pool * @param tag Tag of expected constant, either ConstantClass or ConstantString diff --git a/src/main/java/org/apache/bcel/classfile/Field.java b/src/main/java/org/apache/bcel/classfile/Field.java index 89df787b..b26f2ad3 100644 --- a/src/main/java/org/apache/bcel/classfile/Field.java +++ b/src/main/java/org/apache/bcel/classfile/Field.java @@ -160,7 +160,7 @@ public final class Field extends FieldOrMethod { } /** - * Return string representation close to declaration format, `public static final short MAX = 100', e.g.. + * Return string representation close to declaration format, 'public static final short MAX = 100', e.g.. * * @return String representation of field, including the signature. */ diff --git a/src/main/java/org/apache/bcel/classfile/JavaClass.java b/src/main/java/org/apache/bcel/classfile/JavaClass.java index d55cc1ba..e5464051 100644 --- a/src/main/java/org/apache/bcel/classfile/JavaClass.java +++ b/src/main/java/org/apache/bcel/classfile/JavaClass.java @@ -82,7 +82,7 @@ public class JavaClass extends AccessFlags implements Cloneable, Node, Comparabl }; /* - * Print debug information depending on `JavaClass.debug' + * Print debug information depending on 'JavaClass.debug' */ static void Debug(final String str) { if (debug) { @@ -215,8 +215,8 @@ public class JavaClass extends AccessFlags implements Cloneable, Node, Comparabl } } /* - * According to the specification the following entries must be of type `ConstantClass' but we check that anyway via the - * `ConstPool.getConstant' method. + * According to the specification the following entries must be of type 'ConstantClass' but we check that anyway via the + * 'ConstPool.getConstant' method. */ className = constantPool.getConstantString(classNameIndex, Const.CONSTANT_Class); className = Utility.compactClassName(className, false); diff --git a/src/main/java/org/apache/bcel/classfile/LocalVariable.java b/src/main/java/org/apache/bcel/classfile/LocalVariable.java index 0b27b693..1cb011e5 100644 --- a/src/main/java/org/apache/bcel/classfile/LocalVariable.java +++ b/src/main/java/org/apache/bcel/classfile/LocalVariable.java @@ -77,7 +77,7 @@ public final class LocalVariable implements Cloneable, Node, Constants { * @param length ... is valid * @param nameIndex Index in constant pool of variable name * @param signatureIndex Index of variable's signature - * @param index Variable is `index'th local variable on the method's frame + * @param index Variable is 'index'th local variable on the method's frame * @param constantPool Array of constants */ public LocalVariable(final int startPc, final int length, final int nameIndex, final int signatureIndex, final int index, final ConstantPool constantPool) { @@ -89,9 +89,9 @@ public final class LocalVariable implements Cloneable, Node, Constants { * @param length ... is valid * @param nameIndex Index in constant pool of variable name * @param signatureIndex Index of variable's signature - * @param index Variable is `index'th local variable on the method's frame + * @param index Variable is 'index'th local variable on the method's frame * @param constantPool Array of constants - * @param origIndex Variable is `index'th local variable on the method's frame prior to any changes + * @param origIndex Variable is 'index'th local variable on the method's frame prior to any changes */ public LocalVariable(final int startPc, final int length, final int nameIndex, final int signatureIndex, final int index, final ConstantPool constantPool, final int origIndex) { diff --git a/src/main/java/org/apache/bcel/classfile/LocalVariableTable.java b/src/main/java/org/apache/bcel/classfile/LocalVariableTable.java index d1125708..5b281820 100644 --- a/src/main/java/org/apache/bcel/classfile/LocalVariableTable.java +++ b/src/main/java/org/apache/bcel/classfile/LocalVariableTable.java @@ -56,7 +56,7 @@ public class LocalVariableTable extends Attribute implements Iterable<LocalVaria } /** - * @param nameIndex Index in constant pool to `LocalVariableTable' + * @param nameIndex Index in constant pool to 'LocalVariableTable' * @param length Content length in bytes * @param localVariableTable Table of local variables * @param constantPool Array of constants diff --git a/src/main/java/org/apache/bcel/classfile/Method.java b/src/main/java/org/apache/bcel/classfile/Method.java index 63381187..234b0e1e 100644 --- a/src/main/java/org/apache/bcel/classfile/Method.java +++ b/src/main/java/org/apache/bcel/classfile/Method.java @@ -75,7 +75,7 @@ public final class Method extends FieldOrMethod { private ParameterAnnotationEntry[] parameterAnnotationEntries; /** - * Empty constructor, all attributes have to be defined via `setXXX' methods. Use at your own risk. + * Empty constructor, all attributes have to be defined via 'setXXX' methods. Use at your own risk. */ public Method() { } @@ -223,7 +223,7 @@ public final class Method extends FieldOrMethod { } /** - * Return string representation close to declaration format, `public static void main(String[] args) throws + * Return string representation close to declaration format, 'public static void main(String[] args) throws * IOException', e.g. * * @return String representation of the method. diff --git a/src/main/java/org/apache/bcel/classfile/Synthetic.java b/src/main/java/org/apache/bcel/classfile/Synthetic.java index ab7a1d17..9d89ff6e 100644 --- a/src/main/java/org/apache/bcel/classfile/Synthetic.java +++ b/src/main/java/org/apache/bcel/classfile/Synthetic.java @@ -24,7 +24,7 @@ import org.apache.bcel.Const; import org.apache.bcel.util.Args; /** - * This class is derived from <em>Attribute</em> and declares this class as `synthetic', i.e., it needs special + * This class is derived from <em>Attribute</em> and declares this class as 'synthetic', i.e., it needs special * handling. The JVM specification states "A class member that does not appear in the source code must be marked using a * Synthetic attribute." It may appear in the ClassFile attribute table, a field_info table or a method_info table. This * class is intended to be instantiated from the <em>Attribute.readAttribute()</em> method. diff --git a/src/main/java/org/apache/bcel/classfile/Utility.java b/src/main/java/org/apache/bcel/classfile/Utility.java index 0bf064ae..4d2bc084 100644 --- a/src/main/java/org/apache/bcel/classfile/Utility.java +++ b/src/main/java/org/apache/bcel/classfile/Utility.java @@ -136,8 +136,8 @@ public abstract class Utility { private static final ThreadLocal<Integer> CONSUMER_CHARS = ThreadLocal.withInitial(() -> Integer.valueOf(0)); /* - * The `WIDE' instruction is used in the byte code to allow 16-bit wide indices for local variables. This opcode - * precedes an `ILOAD', e.g.. The opcode immediately following takes an extra byte which is combined with the following + * The 'WIDE' instruction is used in the byte code to allow 16-bit wide indices for local variables. This opcode + * precedes an 'ILOAD', e.g.. The opcode immediately following takes an extra byte which is combined with the following * byte to form a 16-bit value. */ private static boolean wide; @@ -171,7 +171,7 @@ public abstract class Utility { } /** - * Convert bit field of flags into string such as `static final'. + * Convert bit field of flags into string such as 'static final'. * * @param accessFlags Access flags * @return String representation of flags @@ -181,10 +181,10 @@ public abstract class Utility { } /** - * Convert bit field of flags into string such as `static final'. + * Convert bit field of flags into string such as 'static final'. * - * Special case: Classes compiled with new compilers and with the `ACC_SUPER' flag would be said to be "synchronized". - * This is because SUN used the same value for the flags `ACC_SUPER' and `ACC_SYNCHRONIZED'. + * Special case: Classes compiled with new compilers and with the 'ACC_SUPER' flag would be said to be "synchronized". + * This is because SUN used the same value for the flags 'ACC_SUPER' and 'ACC_SYNCHRONIZED'. * * @param accessFlags Access flags * @param forClass access flags are for class qualifiers ? @@ -197,8 +197,8 @@ public abstract class Utility { p = pow2(i); if ((accessFlags & p) != 0) { /* - * Special case: Classes compiled with new compilers and with the `ACC_SUPER' flag would be said to be "synchronized". - * This is because SUN used the same value for the flags `ACC_SUPER' and `ACC_SYNCHRONIZED'. + * Special case: Classes compiled with new compilers and with the 'ACC_SUPER' flag would be said to be "synchronized". + * This is because SUN used the same value for the flags 'ACC_SUPER' and 'ACC_SYNCHRONIZED'. */ if (forClass && (p == Const.ACC_SUPER || p == Const.ACC_INTERFACE)) { continue; @@ -226,7 +226,7 @@ public abstract class Utility { } /** - * @return `flag' with bit `i' set to 0 + * @return 'flag' with bit 'i' set to 0 */ public static int clearBit(final int flag, final int i) { final int bit = pow2(i); @@ -238,12 +238,12 @@ public abstract class Utility { } /** - * Disassemble a byte array of JVM byte codes starting from code line `index' and return the disassembled string - * representation. Decode only `num' opcodes (including their operands), use -1 if you want to decompile everything. + * Disassemble a byte array of JVM byte codes starting from code line 'index' and return the disassembled string + * representation. Decode only 'num' opcodes (including their operands), use -1 if you want to decompile everything. * * @param code byte code array * @param constantPool Array of constants - * @param index offset in `code' array <EM>(number of opcodes, not bytes!)</EM> + * @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 * @return String representation of byte codes @@ -566,8 +566,8 @@ public abstract class Utility { */ public static String compactClassName(String str, final String prefix, final boolean chopit) { final int len = prefix.length(); - str = pathToPackage(str); // Is `/' on all systems, even DOS - // If string starts with `prefix' and contains no further dots + str = pathToPackage(str); // Is '/' on all systems, even DOS + // If string starts with 'prefix' and contains no further dots if (chopit && str.startsWith(prefix) && str.substring(len).indexOf('.') == -1) { str = str.substring(len); } @@ -716,7 +716,7 @@ public abstract class Utility { } /** - * Fillup char with up to length characters with char `fill' and justify it left or right. + * Fillup char with up to length characters with char 'fill' and justify it left or right. * * @param str string to format * @param length length of desired string @@ -735,7 +735,7 @@ public abstract class Utility { } /** - * Return a string for an integer justified left or right and filled up with `fill' characters if necessary. + * Return a string for an integer justified left or right and filled up with 'fill' characters if necessary. * * @param i integer to format * @param length length of desired string @@ -840,7 +840,7 @@ public abstract class Utility { } /** - * @return true, if bit `i' in `flag' is set + * @return true, if bit 'i' in 'flag' is set */ public static boolean isSet(final int flag, final int i) { return (flag & pow2(i)) != 0; @@ -869,7 +869,7 @@ public abstract class Utility { final List<String> vec = new ArrayList<>(); int index; try { - // Skip any type arguments to read argument declarations between `(' and `)' + // Skip any type arguments to read argument declarations between '(' and ')' index = signature.indexOf('(') + 1; if (index <= 0) { throw new ClassFormatException("Invalid method signature: " + signature); @@ -908,7 +908,7 @@ public abstract class Utility { int index; String type; try { - // Read return type after `)' + // Read return type after ')' index = signature.lastIndexOf(')') + 1; if (index <= 0) { throw new ClassFormatException("Invalid method signature: " + signature); @@ -946,8 +946,8 @@ public abstract class Utility { } /** - * This method converts a method signature string into a Java type declaration like `void main(String[])' and throws a - * `ClassFormatException' when the parsed type is invalid. + * This method converts a method signature string into a Java type declaration like 'void main(String[])' and throws a + * 'ClassFormatException' when the parsed type is invalid. * * @param signature Method signature * @param name Method name @@ -964,7 +964,7 @@ public abstract class Utility { int index; int varIndex = access.contains("static") ? 0 : 1; try { - // Skip any type arguments to read argument declarations between `(' and `)' + // Skip any type arguments to read argument declarations between '(' and ')' index = signature.indexOf('(') + 1; if (index <= 0) { throw new ClassFormatException("Invalid method signature: " + signature); @@ -990,7 +990,7 @@ public abstract class Utility { index += unwrap(CONSUMER_CHARS); // update position } index++; // update position - // Read return type after `)' + // Read return type after ')' type = typeSignatureToString(signature.substring(index), chopit); } catch (final StringIndexOutOfBoundsException e) { // Should never occur throw new ClassFormatException("Invalid method signature: " + signature, e); @@ -1108,14 +1108,14 @@ public abstract class Utility { int index; int oldIndex; try { - if (str.contains(old)) { // `old' found in str + if (str.contains(old)) { // 'old' found in str final StringBuilder buf = new StringBuilder(); oldIndex = 0; // String start offset // While we have something to replace while ((index = str.indexOf(old, oldIndex)) != -1) { buf.append(str, oldIndex, index); // append prefix buf.append(new_); // append replacement - oldIndex = index + old.length(); // Skip `old'.length chars + oldIndex = index + old.length(); // Skip 'old'.length chars } buf.append(str.substring(oldIndex)); // append rest of string str = buf.toString(); @@ -1140,7 +1140,7 @@ public abstract class Utility { } /** - * @return `flag' with bit `i' set to 1 + * @return 'flag' with bit 'i' set to 1 */ public static int setBit(final int flag, final int i) { return flag | pow2(i); @@ -1386,8 +1386,8 @@ public abstract class Utility { /** * - * This method converts a type signature string into a Java type declaration such as `String[]' and throws a - * `ClassFormatException' when the parsed type is invalid. + * This method converts a type signature string into a Java type declaration such as 'String[]' and throws a + * 'ClassFormatException' when the parsed type is invalid. * * @param signature type signature * @param chopit flag that determines whether chopping is executed or not @@ -1397,7 +1397,7 @@ public abstract class Utility { */ public static String typeSignatureToString(final String signature, final boolean chopit) throws ClassFormatException { // corrected concurrent private static field acess - wrap(CONSUMER_CHARS, 1); // This is the default, read just one char like `B' + wrap(CONSUMER_CHARS, 1); // This is the default, read just one char like 'B' try { switch (signature.charAt(0)) { case 'B': @@ -1413,12 +1413,12 @@ public abstract class Utility { case 'J': return "long"; case 'T': { // TypeVariableSignature - final int index = signature.indexOf(';'); // Look for closing `;' + final int index = signature.indexOf(';'); // Look for closing ';' if (index < 0) { throw new ClassFormatException("Invalid type variable signature: " + signature); } // corrected concurrent private static field acess - wrap(CONSUMER_CHARS, index + 1); // "Tblabla;" `T' and `;' are removed + wrap(CONSUMER_CHARS, index + 1); // "Tblabla;" 'T' and ';' are removed return compactClassName(signature.substring(1, index), chopit); } case 'L': { // Full class name @@ -1433,7 +1433,7 @@ public abstract class Utility { throw new ClassFormatException("Invalid signature: " + signature); } } - final int index = signature.indexOf(';', fromIndex); // Look for closing `;' + final int index = signature.indexOf(';', fromIndex); // Look for closing ';' if (index < 0) { throw new ClassFormatException("Invalid signature: " + signature); } @@ -1442,7 +1442,7 @@ public abstract class Utility { final int bracketIndex = signature.substring(0, index).indexOf('<'); if (bracketIndex < 0) { // just a class identifier - wrap(CONSUMER_CHARS, index + 1); // "Lblabla;" `L' and `;' are removed + wrap(CONSUMER_CHARS, index + 1); // "Lblabla;" 'L' and ';' are removed return compactClassName(signature.substring(1, index), chopit); } // but make sure we are not looking past the end of the current item @@ -1452,7 +1452,7 @@ public abstract class Utility { } if (fromIndex < bracketIndex) { // just a class identifier - wrap(CONSUMER_CHARS, fromIndex + 1); // "Lblabla;" `L' and `;' are removed + wrap(CONSUMER_CHARS, fromIndex + 1); // "Lblabla;" 'L' and ';' are removed return compactClassName(signature.substring(1, fromIndex), chopit); } @@ -1541,7 +1541,7 @@ public abstract class Utility { brackets.append("[]"); } consumedChars = n; // Remember value - // The rest of the string denotes a `<field_type>' + // The rest of the string denotes a '<field_type>' type = typeSignatureToString(signature.substring(n), chopit); // corrected concurrent private static field acess // Utility.consumed_chars += consumed_chars; is replaced by: @@ -1552,7 +1552,7 @@ public abstract class Utility { case 'V': return "void"; default: - throw new ClassFormatException("Invalid signature: `" + signature + "'"); + throw new ClassFormatException("Invalid signature: '" + signature + "'"); } } catch (final StringIndexOutOfBoundsException e) { // Should never occur throw new ClassFormatException("Invalid signature: " + signature, e); diff --git a/src/main/java/org/apache/bcel/classfile/Visitor.java b/src/main/java/org/apache/bcel/classfile/Visitor.java index 23c11065..b4670705 100644 --- a/src/main/java/org/apache/bcel/classfile/Visitor.java +++ b/src/main/java/org/apache/bcel/classfile/Visitor.java @@ -18,7 +18,7 @@ package org.apache.bcel.classfile; /** * Interface to make use of the Visitor pattern programming style. I.e. a class that implements this interface can - * traverse the contents of a Java class just by calling the `accept' method which all classes have. + * traverse the contents of a Java class just by calling the 'accept' method which all classes have. */ public interface Visitor { /** diff --git a/src/main/java/org/apache/bcel/generic/BasicType.java b/src/main/java/org/apache/bcel/generic/BasicType.java index a2df88cd..33060133 100644 --- a/src/main/java/org/apache/bcel/generic/BasicType.java +++ b/src/main/java/org/apache/bcel/generic/BasicType.java @@ -50,7 +50,7 @@ public final class BasicType extends Type { } /** - * Constructor for basic types such as int, long, `void' + * Constructor for basic types such as int, long, 'void' * * @param type one of T_INT, T_BOOLEAN, ..., T_VOID * @see Const diff --git a/src/main/java/org/apache/bcel/generic/BranchInstruction.java b/src/main/java/org/apache/bcel/generic/BranchInstruction.java index 59480203..f67794ea 100644 --- a/src/main/java/org/apache/bcel/generic/BranchInstruction.java +++ b/src/main/java/org/apache/bcel/generic/BranchInstruction.java @@ -140,7 +140,7 @@ public abstract class BranchInstruction extends Instruction implements Instructi /** * @param target branch target - * @return the offset to `target' relative to this instruction + * @return the offset to 'target' relative to this instruction */ protected int getTargetOffset(final InstructionHandle target) { if (target == null) { @@ -229,7 +229,7 @@ public abstract class BranchInstruction extends Instruction implements Instructi /** * Called by InstructionList.setPositions when setting the position for every instruction. In the presence of variable - * length instructions `setPositions' performs multiple passes over the instruction list to calculate the correct (byte) + * length instructions 'setPositions' performs multiple passes over the instruction list to calculate the correct (byte) * positions and offsets by calling this function. * * @param offset additional offset caused by preceding (variable length) instructions diff --git a/src/main/java/org/apache/bcel/generic/ClassGen.java b/src/main/java/org/apache/bcel/generic/ClassGen.java index bbd04f66..61b8ab33 100644 --- a/src/main/java/org/apache/bcel/generic/ClassGen.java +++ b/src/main/java/org/apache/bcel/generic/ClassGen.java @@ -189,7 +189,7 @@ public class ClassGen extends AccessFlags implements Cloneable { */ public void addEmptyConstructor(final int accessFlags) { final InstructionList il = new InstructionList(); - il.append(InstructionConst.THIS); // Push `this' + il.append(InstructionConst.THIS); // Push 'this' il.append(new INVOKESPECIAL(cp.addMethodref(superClassName, Const.CONSTRUCTOR_NAME, "()V"))); il.append(InstructionConst.RETURN); final MethodGen mg = new MethodGen(accessFlags, Type.VOID, Type.NO_ARGS, null, Const.CONSTRUCTOR_NAME, className, il, cp); diff --git a/src/main/java/org/apache/bcel/generic/CodeExceptionGen.java b/src/main/java/org/apache/bcel/generic/CodeExceptionGen.java index 72e14033..6d22a907 100644 --- a/src/main/java/org/apache/bcel/generic/CodeExceptionGen.java +++ b/src/main/java/org/apache/bcel/generic/CodeExceptionGen.java @@ -79,7 +79,7 @@ public final class CodeExceptionGen implements InstructionTargeter, Cloneable { /** * Get CodeException object.<BR> * - * This relies on that the instruction list has already been dumped to byte code or that the `setPositions' methods + * This relies on that the instruction list has already been dumped to byte code or that the 'setPositions' methods * has been called for the instruction list. * * @param cp constant pool diff --git a/src/main/java/org/apache/bcel/generic/CompoundInstruction.java b/src/main/java/org/apache/bcel/generic/CompoundInstruction.java index dfacee57..d1106e17 100644 --- a/src/main/java/org/apache/bcel/generic/CompoundInstruction.java +++ b/src/main/java/org/apache/bcel/generic/CompoundInstruction.java @@ -17,12 +17,12 @@ package org.apache.bcel.generic; /** - * Wrapper class for `compound' operations, virtual instructions that don't exist as byte code, but give a useful + * Wrapper class for 'compound' operations, virtual instructions that don't exist as byte code, but give a useful * meaning. For example, the (virtual) PUSH instruction takes an arbitray argument and produces the appropriate code at * dump time (ICONST, LDC, BIPUSH, ...). Also you can use the SWITCH instruction as a useful template for either * LOOKUPSWITCH or TABLESWITCH. * - * The interface provides the possibilty for the user to write `templates' or `macros' for such reuseable code patterns. + * The interface provides the possibilty for the user to write 'templates' or 'macros' for such reuseable code patterns. * * @see PUSH * @see SWITCH diff --git a/src/main/java/org/apache/bcel/generic/ConstantPoolGen.java b/src/main/java/org/apache/bcel/generic/ConstantPoolGen.java index fb5ed9fd..835fda3b 100644 --- a/src/main/java/org/apache/bcel/generic/ConstantPoolGen.java +++ b/src/main/java/org/apache/bcel/generic/ConstantPoolGen.java @@ -40,9 +40,9 @@ import org.apache.bcel.classfile.ConstantUtf8; import org.apache.bcel.classfile.Utility; /** - * This class is used to build up a constant pool. The user adds constants via `addXXX' methods, `addString', - * `addClass', etc.. These methods return an index into the constant pool. Finally, `getFinalConstantPool()' returns the - * constant pool built up. Intermediate versions of the constant pool can be obtained with `getConstantPool()'. A + * This class is used to build up a constant pool. The user adds constants via 'addXXX' methods, 'addString', + * 'addClass', etc.. These methods return an index into the constant pool. Finally, 'getFinalConstantPool()' returns the + * constant pool built up. Intermediate versions of the constant pool can be obtained with 'getConstantPool()'. A * constant pool has capacity for Constants.MAX_SHORT entries. Note that the first (0) is used by the JVM and that * Double and Long constants need two slots. * @@ -581,7 +581,7 @@ public class ConstantPoolGen { } /** - * Look for ConstantClass in ConstantPool named `str'. + * Look for ConstantClass in ConstantPool named 'str'. * * @param str String to search for * @return index on success, -1 otherwise @@ -720,7 +720,7 @@ public class ConstantPoolGen { } /** - * Look for ConstantString in ConstantPool containing String `str'. + * Look for ConstantString in ConstantPool containing String 'str'. * * @param str String to search for * @return index on success, -1 otherwise diff --git a/src/main/java/org/apache/bcel/generic/FieldGen.java b/src/main/java/org/apache/bcel/generic/FieldGen.java index f42f5708..f2c5e3e3 100644 --- a/src/main/java/org/apache/bcel/generic/FieldGen.java +++ b/src/main/java/org/apache/bcel/generic/FieldGen.java @@ -307,7 +307,7 @@ public class FieldGen extends FieldGenOrMethodGen { } /** - * Return string representation close to declaration format, `public static final short MAX = 100', e.g.. + * Return string representation close to declaration format, 'public static final short MAX = 100', e.g.. * * @return String representation of field */ diff --git a/src/main/java/org/apache/bcel/generic/FieldGenOrMethodGen.java b/src/main/java/org/apache/bcel/generic/FieldGenOrMethodGen.java index 5066e826..4c53e14a 100644 --- a/src/main/java/org/apache/bcel/generic/FieldGenOrMethodGen.java +++ b/src/main/java/org/apache/bcel/generic/FieldGenOrMethodGen.java @@ -74,8 +74,8 @@ public abstract class FieldGenOrMethodGen extends AccessFlags implements NamedAn } /** - * Add an attribute to this method. Currently, the JVM knows about the `Code', `ConstantValue', `Synthetic' and - * `Exceptions' attributes. Other attributes will be ignored by the JVM but do no harm. + * Add an attribute to this method. Currently, the JVM knows about the 'Code', 'ConstantValue', 'Synthetic' and + * 'Exceptions' attributes. Other attributes will be ignored by the JVM but do no harm. * * @param a attribute to be added */ diff --git a/src/main/java/org/apache/bcel/generic/Instruction.java b/src/main/java/org/apache/bcel/generic/Instruction.java index 5946157e..0fdde83d 100644 --- a/src/main/java/org/apache/bcel/generic/Instruction.java +++ b/src/main/java/org/apache/bcel/generic/Instruction.java @@ -447,8 +447,8 @@ public abstract class Instruction implements Cloneable { } /** - * Use with caution, since `BranchInstruction's have a `target' reference which is not copied correctly (only basic - * types are). This also applies for `Select' instructions with their multiple branch targets. + * Use with caution, since 'BranchInstruction's have a 'target' reference which is not copied correctly (only basic + * types are). This also applies for 'Select' instructions with their multiple branch targets. * * @see BranchInstruction * @return (shallow) copy of an instruction diff --git a/src/main/java/org/apache/bcel/generic/InstructionFactory.java b/src/main/java/org/apache/bcel/generic/InstructionFactory.java index 2a8f940c..1b707732 100644 --- a/src/main/java/org/apache/bcel/generic/InstructionFactory.java +++ b/src/main/java/org/apache/bcel/generic/InstructionFactory.java @@ -436,7 +436,7 @@ public class InstructionFactory implements InstructionConstants { } /** - * Create reference to `this' + * Create reference to 'this' */ public static Instruction createThis() { return new ALOAD(0); diff --git a/src/main/java/org/apache/bcel/generic/InstructionHandle.java b/src/main/java/org/apache/bcel/generic/InstructionHandle.java index 057043d3..d4d0339a 100644 --- a/src/main/java/org/apache/bcel/generic/InstructionHandle.java +++ b/src/main/java/org/apache/bcel/generic/InstructionHandle.java @@ -290,7 +290,7 @@ public class InstructionHandle { /** * Called by InstructionList.setPositions when setting the position for every instruction. In the presence of variable - * length instructions `setPositions()' performs multiple passes over the instruction list to calculate the correct + * length instructions 'setPositions()' performs multiple passes over the instruction list to calculate the correct * (byte) positions and offsets by calling this function. * * @param offset additional offset caused by preceding (variable length) instructions diff --git a/src/main/java/org/apache/bcel/generic/InstructionList.java b/src/main/java/org/apache/bcel/generic/InstructionList.java index 7c9bb3fb..096b18f4 100644 --- a/src/main/java/org/apache/bcel/generic/InstructionList.java +++ b/src/main/java/org/apache/bcel/generic/InstructionList.java @@ -458,8 +458,8 @@ public class InstructionList implements Iterable<InstructionHandle> { } /** - * Remove instructions from instruction `from' to instruction `to' contained in this list. The user must ensure that - * `from' is an instruction before `to', or risk havoc. The corresponding Instruction handles must not be reused! + * Remove instructions from instruction 'from' to instruction 'to' contained in this list. The user must ensure that + * 'from' is an instruction before 'to', or risk havoc. The corresponding Instruction handles must not be reused! * * @param from where to start deleting (inclusive) * @param to where to end deleting (inclusive) @@ -486,8 +486,8 @@ public class InstructionList implements Iterable<InstructionHandle> { } /** - * Remove instructions from instruction `from' to instruction `to' contained in this list. The user must ensure that - * `from' is an instruction before `to', or risk havoc. The corresponding Instruction handles must not be reused! + * Remove instructions from instruction 'from' to instruction 'to' contained in this list. The user must ensure that + * 'from' is an instruction before 'to', or risk havoc. The corresponding Instruction handles must not be reused! * * @param from where to start deleting (inclusive) * @param to where to end deleting (inclusive) @@ -993,7 +993,7 @@ public class InstructionList implements Iterable<InstructionHandle> { } /** - * Remove from instruction `prev' to instruction `next' both contained in this list. Throws TargetLostException when one + * Remove from instruction 'prev' to instruction 'next' both contained in this list. Throws TargetLostException when one * of the removed instruction handles is still being targeted. * * @param prev where to start deleting (predecessor, exclusive) diff --git a/src/main/java/org/apache/bcel/generic/LineNumberGen.java b/src/main/java/org/apache/bcel/generic/LineNumberGen.java index e3814b72..f9758cbd 100644 --- a/src/main/java/org/apache/bcel/generic/LineNumberGen.java +++ b/src/main/java/org/apache/bcel/generic/LineNumberGen.java @@ -68,7 +68,7 @@ public class LineNumberGen implements InstructionTargeter, Cloneable { /** * Get LineNumber attribute. * - * This relies on that the instruction list has already been dumped to byte code or that the `setPositions' methods + * This relies on that the instruction list has already been dumped to byte code or that the 'setPositions' methods * has been called for the instruction list. */ public LineNumber getLineNumber() { diff --git a/src/main/java/org/apache/bcel/generic/LocalVariableGen.java b/src/main/java/org/apache/bcel/generic/LocalVariableGen.java index cd4f80dd..e42b96ef 100644 --- a/src/main/java/org/apache/bcel/generic/LocalVariableGen.java +++ b/src/main/java/org/apache/bcel/generic/LocalVariableGen.java @@ -37,7 +37,7 @@ public class LocalVariableGen implements InstructionTargeter, NamedAndTyped, Clo private boolean liveToEnd; /** - * Generate a local variable that with index `index'. Note that double and long variables need two indexs. Index indices + * Generate a local variable that with index 'index'. Note that double and long variables need two indexs. Index indices * have to be provided by the user. * * @param index index of local variable @@ -60,7 +60,7 @@ public class LocalVariableGen implements InstructionTargeter, NamedAndTyped, Clo } /** - * Generates a local variable that with index `index'. Note that double and long variables need two indexs. Index + * Generates a local variable that with index 'index'. Note that double and long variables need two indexs. Index * indices have to be provided by the user. * * @param index index of local variable @@ -128,7 +128,7 @@ public class LocalVariableGen implements InstructionTargeter, NamedAndTyped, Clo /** * Gets LocalVariable object. * - * This relies on that the instruction list has already been dumped to byte code or that the `setPositions' methods + * This relies on that the instruction list has already been dumped to byte code or that the 'setPositions' methods * has been called for the instruction list. * * Note that due to the conversion from byte code offset to InstructionHandle, it is impossible to tell the difference diff --git a/src/main/java/org/apache/bcel/generic/MethodGen.java b/src/main/java/org/apache/bcel/generic/MethodGen.java index afe7dfa0..d34ff876 100644 --- a/src/main/java/org/apache/bcel/generic/MethodGen.java +++ b/src/main/java/org/apache/bcel/generic/MethodGen.java @@ -47,11 +47,11 @@ import org.apache.commons.lang3.ArrayUtils; /** * Template class for building up a method. This is done by defining exception handlers, adding thrown exceptions, local - * variables and attributes, whereas the `LocalVariableTable' and `LineNumberTable' attributes will be set automatically + * variables and attributes, whereas the 'LocalVariableTable' and 'LineNumberTable' attributes will be set automatically * for the code. Use stripAttributes() if you don't like this. * - * While generating code it may be necessary to insert NOP operations. You can use the `removeNOPs' method to get rid - * off them. The resulting method object can be obtained via the `getMethod()' method. + * While generating code it may be necessary to insert NOP operations. You can use the 'removeNOPs' method to get rid + * off them. The resulting method object can be obtained via the 'getMethod()' method. * * @see InstructionList * @see Method @@ -237,8 +237,8 @@ public class MethodGen extends FieldGenOrMethodGen { private List<MethodObserver> observers; /** - * Declare method. If the method is non-static the constructor automatically declares a local variable `$this' in slot - * 0. The actual code is contained in the `il' parameter, which may further manipulated by the user. But they must take + * Declare method. If the method is non-static the constructor automatically declares a local variable '$this' in slot + * 0. The actual code is contained in the 'il' parameter, which may further manipulated by the user. But they must take * care not to remove any instruction (handles) that are still referenced from this object. * * For example one may not add a local variable and later remove the instructions it refers to without causing havoc. It @@ -270,9 +270,9 @@ public class MethodGen extends FieldGenOrMethodGen { start = il.getStart(); // end == null => live to end of method /* - * Add local variables, namely the implicit `this' and the arguments + * Add local variables, namely the implicit 'this' and the arguments */ - if (!isStatic() && className != null) { // Instance method -> `this' is local var 0 + if (!isStatic() && className != null) { // Instance method -> 'this' is local var 0 addLocalVariable("this", ObjectType.getInstance(className), start, end); } } @@ -682,7 +682,7 @@ public class MethodGen extends FieldGenOrMethodGen { } /** - * @return code exceptions for `Code' attribute + * @return code exceptions for 'Code' attribute */ private CodeException[] getCodeExceptions() { final int size = exceptionList.size(); @@ -706,7 +706,7 @@ public class MethodGen extends FieldGenOrMethodGen { } /** - * @return `Exceptions' attribute of all the exceptions thrown by this method. + * @return 'Exceptions' attribute of all the exceptions thrown by this method. */ private ExceptionTable getExceptionTable(final ConstantPoolGen cp) { final int size = throwsList.size(); @@ -727,7 +727,7 @@ public class MethodGen extends FieldGenOrMethodGen { } /** - * @return `LineNumberTable' attribute of all the local variables of this method. + * @return 'LineNumberTable' attribute of all the local variables of this method. */ public LineNumberTable getLineNumberTable(final ConstantPoolGen cp) { final int size = lineNumberList.size(); @@ -761,7 +761,7 @@ public class MethodGen extends FieldGenOrMethodGen { } /** - * @return `LocalVariableTable' attribute of all the local variables of this method. + * @return 'LocalVariableTable' attribute of all the local variables of this method. */ public LocalVariableTable getLocalVariableTable(final ConstantPoolGen cp) { final LocalVariableGen[] lg = getLocalVariables(); @@ -772,7 +772,7 @@ public class MethodGen extends FieldGenOrMethodGen { } /** - * @return `LocalVariableTypeTable' attribute of this method. + * @return 'LocalVariableTypeTable' attribute of this method. */ public LocalVariableTypeTable getLocalVariableTypeTable() { return localVariableTypeTable; @@ -851,7 +851,7 @@ public class MethodGen extends FieldGenOrMethodGen { ExceptionTable et = null; if (!throwsList.isEmpty()) { addAttribute(et = getExceptionTable(cp)); - // Add `Exceptions' if there are "throws" clauses + // Add 'Exceptions' if there are "throws" clauses } final Method m = new Method(super.getAccessFlags(), nameIndex, signatureIndex, getAttributes(), cp.getConstantPool()); // Undo effects of adding attributes @@ -1119,7 +1119,7 @@ public class MethodGen extends FieldGenOrMethodGen { } /** - * Return string representation close to declaration format, `public static void main(String[]) throws IOException', + * Return string representation close to declaration format, 'public static void main(String[]) throws IOException', * e.g. * * @return String representation of the method. diff --git a/src/main/java/org/apache/bcel/generic/Select.java b/src/main/java/org/apache/bcel/generic/Select.java index d9f67dea..18b95c99 100644 --- a/src/main/java/org/apache/bcel/generic/Select.java +++ b/src/main/java/org/apache/bcel/generic/Select.java @@ -76,7 +76,7 @@ public abstract class Select extends BranchInstruction implements VariableLength } /** - * (Match, target) pairs for switch. `Match' and `targets' must have the same length of course. + * (Match, target) pairs for switch. 'Match' and 'targets' must have the same length of course. * * @param match array of matching values * @param targets instruction targets @@ -284,7 +284,7 @@ public abstract class Select extends BranchInstruction implements VariableLength } /** - * Set branch target for `i'th case + * Set branch target for 'i'th case */ public void setTarget(final int i, final InstructionHandle target) { // TODO could be package-protected? notifyTarget(targets[i], target, this); @@ -325,7 +325,7 @@ public abstract class Select extends BranchInstruction implements VariableLength * position. * * Called by InstructionList.setPositions when setting the position for every instruction. In the presence of variable - * length instructions `setPositions' performs multiple passes over the instruction list to calculate the correct (byte) + * length instructions 'setPositions' performs multiple passes over the instruction list to calculate the correct (byte) * positions and offsets by calling this function. * * @param offset additional offset caused by preceding (variable length) instructions diff --git a/src/main/java/org/apache/bcel/generic/Type.java b/src/main/java/org/apache/bcel/generic/Type.java index 3d0fc745..b6ded5a9 100644 --- a/src/main/java/org/apache/bcel/generic/Type.java +++ b/src/main/java/org/apache/bcel/generic/Type.java @@ -81,7 +81,7 @@ public abstract class Type { final List<Type> vec = new ArrayList<>(); int index; try { - // Skip any type arguments to read argument declarations between `(' and `)' + // Skip any type arguments to read argument declarations between '(' and ')' index = signature.indexOf('(') + 1; if (index <= 0) { throw new ClassFormatException("Invalid method signature: " + signature); @@ -103,7 +103,7 @@ public abstract class Type { int res = 0; int index; try { - // Skip any type arguments to read argument declarations between `(' and `)' + // Skip any type arguments to read argument declarations between '(' and ')' index = signature.indexOf('(') + 1; if (index <= 0) { throw new ClassFormatException("Invalid method signature: " + signature); @@ -146,7 +146,7 @@ public abstract class Type { */ public static Type getReturnType(final String signature) { try { - // Read return type after `)' + // Read return type after ')' final int index = signature.lastIndexOf(')') + 1; return getType(signature.substring(index)); } catch (final StringIndexOutOfBoundsException e) { // Should never occur @@ -233,7 +233,7 @@ public abstract class Type { if (type != Const.T_ARRAY) { // type == T_REFERENCE // Utility.typeSignatureToString understands how to parse generic types. final String parsedSignature = Utility.typeSignatureToString(signature, false); - wrap(CONSUMED_CHARS, parsedSignature.length() + 2); // "Lblabla;" `L' and `;' are removed + wrap(CONSUMED_CHARS, parsedSignature.length() + 2); // "Lblabla;" 'L' and ';' are removed return ObjectType.getInstance(Utility.pathToPackage(parsedSignature)); } int dim = 0; @@ -275,7 +275,7 @@ public abstract class Type { final int consumed = consumed(getTypeSize(signature.substring(dim))); return encode(1, dim + consumed); } - final int index = signature.indexOf(';'); // Look for closing `;' + final int index = signature.indexOf(';'); // Look for closing ';' if (index < 0) { throw new ClassFormatException("Invalid signature: " + signature); } @@ -386,7 +386,7 @@ public abstract class Type { } /** - * @return Type string, e.g. `int[]' + * @return Type string, e.g. 'int[]' */ @Override public String toString() { diff --git a/src/main/java/org/apache/bcel/util/ByteSequence.java b/src/main/java/org/apache/bcel/util/ByteSequence.java index fc48aae2..716ec1ca 100644 --- a/src/main/java/org/apache/bcel/util/ByteSequence.java +++ b/src/main/java/org/apache/bcel/util/ByteSequence.java @@ -20,7 +20,7 @@ import java.io.ByteArrayInputStream; import java.io.DataInputStream; /** - * Utility class that implements a sequence of bytes which can be read via the `readByte()' method. This is used to + * Utility class that implements a sequence of bytes which can be read via the 'readByte()' method. This is used to * implement a wrapper for the Java byte code stream to gain some more readability. */ public final class ByteSequence extends DataInputStream { diff --git a/src/main/java/org/apache/bcel/util/Class2HTML.java b/src/main/java/org/apache/bcel/util/Class2HTML.java index 65731f10..39ae9d5f 100644 --- a/src/main/java/org/apache/bcel/util/Class2HTML.java +++ b/src/main/java/org/apache/bcel/util/Class2HTML.java @@ -136,7 +136,7 @@ public class Class2HTML implements Constants { final int index = type.indexOf('['); // Type is an array? String baseType = type; if (index > -1) { - baseType = type.substring(0, index); // Tack of the `[' + baseType = type.substring(0, index); // Tack of the '[' } // test for basic type if (basicTypes.contains(baseType)) { @@ -190,7 +190,7 @@ public class Class2HTML implements Constants { this.dir = dir; className = javaClass.getClassName(); // Remember full name constantPool = javaClass.getConstantPool(); - // Get package name by tacking off everything after the last `.' + // Get package name by tacking off everything after the last '.' final int index = className.lastIndexOf('.'); if (index > -1) { classPackage = className.substring(0, index); diff --git a/src/main/java/org/apache/bcel/util/InstructionFinder.java b/src/main/java/org/apache/bcel/util/InstructionFinder.java index 8f98914d..07750cf5 100644 --- a/src/main/java/org/apache/bcel/util/InstructionFinder.java +++ b/src/main/java/org/apache/bcel/util/InstructionFinder.java @@ -290,14 +290,14 @@ public class InstructionFinder { * * @param pattern the instruction pattern to search for, case is ignored * @param constraint constraints to be checked on matching code - * @return instruction handle or `null' if the match failed + * @return instruction handle or 'null' if the match failed */ public final Iterator<InstructionHandle[]> search(final String pattern, final CodeConstraint constraint) { return search(pattern, il.getStart(), constraint); } /** - * Start search beginning from `from'. + * Start search beginning from 'from'. * * @param pattern the instruction pattern to search for, where case is ignored * @param from where to start the search in the instruction list diff --git a/src/test/java/org/apache/bcel/data/ConstantPoolX.java b/src/test/java/org/apache/bcel/data/ConstantPoolX.java index cb07fe43..ce7b6bee 100644 --- a/src/test/java/org/apache/bcel/data/ConstantPoolX.java +++ b/src/test/java/org/apache/bcel/data/ConstantPoolX.java @@ -165,7 +165,7 @@ public abstract class ConstantPoolX implements Cloneable, Node { } /** - * Retrieves constant at `index' from constant pool and resolve it to a string representation. + * Retrieves constant at 'index' from constant pool and resolve it to a string representation. * * @param index of constant in constant pool * @param tag expected type @@ -221,7 +221,7 @@ public abstract class ConstantPoolX implements Cloneable, Node { throw new ClassFormatException("Constant pool at index " + index + " is null."); } if (c.getTag() != tag) { - throw new ClassFormatException("Expected class `" + Const.getConstantName(tag) + "' at index " + index + " and got " + c); + throw new ClassFormatException("Expected class '" + Const.getConstantName(tag) + "' at index " + index + " and got " + c); } return c; } @@ -235,8 +235,8 @@ public abstract class ConstantPoolX implements Cloneable, Node { } /** - * Gets string from constant pool and bypass the indirection of `ConstantClass' and `ConstantString' objects. I.e. these - * classes have an index field that points to another entry of the constant pool of type `ConstantUtf8' which contains + * Gets string from constant pool and bypass the indirection of 'ConstantClass' and 'ConstantString' objects. I.e. these + * classes have an index field that points to another entry of the constant pool of type 'ConstantUtf8' which contains * the real data. * * @param index Index in constant pool