From: chiba Date: Thu, 30 Jun 2005 17:47:41 +0000 (+0000) Subject: deleted some local variables that are never read. X-Git-Tag: rel_3_17_1_ga~437 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b4357bab0d5bc7860470a340720b4b43707f859b;p=javassist.git deleted some local variables that are never read. git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@187 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- diff --git a/src/main/javassist/CtNewWrappedConstructor.java b/src/main/javassist/CtNewWrappedConstructor.java index b040f3d6..82fa2406 100644 --- a/src/main/javassist/CtNewWrappedConstructor.java +++ b/src/main/javassist/CtNewWrappedConstructor.java @@ -20,7 +20,7 @@ import javassist.CtMethod.ConstParameter; class CtNewWrappedConstructor extends CtNewWrappedMethod { private static final int PASS_NONE = CtNewConstructor.PASS_NONE; - private static final int PASS_ARRAY = CtNewConstructor.PASS_ARRAY; + // private static final int PASS_ARRAY = CtNewConstructor.PASS_ARRAY; private static final int PASS_PARAMS = CtNewConstructor.PASS_PARAMS; public static CtConstructor wrapped(CtClass[] parameterTypes, diff --git a/src/main/javassist/bytecode/ClassFileWriter.java b/src/main/javassist/bytecode/ClassFileWriter.java index 57e221e1..14de1189 100644 --- a/src/main/javassist/bytecode/ClassFileWriter.java +++ b/src/main/javassist/bytecode/ClassFileWriter.java @@ -60,7 +60,6 @@ public class ClassFileWriter { } out.println(); - ConstPool cp = cf.getConstPool(); list = cf.getFields(); n = list.size(); for (int i = 0; i < n; ++i) { diff --git a/src/main/javassist/compiler/CodeGen.java b/src/main/javassist/compiler/CodeGen.java index fe74e281..9b401804 100644 --- a/src/main/javassist/compiler/CodeGen.java +++ b/src/main/javassist/compiler/CodeGen.java @@ -1581,7 +1581,6 @@ public abstract class CodeGen extends Visitor implements Opcode, TokenId { public void atArrayRead(ASTree array, ASTree index) throws CompileError { - int op; arrayAccess(array, index); bytecode.addOpcode(getArrayReadOp(exprType, arrayDim)); } @@ -1607,7 +1606,6 @@ public abstract class CodeGen extends Visitor implements Opcode, TokenId { } protected static int getArrayReadOp(int type, int dim) { - int op; if (dim > 0) return AALOAD; @@ -1633,7 +1631,6 @@ public abstract class CodeGen extends Visitor implements Opcode, TokenId { } protected static int getArrayWriteOp(int type, int dim) { - int op; if (dim > 0) return AASTORE; diff --git a/src/main/javassist/compiler/CompileError.java b/src/main/javassist/compiler/CompileError.java index 476b2a94..e5bb2d73 100644 --- a/src/main/javassist/compiler/CompileError.java +++ b/src/main/javassist/compiler/CompileError.java @@ -40,6 +40,8 @@ public class CompileError extends Exception { this("cannot find " + e.getMessage()); } + public Lex getLex() { return lex; } + public String getMessage() { return reason; } diff --git a/src/main/javassist/expr/MethodCall.java b/src/main/javassist/expr/MethodCall.java index ded74e0c..26e83e79 100644 --- a/src/main/javassist/expr/MethodCall.java +++ b/src/main/javassist/expr/MethodCall.java @@ -32,7 +32,6 @@ public class MethodCall extends Expr { } private int getNameAndType(ConstPool cp) { - String cname; int pos = currentPos; int c = iterator.byteAt(pos); int index = iterator.u16bitAt(pos + 1); diff --git a/src/main/javassist/expr/NewExpr.java b/src/main/javassist/expr/NewExpr.java index be457a38..7c3a4160 100644 --- a/src/main/javassist/expr/NewExpr.java +++ b/src/main/javassist/expr/NewExpr.java @@ -38,7 +38,6 @@ public class NewExpr extends Expr { } private int getNameAndType(ConstPool cp) { - String cname; int pos = currentPos; int c = iterator.byteAt(pos); int index = iterator.u16bitAt(pos + 1); diff --git a/src/main/javassist/reflect/CannotInvokeException.java b/src/main/javassist/reflect/CannotInvokeException.java index 2a6cb9c2..c778e89d 100644 --- a/src/main/javassist/reflect/CannotInvokeException.java +++ b/src/main/javassist/reflect/CannotInvokeException.java @@ -27,10 +27,13 @@ import java.lang.IllegalAccessException; * @see javassist.reflect.ClassMetaobject#invoke(Object, int, Object[]) */ public class CannotInvokeException extends RuntimeException { + + private Throwable err = null; + /** - * @serial + * Returns the cause of this exception. It may return null. */ - private Throwable err = null; + public Throwable getReason() { return err; } /** * Constructs a CannotInvokeException with an error message. diff --git a/src/main/javassist/reflect/Reflection.java b/src/main/javassist/reflect/Reflection.java index 1d56de5b..cd4f441c 100644 --- a/src/main/javassist/reflect/Reflection.java +++ b/src/main/javassist/reflect/Reflection.java @@ -276,7 +276,6 @@ public class Reflection implements Translator { throws CannotCompileException, NotFoundException { CtMethod[] ms = clazz.getMethods(); - int identifier = 0; for (int i = 0; i < ms.length; ++i) { CtMethod m = ms[i]; int mod = m.getModifiers(); diff --git a/src/main/javassist/rmi/StubGenerator.java b/src/main/javassist/rmi/StubGenerator.java index ecf680c2..eac40916 100644 --- a/src/main/javassist/rmi/StubGenerator.java +++ b/src/main/javassist/rmi/StubGenerator.java @@ -241,7 +241,6 @@ public class StubGenerator implements Translator { if (superclazz == null) break; - String name = superclazz.getName(); try { superclazz.getDeclaredConstructor(null); break; // the constructor with no arguments is found. diff --git a/src/main/javassist/web/Webserver.java b/src/main/javassist/web/Webserver.java index 4e41faa2..b2d0b7b9 100644 --- a/src/main/javassist/web/Webserver.java +++ b/src/main/javassist/web/Webserver.java @@ -46,7 +46,6 @@ public class Webserver { private final static int typeGif = 3; private final static int typeJpeg = 4; private final static int typeText = 5; - private final static int typeUnknown = 6; /** * If this field is not null, the class files taken from