From 4280f1d6ce693b7726689733e80428c0afdf51da Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 14 Jul 1999 16:07:04 +0000 Subject: [PATCH] moved class->typesignature methods into bytecode package remove class->type methods git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@1066 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/type/Type.java | 81 ---------------------------------------- 1 file changed, 81 deletions(-) diff --git a/jode/jode/type/Type.java b/jode/jode/type/Type.java index 92ec546..04039a1 100644 --- a/jode/jode/type/Type.java +++ b/jode/jode/type/Type.java @@ -175,67 +175,6 @@ public class Type { */ public static final Type tJavaLangClass = tClass("java.lang.Class"); - /** - * This is a private method for generating the signature of a - * given type. - */ - private static final StringBuffer appendSignature(StringBuffer sb, - Class javaType) { - if (javaType.isPrimitive()) { - if (javaType == Boolean.TYPE) - return sb.append('Z'); - else if (javaType == Byte.TYPE) - return sb.append('B'); - else if (javaType == Character.TYPE) - return sb.append('C'); - else if (javaType == Short.TYPE) - return sb.append('S'); - else if (javaType == Integer.TYPE) - return sb.append('I'); - else if (javaType == Long.TYPE) - return sb.append('J'); - else if (javaType == Float.TYPE) - return sb.append('F'); - else if (javaType == Double.TYPE) - return sb.append('D'); - else if (javaType == Void.TYPE) - return sb.append('V'); - else - throw new AssertError("Unknown primitive type: "+javaType); - } else if (javaType.isArray()) { - return appendSignature(sb.append('['), - javaType.getComponentType()); - } else { - return sb.append('L') - .append(javaType.getName().replace('.','/')).append(';'); - } - } - - /** - * Generate the signature for the given Class. - * @param clazz a java.lang.Class, this may also be a primitive or - * array type. - * @return the type signature (see section 4.3.2 Field Descriptors - * of the JVM specification) - */ - public static String getSignature(Class clazz) { - return appendSignature(new StringBuffer(), clazz).toString(); - } - - /** - * Generate a method signature. - * @param paramT the java.lang.Class of the parameter types of the method. - * @param returnT the java.lang.Class of the return type of the method. - * @return the method signature (see section 4.3.3 Method Descriptors - * of the JVM specification) - */ - public static String getSignature(Class paramT[], Class returnT) { - StringBuffer sig = new StringBuffer("("); - for (int i=0; i< paramT.length; i++) - appendSignature(sig, paramT[i]); - return appendSignature(sig.append(')'), returnT).toString(); - } - /** * Generate the singleton set of the type represented by the given * string. @@ -277,16 +216,6 @@ public class Type { throw new AssertError("Unknown type signature: "+type); } - /** - * Generate the singleton set of the type represented by the given - * class. - * @param javaType the type class. - * @return a singleton set containing the given type. - */ - public static final Type tType(Class javaType) { - return Type.tType(getSignature(javaType)); - } - /** * Generate the singleton set of the type represented by the given * class name. @@ -380,16 +309,6 @@ public class Type { return result; } - /** - * Generate/look up the method type for the given class - * @param paramT the parameter types of the method. - * @param returnT the return type of the method. - * @return a method type (a singleton set). - */ - public static MethodType tMethod(Class paramT[], Class returnT) { - return tMethod(getSignature(paramT, returnT)); - } - /** * Generate the range type from bottom to top. This should * represent all reference types, that can be casted to bottom by