getTypeSignature

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@240 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 3c3736cf93
commit fbdef36ed8
  1. 4
      jode/jode/type/ArrayType.java
  2. 9
      jode/jode/type/ClassInterfacesType.java
  3. 4
      jode/jode/type/MethodType.java
  4. 7
      jode/jode/type/RangeType.java
  5. 26
      jode/jode/type/Type.java

@ -112,6 +112,10 @@ public class ArrayType extends Type {
elementType.useType(); elementType.useType();
} }
public String getTypeSignature() {
return "["+elementType.getTypeSignature();
}
public String toString() { public String toString() {
return elementType.toString()+"[]"; return elementType.toString()+"[]";
} }

@ -385,6 +385,15 @@ public class ClassInterfacesType extends Type {
} }
} }
public String getTypeSignature() {
if (clazz != null)
return "L" + clazz.getName().replace('.','/') + ";";
else if (ifaces.length > 0)
return "L" + ifaces[0].getName().replace('.','/') + ";";
else
return "Ljava/lang/Object;";
}
public String toString() public String toString()
{ {
if (jode.Decompiler.isTypeDebugging) { if (jode.Decompiler.isTypeDebugging) {

@ -70,6 +70,10 @@ public class MethodType {
return returnType; return returnType;
} }
public String getTypeSignature() {
return signature;
}
public String toString() { public String toString() {
return signature; return signature;
} }

@ -88,6 +88,13 @@ public class RangeType extends Type {
bottomType.useType(); bottomType.useType();
} }
public String getTypeSignature() {
if (topType.isClassType() || bottomType == tUnknown)
return topType.getTypeSignature();
else
return bottomType.getTypeSignature();
}
public String toString() public String toString()
{ {
if (jode.Decompiler.isTypeDebugging) if (jode.Decompiler.isTypeDebugging)

@ -110,6 +110,7 @@ public class Type {
public static final Type tUObject = tRange(tObject, tUnknown); public static final Type tUObject = tRange(tObject, tUnknown);
public static final Type tString = tClass("java.lang.String"); public static final Type tString = tClass("java.lang.String");
public static final Type tStringBuffer = tClass("java.lang.StringBuffer"); public static final Type tStringBuffer = tClass("java.lang.StringBuffer");
public static final Type tJavaLangClass = tClass("java.lang.Class");
public static final Type tType(String type) { public static final Type tType(String type) {
if (type == null || type.length() == 0) if (type == null || type.length() == 0)
@ -465,6 +466,31 @@ public class Type {
} }
} }
public String getTypeSignature() {
switch (typecode) {
case TC_BOOLINT:
case TC_BOOLBYTE:
case TC_BOOLEAN:
return "Z";
case TC_BYTE:
return "B";
case TC_CHAR:
return "C";
case TC_SHORT:
return "S";
case TC_INT:
return "I";
case TC_LONG:
return "J";
case TC_FLOAT:
return "F";
case TC_DOUBLE:
return "D";
default:
return "?";
}
}
public String toString() { public String toString() {
switch (typecode) { switch (typecode) {
case TC_BOOLINT: case TC_BOOLINT:

Loading…
Cancel
Save