getConstantType/Int/String removed. getConstant is sufficient

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@444 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 7c38ff13aa
commit c352536458
  1. 37
      jode/jode/bytecode/ConstantPool.java

@ -128,22 +128,6 @@ public class ConstantPool {
}; };
} }
public Type getConstantType(int i) throws ClassFormatException
{
if (i == 0)
throw new ClassFormatException("null constant");
switch(tags[i]) {
case INTEGER: return Type.tInt;
case FLOAT : return Type.tFloat ;
case LONG : return Type.tLong ;
case DOUBLE : return Type.tDouble;
case STRING : return Type.tString;
default:
throw new ClassFormatException
("invalid constant tag: " + tags[i]);
}
}
public Object getConstant(int i) throws ClassFormatException { public Object getConstant(int i) throws ClassFormatException {
if (i == 0) if (i == 0)
throw new ClassFormatException("null constant"); throw new ClassFormatException("null constant");
@ -159,27 +143,6 @@ public class ConstantPool {
throw new ClassFormatException("unknown constant tag: "+tags[i]); throw new ClassFormatException("unknown constant tag: "+tags[i]);
} }
public int getConstantInt(int i) throws ClassFormatException {
if (i == 0 || tags[i] != ConstantPool.INTEGER)
throw new ClassFormatException("not an integer "+tags[i]);
return ((Integer)constants[i]).intValue();
}
public String getConstantString(int i) throws ClassFormatException {
if (i == 0)
throw new ClassFormatException("null constant");
switch (tags[i]) {
case ConstantPool.INTEGER:
case ConstantPool.FLOAT:
case ConstantPool.LONG:
case ConstantPool.DOUBLE:
return constants[i].toString();
case ConstantPool.STRING:
return getUTF8(indices1[i]);
}
throw new ClassFormatException("unknown constant tag: "+tags[i]);
}
public String getClassName(int i) throws ClassFormatException { public String getClassName(int i) throws ClassFormatException {
if (i == 0) if (i == 0)
return null; return null;

Loading…
Cancel
Save