You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by eb...@apache.org on 2014/04/23 14:22:37 UTC
svn commit: r1589381 - in /commons/proper/bcel/trunk/src: examples/
examples/Mini/ main/java/org/apache/bcel/classfile/
main/java/org/apache/bcel/generic/ main/java/org/apache/bcel/util/
main/java/org/apache/bcel/verifier/statics/ site/xdoc/
Author: ebourg
Date: Wed Apr 23 12:22:36 2014
New Revision: 1589381
URL: http://svn.apache.org/r1589381
Log:
Removed more final modifiers from private methods
Modified:
commons/proper/bcel/trunk/src/examples/Mini/ASTExpr.java
commons/proper/bcel/trunk/src/examples/Mini/ASTFunDecl.java
commons/proper/bcel/trunk/src/examples/Mini/ASTProgram.java
commons/proper/bcel/trunk/src/examples/Mini/Environment.java
commons/proper/bcel/trunk/src/examples/Mini/MiniParserTokenManager.java
commons/proper/bcel/trunk/src/examples/Mini/TokenMgrError.java
commons/proper/bcel/trunk/src/examples/Peephole.java
commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ConstantPool.java
commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/JavaClass.java
commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/Signature.java
commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/Utility.java
commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/InstructionFactory.java
commons/proper/bcel/trunk/src/main/java/org/apache/bcel/util/ClassPath.java
commons/proper/bcel/trunk/src/main/java/org/apache/bcel/util/InstructionFinder.java
commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/statics/Pass2Verifier.java
commons/proper/bcel/trunk/src/site/xdoc/manual.xml
Modified: commons/proper/bcel/trunk/src/examples/Mini/ASTExpr.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/examples/Mini/ASTExpr.java?rev=1589381&r1=1589380&r2=1589381&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/examples/Mini/ASTExpr.java (original)
+++ commons/proper/bcel/trunk/src/examples/Mini/ASTExpr.java Wed Apr 23 12:22:36 2014
@@ -192,11 +192,11 @@ implements MiniParserConstants, MiniPars
return type;
}
- private static final String toBool(String i) {
+ private static String toBool(String i) {
return "(" + i + " != 0)";
}
- private static final String toInt(String i) {
+ private static String toInt(String i) {
return "((" + i + ")? 1 : 0)";
}
Modified: commons/proper/bcel/trunk/src/examples/Mini/ASTFunDecl.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/examples/Mini/ASTFunDecl.java?rev=1589381&r1=1589380&r2=1589381&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/examples/Mini/ASTFunDecl.java (original)
+++ commons/proper/bcel/trunk/src/examples/Mini/ASTFunDecl.java Wed Apr 23 12:22:36 2014
@@ -316,7 +316,7 @@ implements MiniParserTreeConstants, org.
*
* where the IF_ICMP__ now branches to the target of the previous IFEQ instruction.
*/
- private static final void optimizeIFs(InstructionList il) {
+ private static void optimizeIFs(InstructionList il) {
InstructionFinder f = new InstructionFinder(il);
String pat = "IF_ICMP ICONST_1 GOTO ICONST_0 IFEQ Instruction";
@@ -403,7 +403,7 @@ implements MiniParserTreeConstants, org.
static final void reset() { size = max_size = 0; }
- private static final String getVarDecls() {
+ private static String getVarDecls() {
StringBuffer buf = new StringBuffer(" int ");
for(int i=0; i < max_size; i++) {
Modified: commons/proper/bcel/trunk/src/examples/Mini/ASTProgram.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/examples/Mini/ASTProgram.java?rev=1589381&r1=1589380&r2=1589381&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/examples/Mini/ASTProgram.java (original)
+++ commons/proper/bcel/trunk/src/examples/Mini/ASTProgram.java Wed Apr 23 12:22:36 2014
@@ -188,11 +188,11 @@ implements MiniParserConstants, MiniPars
out.println(" private static BufferedReader _in = new BufferedReader" +
"(new InputStreamReader(System.in));\n");
- out.println(" private static final int _readInt() throws IOException {\n" +
+ out.println(" private static int _readInt() throws IOException {\n" +
" System.out.print(\"Please enter a number> \");\n" +
" return Integer.parseInt(_in.readLine());\n }\n");
- out.println(" private static final int _writeInt(int n) {\n" +
+ out.println(" private static int _writeInt(int n) {\n" +
" System.out.println(\"Result: \" + n);\n return 0;\n }\n");
for(int i=0; i < fun_decls.length; i++) {
@@ -238,7 +238,7 @@ implements MiniParserConstants, MiniPars
"(Ljava/lang/String;)I")));
il.append(InstructionConstants.IRETURN);
- /* private static final int _readInt() throws IOException
+ /* private static int _readInt() throws IOException
*/
method = new MethodGen(ACC_STATIC | ACC_PRIVATE | ACC_FINAL,
Type.INT, Type.NO_ARGS, null,
@@ -249,7 +249,7 @@ implements MiniParserConstants, MiniPars
method.setMaxStack(2);
class_gen.addMethod(method.getMethod());
- /* private static final int _writeInt(int i) throws IOException
+ /* private static int _writeInt(int i) throws IOException
*/
Type[] args = { Type.INT };
String[] argv = { "i" } ;
Modified: commons/proper/bcel/trunk/src/examples/Mini/Environment.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/examples/Mini/Environment.java?rev=1589381&r1=1589380&r2=1589381&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/examples/Mini/Environment.java (original)
+++ commons/proper/bcel/trunk/src/examples/Mini/Environment.java Wed Apr 23 12:22:36 2014
@@ -138,7 +138,7 @@ public class Environment implements Clon
} catch(ArrayIndexOutOfBoundsException e) {}
}
- private static final int lookup(Vector<EnvEntry> v, String key)
+ private static int lookup(Vector<EnvEntry> v, String key)
throws ArrayIndexOutOfBoundsException
{
int len = v.size();
Modified: commons/proper/bcel/trunk/src/examples/Mini/MiniParserTokenManager.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/examples/Mini/MiniParserTokenManager.java?rev=1589381&r1=1589380&r2=1589381&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/examples/Mini/MiniParserTokenManager.java (original)
+++ commons/proper/bcel/trunk/src/examples/Mini/MiniParserTokenManager.java Wed Apr 23 12:22:36 2014
@@ -132,7 +132,7 @@ static private int jjMoveNfa_1(int start
catch(java.io.IOException e) { return curPos; }
}
}
-private static final int jjStopStringLiteralDfa_0(int pos, long active0)
+private static int jjStopStringLiteralDfa_0(int pos, long active0)
{
switch (pos)
{
@@ -180,7 +180,7 @@ private static final int jjStopStringLit
return -1;
}
}
-private static final int jjStartNfa_0(int pos, long active0)
+private static int jjStartNfa_0(int pos, long active0)
{
return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
}
Modified: commons/proper/bcel/trunk/src/examples/Mini/TokenMgrError.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/examples/Mini/TokenMgrError.java?rev=1589381&r1=1589380&r2=1589381&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/examples/Mini/TokenMgrError.java (original)
+++ commons/proper/bcel/trunk/src/examples/Mini/TokenMgrError.java Wed Apr 23 12:22:36 2014
@@ -111,7 +111,7 @@ public class TokenMgrError extends Error
* curchar : the offending character
* Note: You can customize the lexical error message by modifying this method.
*/
- private static final String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
+ private static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
return("Lexical error at line " +
errorLine + ", column " +
errorColumn + ". Encountered: " +
Modified: commons/proper/bcel/trunk/src/examples/Peephole.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/examples/Peephole.java?rev=1589381&r1=1589380&r2=1589381&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/examples/Peephole.java (original)
+++ commons/proper/bcel/trunk/src/examples/Peephole.java Wed Apr 23 12:22:36 2014
@@ -61,7 +61,7 @@ public class Peephole {
} catch(Exception e) { e.printStackTrace(); }
}
- private static final Method removeNOPs(MethodGen mg) {
+ private static Method removeNOPs(MethodGen mg) {
InstructionList il = mg.getInstructionList();
InstructionFinder f = new InstructionFinder(il);
String pat = "NOP+"; // Find at least one NOP
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ConstantPool.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ConstantPool.java?rev=1589381&r1=1589380&r2=1589381&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ConstantPool.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ConstantPool.java Wed Apr 23 12:22:36 2014
@@ -150,7 +150,7 @@ public class ConstantPool implements Clo
}
- private static final String escape( String str ) {
+ private static String escape( String str ) {
int len = str.length();
StringBuilder buf = new StringBuilder(len + 5);
char[] ch = str.toCharArray();
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/JavaClass.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/JavaClass.java?rev=1589381&r1=1589380&r2=1589381&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/JavaClass.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/JavaClass.java Wed Apr 23 12:22:36 2014
@@ -670,7 +670,7 @@ public class JavaClass extends AccessFla
}
- private static final String indent( Object obj ) {
+ private static String indent( Object obj ) {
StringTokenizer tok = new StringTokenizer(obj.toString(), "\n");
StringBuilder buf = new StringBuilder();
while (tok.hasMoreTokens()) {
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/Signature.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/Signature.java?rev=1589381&r1=1589380&r2=1589381&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/Signature.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/Signature.java Wed Apr 23 12:22:36 2014
@@ -153,7 +153,7 @@ public final class Signature extends Att
}
- private static final void matchIdent( MyByteArrayInputStream in, StringBuffer buf ) {
+ private static void matchIdent( MyByteArrayInputStream in, StringBuffer buf ) {
int ch;
if ((ch = in.read()) == -1) {
throw new RuntimeException("Illegal signature: " + in.getData()
@@ -196,7 +196,7 @@ public final class Signature extends Att
}
- private static final void matchGJIdent( MyByteArrayInputStream in, StringBuffer buf ) {
+ private static void matchGJIdent( MyByteArrayInputStream in, StringBuffer buf ) {
int ch;
matchIdent(in, buf);
ch = in.read();
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/Utility.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/Utility.java?rev=1589381&r1=1589380&r2=1589381&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/Utility.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/Utility.java Wed Apr 23 12:22:36 2014
@@ -724,7 +724,7 @@ public abstract class Utility {
// Guess what this does
- private static final int pow2( int n ) {
+ private static int pow2( int n ) {
return 1 << n;
}
@@ -1036,7 +1036,7 @@ public abstract class Utility {
* Convert (signed) byte to (unsigned) short value, i.e., all negative
* values become positive.
*/
- private static final short byteToShort( byte b ) {
+ private static short byteToShort( byte b ) {
return (b < 0) ? (short) (256 + b) : (short) b;
}
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/InstructionFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/InstructionFactory.java?rev=1589381&r1=1589380&r2=1589381&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/InstructionFactory.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/InstructionFactory.java Wed Apr 23 12:22:36 2014
@@ -192,7 +192,7 @@ public class InstructionFactory implemen
};
- private static final boolean isString( Type type ) {
+ private static boolean isString( Type type ) {
return ((type instanceof ObjectType) && ((ObjectType) type).getClassName().equals(
"java.lang.String"));
}
@@ -283,7 +283,7 @@ public class InstructionFactory implemen
}
- private static final ArithmeticInstruction createBinaryIntOp( char first, String op ) {
+ private static ArithmeticInstruction createBinaryIntOp( char first, String op ) {
switch (first) {
case '-':
return ISUB;
@@ -313,7 +313,7 @@ public class InstructionFactory implemen
}
- private static final ArithmeticInstruction createBinaryLongOp( char first, String op ) {
+ private static ArithmeticInstruction createBinaryLongOp( char first, String op ) {
switch (first) {
case '-':
return LSUB;
@@ -343,7 +343,7 @@ public class InstructionFactory implemen
}
- private static final ArithmeticInstruction createBinaryFloatOp( char op ) {
+ private static ArithmeticInstruction createBinaryFloatOp( char op ) {
switch (op) {
case '-':
return FSUB;
@@ -361,7 +361,7 @@ public class InstructionFactory implemen
}
- private static final ArithmeticInstruction createBinaryDoubleOp( char op ) {
+ private static ArithmeticInstruction createBinaryDoubleOp( char op ) {
switch (op) {
case '-':
return DSUB;
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/bcel/util/ClassPath.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/bcel/util/ClassPath.java?rev=1589381&r1=1589380&r2=1589381&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/bcel/util/ClassPath.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/bcel/util/ClassPath.java Wed Apr 23 12:22:36 2014
@@ -136,7 +136,7 @@ public class ClassPath implements Serial
}
- private static final void getPathComponents( String path, List<String> list ) {
+ private static void getPathComponents( String path, List<String> list ) {
if (path != null) {
StringTokenizer tok = new StringTokenizer(path, File.pathSeparator);
while (tok.hasMoreTokens()) {
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/bcel/util/InstructionFinder.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/bcel/util/InstructionFinder.java?rev=1589381&r1=1589380&r2=1589381&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/bcel/util/InstructionFinder.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/bcel/util/InstructionFinder.java Wed Apr 23 12:22:36 2014
@@ -115,7 +115,7 @@ public class InstructionFinder {
* instruction pattern in lower case
* @return encoded string for a pattern such as "BranchInstruction".
*/
- private static final String mapName( String pattern ) {
+ private static String mapName( String pattern ) {
String result = map.get(pattern);
if (result != null) {
return result;
@@ -138,7 +138,7 @@ public class InstructionFinder {
* The pattern to compile
* @return translated regular expression string
*/
- private static final String compilePattern( String pattern ) {
+ private static String compilePattern( String pattern ) {
//Bug: 38787 - Instructions are assumed to be english, to avoid odd Locale issues
String lower = pattern.toLowerCase(Locale.ENGLISH);
StringBuilder buf = new StringBuilder();
@@ -286,7 +286,7 @@ public class InstructionFinder {
/**
* Convert opcode number to char.
*/
- private static final char makeChar( short opcode ) {
+ private static char makeChar( short opcode ) {
return (char) (opcode + OFFSET);
}
Modified: commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/statics/Pass2Verifier.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/statics/Pass2Verifier.java?rev=1589381&r1=1589380&r2=1589381&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/statics/Pass2Verifier.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/statics/Pass2Verifier.java Wed Apr 23 12:22:36 2014
@@ -1316,7 +1316,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 final boolean validClassName(String name){
+ private static boolean validClassName(String name){
/*
* TODO: implement.
* Are there any restrictions?
Modified: commons/proper/bcel/trunk/src/site/xdoc/manual.xml
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/site/xdoc/manual.xml?rev=1589381&r1=1589380&r2=1589381&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/site/xdoc/manual.xml (original)
+++ commons/proper/bcel/trunk/src/site/xdoc/manual.xml Wed Apr 23 12:22:36 2014
@@ -1607,7 +1607,7 @@ public class Peephole {
} catch(Exception e) { e.printStackTrace(); }
}
- private static final Method removeNOPs(MethodGen mg) {
+ private static Method removeNOPs(MethodGen mg) {
InstructionList il = mg.getInstructionList();
InstructionFinder f = new InstructionFinder(il);
String pat = "NOP+"; // Find at least one NOP