unused code removed BLD200505191800
authorthurka@netbeans.org
Thu, 19 May 2005 12:46:51 +0000
changeset 61449913e3fb2d16
parent 6143 4349b3912809
child 6145 656f555fecf0
unused code removed
clazz/src/org/netbeans/modules/clazz/Util.java
     1.1 --- a/clazz/src/org/netbeans/modules/clazz/Util.java	Wed May 18 23:58:08 2005 +0000
     1.2 +++ b/clazz/src/org/netbeans/modules/clazz/Util.java	Thu May 19 12:46:51 2005 +0000
     1.3 @@ -46,130 +46,7 @@
     1.4  final class Util {
     1.5  
     1.6      private static RequestProcessor classProcessor;
     1.7 -    
     1.8 -    public static final Type getReturnType(String signature){
     1.9 -        return new SignatureToType(signature).getReturnType();
    1.10 -    }
    1.11 -    
    1.12 -    public static final MethodParameter[] getParametersType(String signature){
    1.13 -        return new SignatureToType(signature).getMethodParameters();
    1.14 -    }
    1.15 -
    1.16 -    public static class SignatureToType{
    1.17 -        private char[] signature;        
    1.18 -        private int len;        
    1.19 -        private int i = 0;
    1.20          
    1.21 -        private Type returnType = null; //return type
    1.22 -        private MethodParameter[] params = null;    //return MethodParameter[]
    1.23 -        
    1.24 -        public SignatureToType(String signature){
    1.25 -            this.signature = signature.toCharArray();//.substring(signature.indexOf(')')+1).getBytes();
    1.26 -            len = this.signature.length;
    1.27 -            for( ; i < len; i++ ){
    1.28 -                if (this.signature[i] == '('){
    1.29 -                    i++;
    1.30 -                    Type t; 
    1.31 -                    ArrayList list = new ArrayList();
    1.32 -                    while( ( t = sigToType()) != null ){
    1.33 -                        list.add(t);
    1.34 -                    }                    
    1.35 -                    params = new MethodParameter[list.size()];
    1.36 -                    for( int n = 0; n < list.size(); n++){
    1.37 -                        params[n] = new MethodParameter("", (Type)list.get(n), false);
    1.38 -                    }
    1.39 -                }
    1.40 -                
    1.41 -                returnType = sigToType();
    1.42 -            }
    1.43 -        }
    1.44 -        
    1.45 -        public Type getReturnType(){
    1.46 -            return returnType;
    1.47 -        }
    1.48 -        
    1.49 -        public MethodParameter[] getMethodParameters(){
    1.50 -            return params;
    1.51 -        }
    1.52 -
    1.53 -        Type sigToType( ) {
    1.54 -            switch ((char) signature[i]) {
    1.55 -            case 'B':
    1.56 -                i++;
    1.57 -                return Type.BYTE;
    1.58 -            case 'C':
    1.59 -                i++;
    1.60 -                return Type.CHAR;
    1.61 -            case 'D':
    1.62 -                i++;
    1.63 -                return Type.DOUBLE;
    1.64 -            case 'F':
    1.65 -                i++;
    1.66 -                return Type.FLOAT;
    1.67 -            case 'I':
    1.68 -                i++;
    1.69 -                return Type.INT;
    1.70 -            case 'J':
    1.71 -                i++;
    1.72 -                return Type.LONG;
    1.73 -            case 'L':
    1.74 -                return classSigToType();
    1.75 -            case 'S':
    1.76 -                i++;
    1.77 -                return Type.SHORT;
    1.78 -            case 'V':
    1.79 -                i++;
    1.80 -                return Type.VOID;
    1.81 -            case 'Z':
    1.82 -                i++;
    1.83 -                return Type.BOOLEAN;
    1.84 -            case '[':
    1.85 -                return createArrayType();
    1.86 -            case ')':
    1.87 -                i++;
    1.88 -                return null;
    1.89 -            default:
    1.90 -                throw new IllegalArgumentException("Unknown signature"); // NOI18N
    1.91 -            }
    1.92 -        }
    1.93 -        
    1.94 -        Type classSigToType() {
    1.95 -            if (signature[i++] == 'L') {
    1.96 -                int start = i;
    1.97 -                while (signature[i] != ';' ) i++;
    1.98 -                //get FQN replace bad chars
    1.99 -                String fs  = new String(signature, start, i - start ).replace('$', '.').replace('/','.');
   1.100 -                String s;
   1.101 -                
   1.102 -                //filter java.lang
   1.103 -                int idx;
   1.104 -                if( fs.startsWith("java.lang") ){ // NOI18N
   1.105 -                    s = fs.substring( 10 ); //filter 'java.lang.'
   1.106 -                } else {
   1.107 -                    s = fs;
   1.108 -                }
   1.109 -                i++;
   1.110 -                return Type.createClass(Identifier.create(fs, s, Identifier.RESOLVED));
   1.111 -            } else {
   1.112 -                throw new IllegalArgumentException("Method signature has to start with >>L<<"); // NOI18N
   1.113 -            }
   1.114 -        }
   1.115 -        
   1.116 -        Type createArrayType(){
   1.117 -            int depth = 0;
   1.118 -            for( ; i < len; i++ ){
   1.119 -                if( (char)signature[i] == '[' )
   1.120 -                    depth++;
   1.121 -                else
   1.122 -                    break;                
   1.123 -            }
   1.124 -            Type t = sigToType();
   1.125 -            for( int n = 0; n < depth; n++)
   1.126 -                t = Type.createArray(t);
   1.127 -            return t;
   1.128 -        }
   1.129 -    }    
   1.130 -    
   1.131      static String createClassName(String signature) {
   1.132          return signature.replace('/', '.').replace('$', '.');
   1.133      }
   1.134 @@ -208,14 +85,6 @@
   1.135          throw new IllegalArgumentException("Invalid TypeDescriptor: " + t); // NOI18N
   1.136      }
   1.137      
   1.138 -    /**
   1.139 -     * Finds a DataObject for the specified ClassResource given the project
   1.140 -     * context
   1.141 -     */
   1.142 -    static DataObject findDataObject(Lookup context, Resource resource) {
   1.143 -        return null;
   1.144 -    }
   1.145 -
   1.146      static RequestProcessor getClassProcessor() {
   1.147          if (classProcessor==null)
   1.148              classProcessor=new RequestProcessor("Clazz",5); // NOI18N