Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/exc/VerifierConstraintViolatedException.java URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/exc/VerifierConstraintViolatedException.java?rev=1746378&r1=1746377&r2=1746378&view=diff ============================================================================== --- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/exc/VerifierConstraintViolatedException.java (original) +++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/exc/VerifierConstraintViolatedException.java Wed Jun 1 04:25:27 2016 @@ -44,14 +44,14 @@ public abstract class VerifierConstraint /** * Constructs a new VerifierConstraintViolatedException with the specified error message. */ - VerifierConstraintViolatedException(String message){ + VerifierConstraintViolatedException(final String message){ super(message); // Not that important detailMessage = message; } /** * Constructs a new VerifierConstraintViolationException with the specified error message and cause */ - VerifierConstraintViolatedException(String message, Throwable initCause){ + VerifierConstraintViolatedException(final String message, final Throwable initCause){ super(message, initCause); detailMessage = message; }
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/statics/IntList.java URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/statics/IntList.java?rev=1746378&r1=1746377&r2=1746378&view=diff ============================================================================== --- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/statics/IntList.java (original) +++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/statics/IntList.java Wed Jun 1 04:25:27 2016 @@ -34,11 +34,11 @@ public class IntList{ theList = new ArrayList<>(); } /** Adds an element to the list. */ - void add(int i){ + void add(final int i){ theList.add(Integer.valueOf(i)); } /** Checks if the specified int is already in the list. */ - boolean contains(int i){ + boolean contains(final int i){ Integer[] ints = new Integer[theList.size()]; theList.toArray(ints); for (Integer k : ints) { Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/statics/LocalVariableInfo.java URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/statics/LocalVariableInfo.java?rev=1746378&r1=1746377&r2=1746378&view=diff ============================================================================== --- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/statics/LocalVariableInfo.java (original) +++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/statics/LocalVariableInfo.java Wed Jun 1 04:25:27 2016 @@ -42,14 +42,14 @@ public class LocalVariableInfo{ * Adds a name of a local variable and a certain slot to our 'names' * (Hashtable) database. */ - private void setName(int offset, String name){ + private void setName(final int offset, final String name){ names.put(Integer.toString(offset), name); } /** * Adds a type of a local variable and a certain slot to our 'types' * (Hashtable) database. */ - private void setType(int offset, Type t){ + private void setType(final int offset, final Type t){ types.put(Integer.toString(offset), t); } @@ -61,7 +61,7 @@ public class LocalVariableInfo{ * May return 'null' if nothing is known about the type of this local * variable slot at the given bytecode offset. */ - public Type getType(int offset){ + public Type getType(final int offset){ return types.get(Integer.toString(offset)); } /** @@ -72,7 +72,7 @@ public class LocalVariableInfo{ * May return 'null' if nothing is known about the type of this local * variable slot at the given bytecode offset. */ - public String getName(int offset){ + public String getName(final int offset){ return names.get(Integer.toString(offset)); } /** @@ -80,7 +80,7 @@ public class LocalVariableInfo{ * @throws LocalVariableInfoInconsistentException if the new information conflicts * with already gathered information. */ - public void add(String name, int startpc, int length, Type t) throws LocalVariableInfoInconsistentException{ + public void add(final String name, final int startpc, final int length, final Type t) throws LocalVariableInfoInconsistentException{ for (int i=startpc; i<=startpc+length; i++){ // incl/incl-notation! add(i,name,t); } @@ -91,7 +91,7 @@ public class LocalVariableInfo{ * @throws LocalVariableInfoInconsistentException if the new information conflicts * with already gathered information. */ - private void add(int offset, String name, Type t) throws LocalVariableInfoInconsistentException{ + private void add(final int offset, final String name, final Type t) throws LocalVariableInfoInconsistentException{ if (getName(offset) != null){ if (! getName(offset).equals(name)){ throw new LocalVariableInfoInconsistentException("At bytecode offset '"+offset+ Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/statics/LocalVariablesInfo.java URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/statics/LocalVariablesInfo.java?rev=1746378&r1=1746377&r2=1746378&view=diff ============================================================================== --- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/statics/LocalVariablesInfo.java (original) +++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/statics/LocalVariablesInfo.java Wed Jun 1 04:25:27 2016 @@ -35,7 +35,7 @@ public class LocalVariablesInfo{ private final LocalVariableInfo[] localVariableInfos; /** The constructor. */ - LocalVariablesInfo(int max_locals){ + LocalVariablesInfo(final int max_locals){ localVariableInfos = new LocalVariableInfo[max_locals]; for (int i=0; i<max_locals; i++){ localVariableInfos[i] = new LocalVariableInfo(); @@ -43,7 +43,7 @@ public class LocalVariablesInfo{ } /** Returns the LocalVariableInfo for the given slot. */ - public LocalVariableInfo getLocalVariableInfo(int slot){ + public LocalVariableInfo getLocalVariableInfo(final int slot){ if (slot < 0 || slot >= localVariableInfos.length){ throw new AssertionViolatedException("Slot number for local variable information out of range."); } @@ -56,7 +56,7 @@ public class LocalVariablesInfo{ * @throws LocalVariableInfoInconsistentException if the new information conflicts * with already gathered information. */ - public void add(int slot, String name, int startpc, int length, Type t) throws LocalVariableInfoInconsistentException{ + public void add(final int slot, final String name, final int startpc, final int length, final Type t) throws LocalVariableInfoInconsistentException{ // The add operation on LocalVariableInfo may throw the '...Inconsistent...' exception, we don't throw it explicitely here. if (slot < 0 || slot >= localVariableInfos.length){ Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/statics/Pass1Verifier.java URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/statics/Pass1Verifier.java?rev=1746378&r1=1746377&r2=1746378&view=diff ============================================================================== --- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/statics/Pass1Verifier.java (original) +++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/statics/Pass1Verifier.java Wed Jun 1 04:25:27 2016 @@ -71,7 +71,7 @@ public final class Pass1Verifier extends * * @see Verifier */ - public Pass1Verifier(Verifier owner){ + public Pass1Verifier(final Verifier owner){ myOwner = owner; } Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/statics/Pass2Verifier.java URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/statics/Pass2Verifier.java?rev=1746378&r1=1746377&r2=1746378&view=diff ============================================================================== --- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/statics/Pass2Verifier.java (original) +++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/statics/Pass2Verifier.java Wed Jun 1 04:25:27 2016 @@ -101,7 +101,7 @@ public final class Pass2Verifier extends * * @see Verifier */ - public Pass2Verifier(Verifier owner){ + public Pass2Verifier(final Verifier owner){ myOwner = owner; } @@ -114,7 +114,7 @@ public final class Pass2Verifier extends * <B>Repository.lookupClass(myOwner.getClassname()).getMethods()[method_nr];</B>. * You should not add own information. Leave that to JustIce. */ - public LocalVariablesInfo getLocalVariablesInfo(int method_nr){ + public LocalVariablesInfo getLocalVariablesInfo(final int method_nr){ if (this.verify() != VerificationResult.VR_OK) { return null; // It's cached, don't worry. } @@ -338,7 +338,7 @@ public final class Pass2Verifier extends private final Set<String> field_names_and_desc = new HashSet<>(); private final Set<String> method_names_and_desc = new HashSet<>(); - private CPESSC_Visitor(JavaClass _jc){ + private CPESSC_Visitor(final JavaClass _jc){ jc = _jc; cp = _jc.getConstantPool(); cplen = cp.getLength(); @@ -361,7 +361,7 @@ public final class Pass2Verifier extends carrier.visit(); } - private void checkIndex(Node referrer, int index, Class<?> shouldbe){ + private void checkIndex(final Node referrer, final int index, final Class<?> shouldbe){ if ((index < 0) || (index >= cplen)){ throw new ClassConstraintException("Invalid index '"+index+"' used by '"+tostring(referrer)+"'."); } @@ -376,7 +376,7 @@ public final class Pass2Verifier extends // ClassFile structure (vmspec2 4.1) // /////////////////////////////////////// @Override - public void visitJavaClass(JavaClass obj){ + public void visitJavaClass(final JavaClass obj){ Attribute[] atts = obj.getAttributes(); boolean foundSourceFile = false; boolean foundInnerClasses = false; @@ -437,7 +437,7 @@ public final class Pass2Verifier extends // CONSTANTS (vmspec2 4.4) // ///////////////////////////// @Override - public void visitConstantClass(ConstantClass obj){ + public void visitConstantClass(final ConstantClass obj){ if (obj.getTag() != Const.CONSTANT_Class){ throw new ClassConstraintException("Wrong constant tag in '"+tostring(obj)+"'."); } @@ -445,7 +445,7 @@ public final class Pass2Verifier extends } @Override - public void visitConstantFieldref(ConstantFieldref obj){ + public void visitConstantFieldref(final ConstantFieldref obj){ if (obj.getTag() != Const.CONSTANT_Fieldref){ throw new ClassConstraintException("Wrong constant tag in '"+tostring(obj)+"'."); } @@ -453,7 +453,7 @@ public final class Pass2Verifier extends checkIndex(obj, obj.getNameAndTypeIndex(), CONST_NameAndType); } @Override - public void visitConstantMethodref(ConstantMethodref obj){ + public void visitConstantMethodref(final ConstantMethodref obj){ if (obj.getTag() != Const.CONSTANT_Methodref){ throw new ClassConstraintException("Wrong constant tag in '"+tostring(obj)+"'."); } @@ -461,7 +461,7 @@ public final class Pass2Verifier extends checkIndex(obj, obj.getNameAndTypeIndex(), CONST_NameAndType); } @Override - public void visitConstantInterfaceMethodref(ConstantInterfaceMethodref obj){ + public void visitConstantInterfaceMethodref(final ConstantInterfaceMethodref obj){ if (obj.getTag() != Const.CONSTANT_InterfaceMethodref){ throw new ClassConstraintException("Wrong constant tag in '"+tostring(obj)+"'."); } @@ -469,42 +469,42 @@ public final class Pass2Verifier extends checkIndex(obj, obj.getNameAndTypeIndex(), CONST_NameAndType); } @Override - public void visitConstantString(ConstantString obj){ + public void visitConstantString(final ConstantString obj){ if (obj.getTag() != Const.CONSTANT_String){ throw new ClassConstraintException("Wrong constant tag in '"+tostring(obj)+"'."); } checkIndex(obj, obj.getStringIndex(), CONST_Utf8); } @Override - public void visitConstantInteger(ConstantInteger obj){ + public void visitConstantInteger(final ConstantInteger obj){ if (obj.getTag() != Const.CONSTANT_Integer){ throw new ClassConstraintException("Wrong constant tag in '"+tostring(obj)+"'."); } // no indices to check } @Override - public void visitConstantFloat(ConstantFloat obj){ + public void visitConstantFloat(final ConstantFloat obj){ if (obj.getTag() != Const.CONSTANT_Float){ throw new ClassConstraintException("Wrong constant tag in '"+tostring(obj)+"'."); } //no indices to check } @Override - public void visitConstantLong(ConstantLong obj){ + public void visitConstantLong(final ConstantLong obj){ if (obj.getTag() != Const.CONSTANT_Long){ throw new ClassConstraintException("Wrong constant tag in '"+tostring(obj)+"'."); } //no indices to check } @Override - public void visitConstantDouble(ConstantDouble obj){ + public void visitConstantDouble(final ConstantDouble obj){ if (obj.getTag() != Const.CONSTANT_Double){ throw new ClassConstraintException("Wrong constant tag in '"+tostring(obj)+"'."); } //no indices to check } @Override - public void visitConstantNameAndType(ConstantNameAndType obj){ + public void visitConstantNameAndType(final ConstantNameAndType obj){ if (obj.getTag() != Const.CONSTANT_NameAndType){ throw new ClassConstraintException("Wrong constant tag in '"+tostring(obj)+"'."); } @@ -513,7 +513,7 @@ public final class Pass2Verifier extends checkIndex(obj, obj.getSignatureIndex(), CONST_Utf8); } @Override - public void visitConstantUtf8(ConstantUtf8 obj){ + public void visitConstantUtf8(final ConstantUtf8 obj){ if (obj.getTag() != Const.CONSTANT_Utf8){ throw new ClassConstraintException("Wrong constant tag in '"+tostring(obj)+"'."); } @@ -523,7 +523,7 @@ public final class Pass2Verifier extends // FIELDS (vmspec2 4.5) // ////////////////////////// @Override - public void visitField(Field obj){ + public void visitField(final Field obj){ if (jc.isClass()){ int maxone=0; @@ -617,7 +617,7 @@ public final class Pass2Verifier extends // METHODS (vmspec2 4.6) // /////////////////////////// @Override - public void visitMethod(Method obj){ + public void visitMethod(final Method obj){ checkIndex(obj, obj.getNameIndex(), CONST_Utf8); @@ -822,7 +822,7 @@ public final class Pass2Verifier extends // ClassFile-structure-ATTRIBUTES (vmspec2 4.1, 4.7) // /////////////////////////////////////////////////////// @Override - public void visitSourceFile(SourceFile obj){//vmspec2 4.7.7 + public void visitSourceFile(final SourceFile obj){//vmspec2 4.7.7 // zero or one SourceFile attr per ClassFile: see visitJavaClass() @@ -849,7 +849,7 @@ public final class Pass2Verifier extends } } @Override - public void visitDeprecated(Deprecated obj){//vmspec2 4.7.10 + public void visitDeprecated(final Deprecated obj){//vmspec2 4.7.10 checkIndex(obj, obj.getNameIndex(), CONST_Utf8); String name = ((ConstantUtf8) cp.getConstant(obj.getNameIndex())).getBytes(); @@ -859,7 +859,7 @@ public final class Pass2Verifier extends } } @Override - public void visitSynthetic(Synthetic obj){//vmspec2 4.7.6 + public void visitSynthetic(final Synthetic obj){//vmspec2 4.7.6 checkIndex(obj, obj.getNameIndex(), CONST_Utf8); String name = ((ConstantUtf8) cp.getConstant(obj.getNameIndex())).getBytes(); if (! name.equals("Synthetic")){ @@ -868,7 +868,7 @@ public final class Pass2Verifier extends } } @Override - public void visitInnerClasses(InnerClasses obj){//vmspec2 4.7.5 + public void visitInnerClasses(final InnerClasses obj){//vmspec2 4.7.5 // exactly one InnerClasses attr per ClassFile if some inner class is refernced: see visitJavaClass() @@ -907,7 +907,7 @@ public final class Pass2Verifier extends // field_info-structure-ATTRIBUTES (vmspec2 4.5, 4.7) // //////////////////////////////////////////////////////// @Override - public void visitConstantValue(ConstantValue obj){//vmspec2 4.7.2 + public void visitConstantValue(final ConstantValue obj){//vmspec2 4.7.2 // Despite its name, this really is an Attribute, // not a constant! checkIndex(obj, obj.getNameIndex(), CONST_Utf8); @@ -957,7 +957,7 @@ public final class Pass2Verifier extends // method_info-structure-ATTRIBUTES (vmspec2 4.6, 4.7) // ///////////////////////////////////////////////////////// @Override - public void visitCode(Code obj){//vmspec2 4.7.3 + public void visitCode(final Code obj){//vmspec2 4.7.3 try { // No code attribute allowed for native or abstract methods: see visitMethod(Method). // Code array constraints are checked in Pass3 (3a and 3b). @@ -1138,7 +1138,7 @@ public final class Pass2Verifier extends }// visitCode(Code) END @Override - public void visitExceptionTable(ExceptionTable obj){//vmspec2 4.7.4 + public void visitExceptionTable(final ExceptionTable obj){//vmspec2 4.7.4 try { // incorrectly named, it's the Exceptions attribute (vmspec2 4.7.4) checkIndex(obj, obj.getNameIndex(), CONST_Utf8); @@ -1202,7 +1202,7 @@ public final class Pass2Verifier extends // code_attribute-structure-ATTRIBUTES (vmspec2 4.7.3, 4.7) // ////////////////////////////////////////////////////////////// @Override - public void visitLineNumberTable(LineNumberTable obj){//vmspec2 4.7.8 + public void visitLineNumberTable(final LineNumberTable obj){//vmspec2 4.7.8 checkIndex(obj, obj.getNameIndex(), CONST_Utf8); String name = ((ConstantUtf8) cp.getConstant(obj.getNameIndex())).getBytes(); @@ -1217,7 +1217,7 @@ public final class Pass2Verifier extends } @Override - public void visitLocalVariableTable(LocalVariableTable obj){//vmspec2 4.7.9 + public void visitLocalVariableTable(final LocalVariableTable obj){//vmspec2 4.7.9 //In JustIce,this check is partially delayed to Pass 3a. //The other part can be found in the visitCode(Code) method. } @@ -1225,7 +1225,7 @@ public final class Pass2Verifier extends // MISC-structure-ATTRIBUTES (vmspec2 4.7.1, 4.7) // //////////////////////////////////////////////////// @Override - public void visitUnknown(Unknown obj){//vmspec2 4.7.1 + public void visitUnknown(final Unknown obj){//vmspec2 4.7.1 // Represents an unknown attribute. checkIndex(obj, obj.getNameIndex(), CONST_Utf8); @@ -1236,14 +1236,14 @@ public final class Pass2Verifier extends // BCEL // ////////// @Override - public void visitLocalVariable(LocalVariable obj){ + public void visitLocalVariable(final LocalVariable obj){ // This does not represent an Attribute but is only // related to internal BCEL data representation. // see visitLocalVariableTable(LocalVariableTable) } @Override - public void visitCodeException(CodeException obj){ + public void visitCodeException(final CodeException obj){ // Code constraints are checked in Pass3 (3a and 3b). // This does not represent an Attribute but is only // related to internal BCEL data representation. @@ -1251,18 +1251,18 @@ public final class Pass2Verifier extends // see visitCode(Code) } @Override - public void visitConstantPool(ConstantPool obj){ + public void visitConstantPool(final ConstantPool obj){ // No need to. We're piggybacked by the DescendingVisitor. // This does not represent an Attribute but is only // related to internal BCEL data representation. } @Override - public void visitInnerClass(InnerClass obj){ + public void visitInnerClass(final InnerClass obj){ // This does not represent an Attribute but is only // related to internal BCEL data representation. } @Override - public void visitLineNumber(LineNumber obj){ + public void visitLineNumber(final LineNumber obj){ // This does not represent an Attribute but is only // related to internal BCEL data representation. @@ -1307,12 +1307,12 @@ public final class Pass2Verifier extends */ private final class FAMRAV_Visitor extends EmptyVisitor{ private final ConstantPool cp; // ==jc.getConstantPool() -- only here to save typing work. - private FAMRAV_Visitor(JavaClass _jc){ + private FAMRAV_Visitor(final JavaClass _jc){ cp = _jc.getConstantPool(); } @Override - public void visitConstantFieldref(ConstantFieldref obj){ + public void visitConstantFieldref(final ConstantFieldref obj){ if (obj.getTag() != Const.CONSTANT_Fieldref){ throw new ClassConstraintException("ConstantFieldref '"+tostring(obj)+"' has wrong tag!"); } @@ -1341,7 +1341,7 @@ public final class Pass2Verifier extends } @Override - public void visitConstantMethodref(ConstantMethodref obj){ + public void visitConstantMethodref(final ConstantMethodref obj){ if (obj.getTag() != Const.CONSTANT_Methodref){ throw new ClassConstraintException("ConstantMethodref '"+tostring(obj)+"' has wrong tag!"); } @@ -1374,7 +1374,7 @@ public final class Pass2Verifier extends } @Override - public void visitConstantInterfaceMethodref(ConstantInterfaceMethodref obj){ + public void visitConstantInterfaceMethodref(final ConstantInterfaceMethodref obj){ if (obj.getTag() != Const.CONSTANT_InterfaceMethodref){ throw new ClassConstraintException("ConstantInterfaceMethodref '"+tostring(obj)+"' has wrong tag!"); } @@ -1414,7 +1414,7 @@ public final class Pass2Verifier extends * This method returns true if and only if the supplied String * represents a valid Java class name. */ - private static boolean validClassName(String name){ + private static boolean validClassName(final String name){ /* * TODO: implement. * Are there any restrictions? @@ -1429,7 +1429,7 @@ public final class Pass2Verifier extends * the instance initialization method is allowed and the special name * for the class/interface initialization method may be allowed. */ - private static boolean validMethodName(String name, boolean allowStaticInit){ + private static boolean validMethodName(final String name, final boolean allowStaticInit){ if (validJavaLangMethodName(name)) { return true; } @@ -1445,7 +1445,7 @@ public final class Pass2Verifier extends * represents a valid method name that may be referenced by * ConstantMethodref objects. */ - private static boolean validClassMethodName(String name){ + private static boolean validClassMethodName(final String name){ return validMethodName(name, false); } @@ -1455,7 +1455,7 @@ public final class Pass2Verifier extends * (non-qualified) name. * Conforming to: The Java Virtual Machine Specification, Second Edition, �2.7, �2.7.1, �2.2. */ - private static boolean validJavaLangMethodName(String name){ + private static boolean validJavaLangMethodName(final String name){ if (!Character.isJavaIdentifierStart(name.charAt(0))) { return false; } @@ -1473,7 +1473,7 @@ public final class Pass2Verifier extends * represents a valid Java interface method name that may be * referenced by ConstantInterfaceMethodref objects. */ - private static boolean validInterfaceMethodName(String name){ + private static boolean validInterfaceMethodName(final String name){ // I guess we should assume special names forbidden here. if (name.startsWith("<")) { return false; @@ -1485,7 +1485,7 @@ public final class Pass2Verifier extends * This method returns true if and only if the supplied String * represents a valid Java identifier (so-called simple name). */ - private static boolean validJavaIdentifier(String name){ + private static boolean validJavaIdentifier(final String name){ if (name.length() == 0) { return false; // must not be empty, reported by <[email protected]>, thanks! } @@ -1507,7 +1507,7 @@ public final class Pass2Verifier extends * This method returns true if and only if the supplied String * represents a valid Java field name. */ - private static boolean validFieldName(String name){ + private static boolean validFieldName(final String name){ // vmspec2 2.7, vmspec2 2.2 return validJavaIdentifier(name); } @@ -1537,7 +1537,7 @@ public final class Pass2Verifier extends private final ConstantPool cp; /** Constructs an InnerClassDetector working on the JavaClass _jc. */ - public InnerClassDetector(JavaClass _jc){ + public InnerClassDetector(final JavaClass _jc){ jc = _jc; cp = jc.getConstantPool(); (new DescendingVisitor(jc, this)).visit(); @@ -1551,7 +1551,7 @@ public final class Pass2Verifier extends } /** This method casually visits ConstantClass references. */ @Override - public void visitConstantClass(ConstantClass obj){ + public void visitConstantClass(final ConstantClass obj){ Constant c = cp.getConstant(obj.getNameIndex()); if (c instanceof ConstantUtf8){ //Ignore the case where it's not a ConstantUtf8 here, we'll find out later. String classname = ((ConstantUtf8) c).getBytes(); @@ -1565,7 +1565,7 @@ public final class Pass2Verifier extends /** * This method is here to save typing work and improve code readability. */ - private static String tostring(Node n){ + private static String tostring(final Node n){ return new StringRepresentation(n).toString(); } } Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/statics/Pass3aVerifier.java URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/statics/Pass3aVerifier.java?rev=1746378&r1=1746377&r2=1746378&view=diff ============================================================================== --- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/statics/Pass3aVerifier.java (original) +++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/statics/Pass3aVerifier.java Wed Jun 1 04:25:27 2016 @@ -134,7 +134,7 @@ public final class Pass3aVerifier extend private Code code; /** Should only be instantiated by a Verifier. */ - public Pass3aVerifier(Verifier owner, int method_no){ + public Pass3aVerifier(final Verifier owner, final int method_no){ myOwner = owner; this.method_no = method_no; } @@ -452,7 +452,7 @@ public final class Pass3aVerifier extend } /** A small utility method returning if a given int i is in the given int[] ints. */ - private static boolean contains(int[] ints, int i){ + private static boolean contains(final int[] ints, final int i){ for (int k : ints) { if (k==i) { return true; @@ -475,7 +475,7 @@ public final class Pass3aVerifier extend private final ConstantPoolGen cpg; /** The only Constructor. */ - InstOperandConstraintVisitor(ConstantPoolGen cpg){ + InstOperandConstraintVisitor(final ConstantPoolGen cpg){ this.cpg = cpg; } @@ -495,7 +495,7 @@ public final class Pass3aVerifier extend /** * A utility method to always raise an exeption. */ - private void constraintViolated(Instruction i, String message) { + private void constraintViolated(final Instruction i, final String message) { throw new StaticCodeInstructionOperandConstraintException("Instruction "+i+" constraint violated: "+message); } @@ -503,7 +503,7 @@ public final class Pass3aVerifier extend * A utility method to raise an exception if the index is not * a valid constant pool index. */ - private void indexValid(Instruction i, int idx){ + private void indexValid(final Instruction i, final int idx){ if (idx < 0 || idx >= cpg.getSize()){ constraintViolated(i, "Illegal constant pool index '"+idx+"'."); } @@ -517,7 +517,7 @@ public final class Pass3aVerifier extend * The referenced class is loaded and pass2-verified. */ @Override - public void visitLoadClass(LoadClass o){ + public void visitLoadClass(final LoadClass o){ ObjectType t = o.getLoadClassType(cpg); if (t != null){// null means "no class is loaded" Verifier v = VerifierFactory.getVerifier(t.getClassName()); @@ -539,7 +539,7 @@ public final class Pass3aVerifier extend /** Checks if the constraints of operands of the said instruction(s) are satisfied. */ // LDC and LDC_W (LDC_W is a subclass of LDC in BCEL's model) @Override - public void visitLDC(LDC o){ + public void visitLDC(final LDC o){ indexValid(o, o.getIndex()); Constant c = cpg.getConstant(o.getIndex()); if (c instanceof ConstantClass){ @@ -558,7 +558,7 @@ public final class Pass3aVerifier extend /** Checks if the constraints of operands of the said instruction(s) are satisfied. */ // LDC2_W @Override - public void visitLDC2_W(LDC2_W o){ + public void visitLDC2_W(final LDC2_W o){ indexValid(o, o.getIndex()); Constant c = cpg.getConstant(o.getIndex()); if (! ( (c instanceof ConstantLong) || @@ -573,7 +573,7 @@ public final class Pass3aVerifier extend } } - private ObjectType getObjectType(FieldInstruction o) { + private ObjectType getObjectType(final FieldInstruction o) { ReferenceType rt = o.getReferenceType(cpg); if(rt instanceof ObjectType) { return (ObjectType)rt; @@ -585,7 +585,7 @@ public final class Pass3aVerifier extend /** Checks if the constraints of operands of the said instruction(s) are satisfied. */ //getfield, putfield, getstatic, putstatic @Override - public void visitFieldInstruction(FieldInstruction o){ + public void visitFieldInstruction(final FieldInstruction o){ try { indexValid(o, o.getIndex()); Constant c = cpg.getConstant(o.getIndex()); @@ -659,7 +659,7 @@ public final class Pass3aVerifier extend /** Checks if the constraints of operands of the said instruction(s) are satisfied. */ @Override - public void visitInvokeInstruction(InvokeInstruction o){ + public void visitInvokeInstruction(final InvokeInstruction o){ indexValid(o, o.getIndex()); if ( (o instanceof INVOKEVIRTUAL) || (o instanceof INVOKESPECIAL) || @@ -738,7 +738,7 @@ public final class Pass3aVerifier extend /** Checks if the constraints of operands of the said instruction(s) are satisfied. */ @Override - public void visitINSTANCEOF(INSTANCEOF o){ + public void visitINSTANCEOF(final INSTANCEOF o){ indexValid(o, o.getIndex()); Constant c = cpg.getConstant(o.getIndex()); if (! (c instanceof ConstantClass)){ @@ -748,7 +748,7 @@ public final class Pass3aVerifier extend /** Checks if the constraints of operands of the said instruction(s) are satisfied. */ @Override - public void visitCHECKCAST(CHECKCAST o){ + public void visitCHECKCAST(final CHECKCAST o){ indexValid(o, o.getIndex()); Constant c = cpg.getConstant(o.getIndex()); if (! (c instanceof ConstantClass)){ @@ -758,7 +758,7 @@ public final class Pass3aVerifier extend /** Checks if the constraints of operands of the said instruction(s) are satisfied. */ @Override - public void visitNEW(NEW o){ + public void visitNEW(final NEW o){ indexValid(o, o.getIndex()); Constant c = cpg.getConstant(o.getIndex()); if (! (c instanceof ConstantClass)){ @@ -776,7 +776,7 @@ public final class Pass3aVerifier extend /** Checks if the constraints of operands of the said instruction(s) are satisfied. */ @Override - public void visitMULTIANEWARRAY(MULTIANEWARRAY o){ + public void visitMULTIANEWARRAY(final MULTIANEWARRAY o){ indexValid(o, o.getIndex()); Constant c = cpg.getConstant(o.getIndex()); if (! (c instanceof ConstantClass)){ @@ -803,7 +803,7 @@ public final class Pass3aVerifier extend /** Checks if the constraints of operands of the said instruction(s) are satisfied. */ @Override - public void visitANEWARRAY(ANEWARRAY o){ + public void visitANEWARRAY(final ANEWARRAY o){ indexValid(o, o.getIndex()); Constant c = cpg.getConstant(o.getIndex()); if (! (c instanceof ConstantClass)){ @@ -822,7 +822,7 @@ public final class Pass3aVerifier extend /** Checks if the constraints of operands of the said instruction(s) are satisfied. */ @Override - public void visitNEWARRAY(NEWARRAY o){ + public void visitNEWARRAY(final NEWARRAY o){ byte t = o.getTypecode(); if (! ( (t == Const.T_BOOLEAN) || (t == Const.T_CHAR) || @@ -838,7 +838,7 @@ public final class Pass3aVerifier extend /** Checks if the constraints of operands of the said instruction(s) are satisfied. */ @Override - public void visitILOAD(ILOAD o){ + public void visitILOAD(final ILOAD o){ int idx = o.getIndex(); if (idx < 0){ constraintViolated(o, "Index '"+idx+"' must be non-negative."); @@ -853,7 +853,7 @@ public final class Pass3aVerifier extend /** Checks if the constraints of operands of the said instruction(s) are satisfied. */ @Override - public void visitFLOAD(FLOAD o){ + public void visitFLOAD(final FLOAD o){ int idx = o.getIndex(); if (idx < 0){ constraintViolated(o, "Index '"+idx+"' must be non-negative."); @@ -868,7 +868,7 @@ public final class Pass3aVerifier extend /** Checks if the constraints of operands of the said instruction(s) are satisfied. */ @Override - public void visitALOAD(ALOAD o){ + public void visitALOAD(final ALOAD o){ int idx = o.getIndex(); if (idx < 0){ constraintViolated(o, "Index '"+idx+"' must be non-negative."); @@ -883,7 +883,7 @@ public final class Pass3aVerifier extend /** Checks if the constraints of operands of the said instruction(s) are satisfied. */ @Override - public void visitISTORE(ISTORE o){ + public void visitISTORE(final ISTORE o){ int idx = o.getIndex(); if (idx < 0){ constraintViolated(o, "Index '"+idx+"' must be non-negative."); @@ -898,7 +898,7 @@ public final class Pass3aVerifier extend /** Checks if the constraints of operands of the said instruction(s) are satisfied. */ @Override - public void visitFSTORE(FSTORE o){ + public void visitFSTORE(final FSTORE o){ int idx = o.getIndex(); if (idx < 0){ constraintViolated(o, "Index '"+idx+"' must be non-negative."); @@ -913,7 +913,7 @@ public final class Pass3aVerifier extend /** Checks if the constraints of operands of the said instruction(s) are satisfied. */ @Override - public void visitASTORE(ASTORE o){ + public void visitASTORE(final ASTORE o){ int idx = o.getIndex(); if (idx < 0){ constraintViolated(o, "Index '"+idx+"' must be non-negative."); @@ -928,7 +928,7 @@ public final class Pass3aVerifier extend /** Checks if the constraints of operands of the said instruction(s) are satisfied. */ @Override - public void visitIINC(IINC o){ + public void visitIINC(final IINC o){ int idx = o.getIndex(); if (idx < 0){ constraintViolated(o, "Index '"+idx+"' must be non-negative."); @@ -943,7 +943,7 @@ public final class Pass3aVerifier extend /** Checks if the constraints of operands of the said instruction(s) are satisfied. */ @Override - public void visitRET(RET o){ + public void visitRET(final RET o){ int idx = o.getIndex(); if (idx < 0){ constraintViolated(o, "Index '"+idx+"' must be non-negative."); @@ -958,7 +958,7 @@ public final class Pass3aVerifier extend /** Checks if the constraints of operands of the said instruction(s) are satisfied. */ @Override - public void visitLLOAD(LLOAD o){ + public void visitLLOAD(final LLOAD o){ int idx = o.getIndex(); if (idx < 0){ constraintViolated(o, "Index '"+idx+"' must be non-negative."+ @@ -974,7 +974,7 @@ public final class Pass3aVerifier extend /** Checks if the constraints of operands of the said instruction(s) are satisfied. */ @Override - public void visitDLOAD(DLOAD o){ + public void visitDLOAD(final DLOAD o){ int idx = o.getIndex(); if (idx < 0){ constraintViolated(o, "Index '"+idx+"' must be non-negative."+ @@ -990,7 +990,7 @@ public final class Pass3aVerifier extend /** Checks if the constraints of operands of the said instruction(s) are satisfied. */ @Override - public void visitLSTORE(LSTORE o){ + public void visitLSTORE(final LSTORE o){ int idx = o.getIndex(); if (idx < 0){ constraintViolated(o, "Index '"+idx+"' must be non-negative."+ @@ -1006,7 +1006,7 @@ public final class Pass3aVerifier extend /** Checks if the constraints of operands of the said instruction(s) are satisfied. */ @Override - public void visitDSTORE(DSTORE o){ + public void visitDSTORE(final DSTORE o){ int idx = o.getIndex(); if (idx < 0){ constraintViolated(o, "Index '"+idx+"' must be non-negative."+ @@ -1022,7 +1022,7 @@ public final class Pass3aVerifier extend /** Checks if the constraints of operands of the said instruction(s) are satisfied. */ @Override - public void visitLOOKUPSWITCH(LOOKUPSWITCH o){ + public void visitLOOKUPSWITCH(final LOOKUPSWITCH o){ int[] matchs = o.getMatchs(); int max = Integer.MIN_VALUE; for (int i=0; i<matchs.length; i++){ @@ -1040,14 +1040,14 @@ public final class Pass3aVerifier extend /** Checks if the constraints of operands of the said instruction(s) are satisfied. */ @Override - public void visitTABLESWITCH(TABLESWITCH o){ + public void visitTABLESWITCH(final TABLESWITCH o){ // "high" must be >= "low". We cannot check this, as BCEL hides // it from us. } /** Checks if the constraints of operands of the said instruction(s) are satisfied. */ @Override - public void visitPUTSTATIC(PUTSTATIC o){ + public void visitPUTSTATIC(final PUTSTATIC o){ try { String field_name = o.getFieldName(cpg); JavaClass jc = Repository.lookupClass(getObjectType(o).getClassName()); @@ -1089,7 +1089,7 @@ public final class Pass3aVerifier extend /** Checks if the constraints of operands of the said instruction(s) are satisfied. */ @Override - public void visitGETSTATIC(GETSTATIC o){ + public void visitGETSTATIC(final GETSTATIC o){ try { String field_name = o.getFieldName(cpg); JavaClass jc = Repository.lookupClass(getObjectType(o).getClassName()); @@ -1126,13 +1126,13 @@ public final class Pass3aVerifier extend /** Checks if the constraints of operands of the said instruction(s) are satisfied. */ @Override - public void visitINVOKEDYNAMIC(INVOKEDYNAMIC o){ + public void visitINVOKEDYNAMIC(final INVOKEDYNAMIC o){ throw new RuntimeException("INVOKEDYNAMIC instruction is not supported at this time"); } /** Checks if the constraints of operands of the said instruction(s) are satisfied. */ @Override - public void visitINVOKEINTERFACE(INVOKEINTERFACE o){ + public void visitINVOKEINTERFACE(final INVOKEINTERFACE o){ try { // INVOKEINTERFACE is a LoadClass; the Class where the referenced method is declared in, // is therefore resolved/verified. @@ -1161,7 +1161,7 @@ public final class Pass3aVerifier extend * @param invoke the instruction that references the method * @return the referenced method or null if not found. */ - private Method getMethodRecursive(JavaClass jc, InvokeInstruction invoke) throws ClassNotFoundException{ + private Method getMethodRecursive(final JavaClass jc, final InvokeInstruction invoke) throws ClassNotFoundException{ Method m; //look in the given class m = getMethod(jc, invoke); @@ -1194,7 +1194,7 @@ public final class Pass3aVerifier extend * @param invoke the instruction that references the method * @return the referenced method or null if not found. */ - private Method getMethod(JavaClass jc, InvokeInstruction invoke){ + private Method getMethod(final JavaClass jc, final InvokeInstruction invoke){ Method[] ms = jc.getMethods(); for (Method element : ms) { if ( (element.getName().equals(invoke.getMethodName(cpg))) && @@ -1209,7 +1209,7 @@ public final class Pass3aVerifier extend /** Checks if the constraints of operands of the said instruction(s) are satisfied. */ @Override - public void visitINVOKESPECIAL(INVOKESPECIAL o){ + public void visitINVOKESPECIAL(final INVOKESPECIAL o){ try { // INVOKESPECIAL is a LoadClass; the Class where the referenced method is declared in, // is therefore resolved/verified. @@ -1268,7 +1268,7 @@ public final class Pass3aVerifier extend /** Checks if the constraints of operands of the said instruction(s) are satisfied. */ @Override - public void visitINVOKESTATIC(INVOKESTATIC o){ + public void visitINVOKESTATIC(final INVOKESTATIC o){ try { // INVOKESTATIC is a LoadClass; the Class where the referenced method is declared in, // is therefore resolved/verified. @@ -1293,7 +1293,7 @@ public final class Pass3aVerifier extend /** Checks if the constraints of operands of the said instruction(s) are satisfied. */ @Override - public void visitINVOKEVIRTUAL(INVOKEVIRTUAL o){ + public void visitINVOKEVIRTUAL(final INVOKEVIRTUAL o){ try { // INVOKEVIRTUAL is a LoadClass; the Class where the referenced method is declared in, // is therefore resolved/verified. @@ -1324,7 +1324,7 @@ public final class Pass3aVerifier extend * The equality of the elements is based on their equals(Object) * method instead of their object identity. */ - private boolean objarrayequals(Object[] o, Object[] p){ + private boolean objarrayequals(final Object[] o, final Object[] p){ if (o.length != p.length){ return false; } Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/statics/StringRepresentation.java URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/statics/StringRepresentation.java?rev=1746378&r1=1746377&r2=1746378&view=diff ============================================================================== --- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/statics/StringRepresentation.java (original) +++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/statics/StringRepresentation.java Wed Jun 1 04:25:27 2016 @@ -90,7 +90,7 @@ public class StringRepresentation extend * * @see #toString() */ - public StringRepresentation(Node n) { + public StringRepresentation(final Node n) { this.n = n; n.accept(this); // assign a string representation to field 'tostring' if we know n's class. } @@ -117,7 +117,7 @@ public class StringRepresentation extend * this is obj.toString() if it does not throw any RuntimeException, * or else it is a string derived only from obj's class name. */ - private String toString(Node obj) { + private String toString(final Node obj) { String ret; try { ret = obj.toString(); @@ -140,7 +140,7 @@ public class StringRepresentation extend // e.g. we could also simply output "Code" instead of a possibly // lengthy Code attribute's toString(). @Override - public void visitCode(Code obj) { + public void visitCode(final Code obj) { //tostring = toString(obj); tostring = "<CODE>"; // We don't need real code outputs. } @@ -149,7 +149,7 @@ public class StringRepresentation extend * @since 6.0 */ @Override - public void visitAnnotation(Annotations obj) + public void visitAnnotation(final Annotations obj) { //this is invoked whenever an annotation is found //when verifier is passed over a class @@ -160,7 +160,7 @@ public class StringRepresentation extend * @since 6.0 */ @Override - public void visitLocalVariableTypeTable(LocalVariableTypeTable obj) + public void visitLocalVariableTypeTable(final LocalVariableTypeTable obj) { //this is invoked whenever a local variable type is found //when verifier is passed over a class @@ -168,152 +168,152 @@ public class StringRepresentation extend } @Override - public void visitCodeException(CodeException obj) { + public void visitCodeException(final CodeException obj) { tostring = toString(obj); } @Override - public void visitConstantClass(ConstantClass obj) { + public void visitConstantClass(final ConstantClass obj) { tostring = toString(obj); } @Override - public void visitConstantDouble(ConstantDouble obj) { + public void visitConstantDouble(final ConstantDouble obj) { tostring = toString(obj); } @Override - public void visitConstantFieldref(ConstantFieldref obj) { + public void visitConstantFieldref(final ConstantFieldref obj) { tostring = toString(obj); } @Override - public void visitConstantFloat(ConstantFloat obj) { + public void visitConstantFloat(final ConstantFloat obj) { tostring = toString(obj); } @Override - public void visitConstantInteger(ConstantInteger obj) { + public void visitConstantInteger(final ConstantInteger obj) { tostring = toString(obj); } @Override - public void visitConstantInterfaceMethodref(ConstantInterfaceMethodref obj) { + public void visitConstantInterfaceMethodref(final ConstantInterfaceMethodref obj) { tostring = toString(obj); } @Override - public void visitConstantLong(ConstantLong obj) { + public void visitConstantLong(final ConstantLong obj) { tostring = toString(obj); } @Override - public void visitConstantMethodref(ConstantMethodref obj) { + public void visitConstantMethodref(final ConstantMethodref obj) { tostring = toString(obj); } @Override - public void visitConstantNameAndType(ConstantNameAndType obj) { + public void visitConstantNameAndType(final ConstantNameAndType obj) { tostring = toString(obj); } @Override - public void visitConstantPool(ConstantPool obj) { + public void visitConstantPool(final ConstantPool obj) { tostring = toString(obj); } @Override - public void visitConstantString(ConstantString obj) { + public void visitConstantString(final ConstantString obj) { tostring = toString(obj); } @Override - public void visitConstantUtf8(ConstantUtf8 obj) { + public void visitConstantUtf8(final ConstantUtf8 obj) { tostring = toString(obj); } @Override - public void visitConstantValue(ConstantValue obj) { + public void visitConstantValue(final ConstantValue obj) { tostring = toString(obj); } @Override - public void visitDeprecated(Deprecated obj) { + public void visitDeprecated(final Deprecated obj) { tostring = toString(obj); } @Override - public void visitExceptionTable(ExceptionTable obj) { + public void visitExceptionTable(final ExceptionTable obj) { tostring = toString(obj); } @Override - public void visitField(Field obj) { + public void visitField(final Field obj) { tostring = toString(obj); } @Override - public void visitInnerClass(InnerClass obj) { + public void visitInnerClass(final InnerClass obj) { tostring = toString(obj); } @Override - public void visitInnerClasses(InnerClasses obj) { + public void visitInnerClasses(final InnerClasses obj) { tostring = toString(obj); } @Override - public void visitJavaClass(JavaClass obj) { + public void visitJavaClass(final JavaClass obj) { tostring = toString(obj); } @Override - public void visitLineNumber(LineNumber obj) { + public void visitLineNumber(final LineNumber obj) { tostring = toString(obj); } @Override - public void visitLineNumberTable(LineNumberTable obj) { + public void visitLineNumberTable(final LineNumberTable obj) { tostring = "<LineNumberTable: " + toString(obj) + ">"; } @Override - public void visitLocalVariable(LocalVariable obj) { + public void visitLocalVariable(final LocalVariable obj) { tostring = toString(obj); } @Override - public void visitLocalVariableTable(LocalVariableTable obj) { + public void visitLocalVariableTable(final LocalVariableTable obj) { tostring = "<LocalVariableTable: " + toString(obj) + ">"; } @Override - public void visitMethod(Method obj) { + public void visitMethod(final Method obj) { tostring = toString(obj); } @Override - public void visitSignature(Signature obj) { + public void visitSignature(final Signature obj) { tostring = toString(obj); } @Override - public void visitSourceFile(SourceFile obj) { + public void visitSourceFile(final SourceFile obj) { tostring = toString(obj); } @Override - public void visitStackMap(StackMap obj) { + public void visitStackMap(final StackMap obj) { tostring = toString(obj); } @Override - public void visitSynthetic(Synthetic obj) { + public void visitSynthetic(final Synthetic obj) { tostring = toString(obj); } @Override - public void visitUnknown(Unknown obj) { + public void visitUnknown(final Unknown obj) { tostring = toString(obj); } @@ -321,7 +321,7 @@ public class StringRepresentation extend * @since 6.0 */ @Override - public void visitEnclosingMethod(EnclosingMethod obj) { + public void visitEnclosingMethod(final EnclosingMethod obj) { tostring = toString(obj); } @@ -329,7 +329,7 @@ public class StringRepresentation extend * @since 6.0 */ @Override - public void visitBootstrapMethods(BootstrapMethods obj) { + public void visitBootstrapMethods(final BootstrapMethods obj) { tostring = toString(obj); } @@ -337,7 +337,7 @@ public class StringRepresentation extend * @since 6.0 */ @Override - public void visitMethodParameters(MethodParameters obj) { + public void visitMethodParameters(final MethodParameters obj) { tostring = toString(obj); } @@ -345,7 +345,7 @@ public class StringRepresentation extend * @since 6.0 */ @Override - public void visitConstantInvokeDynamic(ConstantInvokeDynamic obj) { + public void visitConstantInvokeDynamic(final ConstantInvokeDynamic obj) { tostring = toString(obj); } @@ -353,7 +353,7 @@ public class StringRepresentation extend * @since 6.0 */ @Override - public void visitStackMapEntry(StackMapEntry obj) { + public void visitStackMapEntry(final StackMapEntry obj) { tostring = toString(obj); } /** @@ -361,7 +361,7 @@ public class StringRepresentation extend */ @Override - public void visitParameterAnnotation(ParameterAnnotations obj) { + public void visitParameterAnnotation(final ParameterAnnotations obj) { tostring = toString(obj); } @@ -369,7 +369,7 @@ public class StringRepresentation extend * @since 6.0 */ @Override - public void visitAnnotationEntry(AnnotationEntry obj) { + public void visitAnnotationEntry(final AnnotationEntry obj) { tostring = toString(obj); } @@ -377,7 +377,7 @@ public class StringRepresentation extend * @since 6.0 */ @Override - public void visitAnnotationDefault(AnnotationDefault obj) { + public void visitAnnotationDefault(final AnnotationDefault obj) { tostring = toString(obj); } @@ -385,7 +385,7 @@ public class StringRepresentation extend * @since 6.0 */ @Override - public void visitConstantMethodType(ConstantMethodType obj) { + public void visitConstantMethodType(final ConstantMethodType obj) { tostring = toString(obj); } @@ -393,7 +393,7 @@ public class StringRepresentation extend * @since 6.0 */ @Override - public void visitConstantMethodHandle(ConstantMethodHandle obj) { + public void visitConstantMethodHandle(final ConstantMethodHandle obj) { tostring = toString(obj); } @@ -401,7 +401,7 @@ public class StringRepresentation extend * @since 6.0 */ @Override - public void visitParameterAnnotationEntry(ParameterAnnotationEntry obj) { + public void visitParameterAnnotationEntry(final ParameterAnnotationEntry obj) { tostring = toString(obj); } } Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/ControlFlowGraph.java URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/ControlFlowGraph.java?rev=1746378&r1=1746377&r2=1746378&view=diff ============================================================================== --- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/ControlFlowGraph.java (original) +++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/ControlFlowGraph.java Wed Jun 1 04:25:27 2016 @@ -83,7 +83,7 @@ public class ControlFlowGraph{ * Creates an InstructionHandleImpl object from an InstructionHandle. * Creation of one per InstructionHandle suffices. Don't create more. */ - public InstructionContextImpl(InstructionHandle inst){ + public InstructionContextImpl(final InstructionHandle inst){ if (inst == null) { throw new AssertionViolatedException("Cannot instantiate InstructionContextImpl from NULL."); } @@ -101,7 +101,7 @@ public class ControlFlowGraph{ /* Satisfies InstructionContext.setTag(int). */ @Override - public void setTag(int tag){ // part of InstructionContext interface + public void setTag(final int tag){ // part of InstructionContext interface TAG = tag; } @@ -117,7 +117,7 @@ public class ControlFlowGraph{ * Returns a clone of the "outgoing" frame situation with respect to the given ExecutionChain. */ @Override - public Frame getOutFrame(ArrayList<InstructionContext> execChain){ + public Frame getOutFrame(final ArrayList<InstructionContext> execChain){ executionPredecessors = execChain; Frame org; @@ -163,7 +163,7 @@ public class ControlFlowGraph{ * changed from the one before execute()ing. */ @Override - public boolean execute(Frame inFrame, ArrayList<InstructionContext> execPreds, InstConstraintVisitor icv, ExecutionVisitor ev){ + public boolean execute(final Frame inFrame, final ArrayList<InstructionContext> execPreds, final InstConstraintVisitor icv, final ExecutionVisitor ev){ @SuppressWarnings("unchecked") // OK because execPreds is compatible type final List<InstructionContext> clone = (List<InstructionContext>) execPreds.clone(); @@ -238,7 +238,7 @@ public class ControlFlowGraph{ * Does the actual merging (vmspec2, page 146). * Returns true IFF this.inFrame was changed in course of merging with inFrame. */ - private boolean mergeInFrames(Frame inFrame) { + private boolean mergeInFrames(final Frame inFrame) { // TODO: Can be performance-improved. Frame inF = inFrames.get(lastExecutionJSR()); OperandStack oldstack = inF.getStack().getClone(); @@ -272,7 +272,7 @@ public class ControlFlowGraph{ * This extended message will then reflect the execution flow needed to get to the constraint * violation that triggered the throwing of the "e" object. */ - private void extendMessageWithFlow(StructuralCodeConstraintException e){ + private void extendMessageWithFlow(final StructuralCodeConstraintException e){ String s = "Execution flow:\n"; e.extendMessage("", s+getExecutionChain()); } @@ -412,7 +412,7 @@ public class ControlFlowGraph{ * A Control Flow Graph; with additional JustIce checks * @param method_gen the method generator instance */ - public ControlFlowGraph(MethodGen method_gen){ + public ControlFlowGraph(final MethodGen method_gen){ this(method_gen, true); } @@ -422,7 +422,7 @@ public class ControlFlowGraph{ * @param enableJustIceCheck if true, additional JustIce checks are performed * @since 6.0 */ - public ControlFlowGraph(MethodGen method_gen, boolean enableJustIceCheck){ + public ControlFlowGraph(final MethodGen method_gen, final boolean enableJustIceCheck){ subroutines = new Subroutines(method_gen, enableJustIceCheck); exceptionhandlers = new ExceptionHandlers(method_gen); @@ -437,7 +437,7 @@ public class ControlFlowGraph{ /** * Returns the InstructionContext of a given instruction. */ - public InstructionContext contextOf(InstructionHandle inst){ + public InstructionContext contextOf(final InstructionHandle inst){ InstructionContext ic = instructionContexts.get(inst); if (ic == null){ throw new AssertionViolatedException("InstructionContext requested for an InstructionHandle that's not known!"); @@ -449,7 +449,7 @@ public class ControlFlowGraph{ * Returns the InstructionContext[] of a given InstructionHandle[], * in a naturally ordered manner. */ - public InstructionContext[] contextsOf(InstructionHandle[] insts){ + public InstructionContext[] contextsOf(final InstructionHandle[] insts){ InstructionContext[] ret = new InstructionContext[insts.length]; for (int i=0; i<insts.length; i++){ ret[i] = contextOf(insts[i]); @@ -471,7 +471,7 @@ public class ControlFlowGraph{ * Returns true, if and only if the said instruction is not reachable; that means, * if it is not part of this ControlFlowGraph. */ - public boolean isDead(InstructionHandle i){ + public boolean isDead(final InstructionHandle i){ return subroutines.subroutineOf(i) == null; } } Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/ExceptionHandler.java URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/ExceptionHandler.java?rev=1746378&r1=1746377&r2=1746378&view=diff ============================================================================== --- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/ExceptionHandler.java (original) +++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/ExceptionHandler.java Wed Jun 1 04:25:27 2016 @@ -36,7 +36,7 @@ public class ExceptionHandler{ private final InstructionHandle handlerpc; /** Leave instance creation to JustIce. */ - ExceptionHandler(ObjectType catch_type, InstructionHandle handler_pc){ + ExceptionHandler(final ObjectType catch_type, final InstructionHandle handler_pc){ catchtype = catch_type; handlerpc = handler_pc; } Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/ExceptionHandlers.java URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/ExceptionHandlers.java?rev=1746378&r1=1746377&r2=1746378&view=diff ============================================================================== --- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/ExceptionHandlers.java (original) +++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/structurals/ExceptionHandlers.java Wed Jun 1 04:25:27 2016 @@ -42,7 +42,7 @@ public class ExceptionHandlers{ /** * Constructor. Creates a new ExceptionHandlers instance. */ - public ExceptionHandlers(MethodGen mg){ + public ExceptionHandlers(final MethodGen mg){ exceptionhandlers = new HashMap<>(); CodeExceptionGen[] cegs = mg.getExceptionHandlers(); for (CodeExceptionGen ceg : cegs) { @@ -63,7 +63,7 @@ public class ExceptionHandlers{ * Returns all the ExceptionHandler instances representing exception * handlers that protect the instruction ih. */ - public ExceptionHandler[] getExceptionHandlers(InstructionHandle ih){ + public ExceptionHandler[] getExceptionHandlers(final InstructionHandle ih){ Set<ExceptionHandler> hsSet = exceptionhandlers.get(ih); if (hsSet == null) { return new ExceptionHandler[0];
