~ubuntu-branches/ubuntu/maverick/proguard/maverick

« back to all changes in this revision

Viewing changes to src/proguard/classfile/util/ClassUtil.java

  • Committer: Bazaar Package Importer
  • Author(s): Sam Clegg
  • Date: 2005-11-13 09:42:59 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20051113094259-432zf4yyw4890mmn
Tags: 3.4-1
* New upstream release (Closes: #338355)
* debian/control: bump standards version
* debian/copyright: update FSF address
* increase java stack size for proguard and proguardgui

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: ClassUtil.java,v 1.21 2004/08/15 12:39:30 eric Exp $
 
1
/* $Id: ClassUtil.java,v 1.25 2005/06/11 13:13:15 eric Exp $
2
2
 *
3
3
 * ProGuard -- shrinking, optimization, and obfuscation of Java class files.
4
4
 *
5
 
 * Copyright (c) 2002-2004 Eric Lafortune (eric@graphics.cornell.edu)
 
5
 * Copyright (c) 2002-2005 Eric Lafortune (eric@graphics.cornell.edu)
6
6
 *
7
7
 * This program is free software; you can redistribute it and/or modify it
8
8
 * under the terms of the GNU General Public License as published by the Free
190
190
 
191
191
 
192
192
    /**
 
193
     * Returns whether the given internal type is a primitive Category 2 type.
 
194
     * @param internalType the internal type,
 
195
     *                     e.g. "<code>L</code>".
 
196
     * @return <code>true</code> if the given type is a Category 2 type,
 
197
     *         <code>false</code> otherwise.
 
198
     */
 
199
    public static boolean isInternalCategory2Type(String internalType)
 
200
    {
 
201
        return internalType.length() == 1 &&
 
202
               (internalType.charAt(0) == ClassConstants.INTERNAL_TYPE_LONG ||
 
203
                internalType.charAt(0) == ClassConstants.INTERNAL_TYPE_DOUBLE);
 
204
    }
 
205
 
 
206
 
 
207
    /**
193
208
     * Returns whether the given internal type is a plain class type
194
209
     * (not an array type).
195
210
     * @param internalType the internal type,
236
251
 
237
252
 
238
253
    /**
239
 
     * Returns the internal class name of any given internal type.
240
 
     * The returned class name for primitive array types is
241
 
     * "<code>java/lang/Object</code>".
 
254
     * Returns the internal class name of any given internal type, disregarding
 
255
     * array prefixes.
242
256
     * @param internalClassType the internal class type,
243
257
     *                          e.g. "<code>Ljava/lang/Object;</code>" or
244
258
     *                               "<code>[[I</code>".
245
259
     * @return the internal class name,
246
 
     *                          e.g. "<code>java/lang/Object</code>".
 
260
     *                          e.g. "<code>java/lang/Object</code>" or
 
261
     *                               <code>null</code>.
247
262
     */
248
263
    public static String internalClassNameFromType(String internalClassType)
249
264
    {
259
274
            }
260
275
            else
261
276
            {
262
 
                internalClassType = ClassConstants.INTERNAL_NAME_JAVA_LANG_OBJECT;
 
277
                internalClassType = null;//ClassConstants.INTERNAL_NAME_JAVA_LANG_OBJECT;
263
278
            }
264
279
        }
265
280
 
480
495
                                ClassConstants.EXTERNAL_TYPE_LONG        :
481
496
            internalTypeChar == ClassConstants.INTERNAL_TYPE_DOUBLE      ?
482
497
                                ClassConstants.EXTERNAL_TYPE_DOUBLE      :
 
498
            internalTypeChar == '%'                                      ?
 
499
                                "%"                                      :
483
500
            internalTypeChar == ClassConstants.INTERNAL_TYPE_CLASS_START ?
484
501
                                externalClassName(internalType.substring(1, internalType.indexOf(ClassConstants.INTERNAL_TYPE_CLASS_END))) :
485
502
                                null;