corba/src/jdk.rmic/share/classes/sun/rmi/rmic/iiop/ArrayType.java
author dsamersoff
Wed, 14 Jan 2015 17:22:28 +0000
changeset 28619 adeadd271a0f
parent 25862 a5e25d68f971
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     1
/*
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
     2
 * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
02bb8761fcce Initial load
duke
parents:
diff changeset
     4
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
02bb8761fcce Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
4
02bb8761fcce Initial load
duke
parents:
diff changeset
    10
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
02bb8761fcce Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
02bb8761fcce Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
02bb8761fcce Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
02bb8761fcce Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
02bb8761fcce Initial load
duke
parents:
diff changeset
    16
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
02bb8761fcce Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
02bb8761fcce Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
02bb8761fcce Initial load
duke
parents:
diff changeset
    20
 *
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
    23
 * questions.
4
02bb8761fcce Initial load
duke
parents:
diff changeset
    24
 */
02bb8761fcce Initial load
duke
parents:
diff changeset
    25
02bb8761fcce Initial load
duke
parents:
diff changeset
    26
/*
02bb8761fcce Initial load
duke
parents:
diff changeset
    27
 * Licensed Materials - Property of IBM
02bb8761fcce Initial load
duke
parents:
diff changeset
    28
 * RMI-IIOP v1.0
02bb8761fcce Initial load
duke
parents:
diff changeset
    29
 * Copyright IBM Corp. 1998 1999  All Rights Reserved
02bb8761fcce Initial load
duke
parents:
diff changeset
    30
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    31
 */
02bb8761fcce Initial load
duke
parents:
diff changeset
    32
02bb8761fcce Initial load
duke
parents:
diff changeset
    33
package sun.rmi.rmic.iiop;
02bb8761fcce Initial load
duke
parents:
diff changeset
    34
02bb8761fcce Initial load
duke
parents:
diff changeset
    35
import java.util.Vector;
02bb8761fcce Initial load
duke
parents:
diff changeset
    36
import java.util.HashSet;
02bb8761fcce Initial load
duke
parents:
diff changeset
    37
import sun.tools.java.CompilerError;
02bb8761fcce Initial load
duke
parents:
diff changeset
    38
import sun.tools.java.Identifier;
02bb8761fcce Initial load
duke
parents:
diff changeset
    39
import sun.tools.java.ClassDefinition;
02bb8761fcce Initial load
duke
parents:
diff changeset
    40
import java.lang.reflect.Array;
02bb8761fcce Initial load
duke
parents:
diff changeset
    41
02bb8761fcce Initial load
duke
parents:
diff changeset
    42
/**
02bb8761fcce Initial load
duke
parents:
diff changeset
    43
 * ArrayType is a wrapper for any of the other types. The getElementType()
02bb8761fcce Initial load
duke
parents:
diff changeset
    44
 * method can be used to get the array element type.  The getArrayDimension()
02bb8761fcce Initial load
duke
parents:
diff changeset
    45
 * method can be used to get the array dimension.
02bb8761fcce Initial load
duke
parents:
diff changeset
    46
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    47
 * @author      Bryan Atsatt
02bb8761fcce Initial load
duke
parents:
diff changeset
    48
 */
02bb8761fcce Initial load
duke
parents:
diff changeset
    49
public class ArrayType extends Type {
02bb8761fcce Initial load
duke
parents:
diff changeset
    50
02bb8761fcce Initial load
duke
parents:
diff changeset
    51
    private Type type;
02bb8761fcce Initial load
duke
parents:
diff changeset
    52
    private int arrayDimension;
02bb8761fcce Initial load
duke
parents:
diff changeset
    53
    private String brackets;
02bb8761fcce Initial load
duke
parents:
diff changeset
    54
    private String bracketsSig;
02bb8761fcce Initial load
duke
parents:
diff changeset
    55
02bb8761fcce Initial load
duke
parents:
diff changeset
    56
    //_____________________________________________________________________
02bb8761fcce Initial load
duke
parents:
diff changeset
    57
    // Public Interfaces
02bb8761fcce Initial load
duke
parents:
diff changeset
    58
    //_____________________________________________________________________
02bb8761fcce Initial load
duke
parents:
diff changeset
    59
02bb8761fcce Initial load
duke
parents:
diff changeset
    60
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
    61
     * Create an ArrayType object for the given type.
02bb8761fcce Initial load
duke
parents:
diff changeset
    62
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
    63
     * If the class is not a properly formed or if some other error occurs, the
02bb8761fcce Initial load
duke
parents:
diff changeset
    64
     * return value will be null, and errors will have been reported to the
02bb8761fcce Initial load
duke
parents:
diff changeset
    65
     * supplied BatchEnvironment.
02bb8761fcce Initial load
duke
parents:
diff changeset
    66
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
    67
    public static ArrayType forArray(   sun.tools.java.Type theType,
02bb8761fcce Initial load
duke
parents:
diff changeset
    68
                                        ContextStack stack) {
02bb8761fcce Initial load
duke
parents:
diff changeset
    69
02bb8761fcce Initial load
duke
parents:
diff changeset
    70
02bb8761fcce Initial load
duke
parents:
diff changeset
    71
        ArrayType result = null;
02bb8761fcce Initial load
duke
parents:
diff changeset
    72
        sun.tools.java.Type arrayType = theType;
02bb8761fcce Initial load
duke
parents:
diff changeset
    73
02bb8761fcce Initial load
duke
parents:
diff changeset
    74
        if (arrayType.getTypeCode() == TC_ARRAY) {
02bb8761fcce Initial load
duke
parents:
diff changeset
    75
02bb8761fcce Initial load
duke
parents:
diff changeset
    76
            // Find real type...
02bb8761fcce Initial load
duke
parents:
diff changeset
    77
02bb8761fcce Initial load
duke
parents:
diff changeset
    78
            while (arrayType.getTypeCode() == TC_ARRAY) {
02bb8761fcce Initial load
duke
parents:
diff changeset
    79
                arrayType = arrayType.getElementType();
02bb8761fcce Initial load
duke
parents:
diff changeset
    80
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
    81
02bb8761fcce Initial load
duke
parents:
diff changeset
    82
            // Do we already have it?
02bb8761fcce Initial load
duke
parents:
diff changeset
    83
02bb8761fcce Initial load
duke
parents:
diff changeset
    84
            Type existing = getType(theType,stack);
02bb8761fcce Initial load
duke
parents:
diff changeset
    85
            if (existing != null) {
02bb8761fcce Initial load
duke
parents:
diff changeset
    86
02bb8761fcce Initial load
duke
parents:
diff changeset
    87
                if (!(existing instanceof ArrayType)) return null; // False hit.
02bb8761fcce Initial load
duke
parents:
diff changeset
    88
02bb8761fcce Initial load
duke
parents:
diff changeset
    89
                                // Yep, so return it...
02bb8761fcce Initial load
duke
parents:
diff changeset
    90
02bb8761fcce Initial load
duke
parents:
diff changeset
    91
                return (ArrayType) existing;
02bb8761fcce Initial load
duke
parents:
diff changeset
    92
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
    93
02bb8761fcce Initial load
duke
parents:
diff changeset
    94
            // Now try to make a Type from it...
02bb8761fcce Initial load
duke
parents:
diff changeset
    95
02bb8761fcce Initial load
duke
parents:
diff changeset
    96
            Type temp = CompoundType.makeType(arrayType,null,stack);
02bb8761fcce Initial load
duke
parents:
diff changeset
    97
02bb8761fcce Initial load
duke
parents:
diff changeset
    98
            if (temp != null) {
02bb8761fcce Initial load
duke
parents:
diff changeset
    99
02bb8761fcce Initial load
duke
parents:
diff changeset
   100
                                // Got a valid one. Make an array type...
02bb8761fcce Initial load
duke
parents:
diff changeset
   101
02bb8761fcce Initial load
duke
parents:
diff changeset
   102
                result = new ArrayType(stack,temp,theType.getArrayDimension());
02bb8761fcce Initial load
duke
parents:
diff changeset
   103
02bb8761fcce Initial load
duke
parents:
diff changeset
   104
                                // Add it...
02bb8761fcce Initial load
duke
parents:
diff changeset
   105
02bb8761fcce Initial load
duke
parents:
diff changeset
   106
                putType(theType,result,stack);
02bb8761fcce Initial load
duke
parents:
diff changeset
   107
02bb8761fcce Initial load
duke
parents:
diff changeset
   108
                // Do the stack thing in case tracing on...
02bb8761fcce Initial load
duke
parents:
diff changeset
   109
02bb8761fcce Initial load
duke
parents:
diff changeset
   110
                stack.push(result);
02bb8761fcce Initial load
duke
parents:
diff changeset
   111
                stack.pop(true);
02bb8761fcce Initial load
duke
parents:
diff changeset
   112
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
   113
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   114
02bb8761fcce Initial load
duke
parents:
diff changeset
   115
        return result;
02bb8761fcce Initial load
duke
parents:
diff changeset
   116
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   117
02bb8761fcce Initial load
duke
parents:
diff changeset
   118
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   119
     * Return signature for this type  (e.g. com.acme.Dynamite
02bb8761fcce Initial load
duke
parents:
diff changeset
   120
     * would return "com.acme.Dynamite", byte = "B")
02bb8761fcce Initial load
duke
parents:
diff changeset
   121
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   122
    public String getSignature() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   123
        return bracketsSig + type.getSignature();
02bb8761fcce Initial load
duke
parents:
diff changeset
   124
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   125
02bb8761fcce Initial load
duke
parents:
diff changeset
   126
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   127
     * Get element type. Returns null if not an array.
02bb8761fcce Initial load
duke
parents:
diff changeset
   128
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   129
    public Type getElementType () {
02bb8761fcce Initial load
duke
parents:
diff changeset
   130
        return type;
02bb8761fcce Initial load
duke
parents:
diff changeset
   131
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   132
02bb8761fcce Initial load
duke
parents:
diff changeset
   133
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   134
     * Get array dimension. Returns zero if not an array.
02bb8761fcce Initial load
duke
parents:
diff changeset
   135
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   136
    public int getArrayDimension () {
02bb8761fcce Initial load
duke
parents:
diff changeset
   137
        return arrayDimension;
02bb8761fcce Initial load
duke
parents:
diff changeset
   138
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   139
02bb8761fcce Initial load
duke
parents:
diff changeset
   140
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   141
     * Get brackets string. Returns "" if not an array.
02bb8761fcce Initial load
duke
parents:
diff changeset
   142
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   143
    public String getArrayBrackets () {
02bb8761fcce Initial load
duke
parents:
diff changeset
   144
        return brackets;
02bb8761fcce Initial load
duke
parents:
diff changeset
   145
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   146
02bb8761fcce Initial load
duke
parents:
diff changeset
   147
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   148
     * Return a string representation of this type.
02bb8761fcce Initial load
duke
parents:
diff changeset
   149
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   150
    public String toString () {
02bb8761fcce Initial load
duke
parents:
diff changeset
   151
        return getQualifiedName() + brackets;
02bb8761fcce Initial load
duke
parents:
diff changeset
   152
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   153
02bb8761fcce Initial load
duke
parents:
diff changeset
   154
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   155
     * Return a string describing this type.
02bb8761fcce Initial load
duke
parents:
diff changeset
   156
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   157
    public String getTypeDescription () {
02bb8761fcce Initial load
duke
parents:
diff changeset
   158
        return "Array of " + type.getTypeDescription();
02bb8761fcce Initial load
duke
parents:
diff changeset
   159
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   160
02bb8761fcce Initial load
duke
parents:
diff changeset
   161
02bb8761fcce Initial load
duke
parents:
diff changeset
   162
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   163
     * Return the name of this type. For arrays, will include "[]" if useIDLNames == false.
02bb8761fcce Initial load
duke
parents:
diff changeset
   164
     * @param useQualifiedNames If true, print qualified names; otherwise, print unqualified names.
02bb8761fcce Initial load
duke
parents:
diff changeset
   165
     * @param useIDLNames If true, print IDL names; otherwise, print java names.
02bb8761fcce Initial load
duke
parents:
diff changeset
   166
     * @param globalIDLNames If true and useIDLNames true, prepends "::".
02bb8761fcce Initial load
duke
parents:
diff changeset
   167
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   168
    public String getTypeName ( boolean useQualifiedNames,
02bb8761fcce Initial load
duke
parents:
diff changeset
   169
                                boolean useIDLNames,
02bb8761fcce Initial load
duke
parents:
diff changeset
   170
                                boolean globalIDLNames) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   171
        if (useIDLNames) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   172
            return super.getTypeName(useQualifiedNames,useIDLNames,globalIDLNames);
02bb8761fcce Initial load
duke
parents:
diff changeset
   173
        } else {
02bb8761fcce Initial load
duke
parents:
diff changeset
   174
            return super.getTypeName(useQualifiedNames,useIDLNames,globalIDLNames) + brackets;
02bb8761fcce Initial load
duke
parents:
diff changeset
   175
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   176
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   177
02bb8761fcce Initial load
duke
parents:
diff changeset
   178
    //_____________________________________________________________________
02bb8761fcce Initial load
duke
parents:
diff changeset
   179
    // Subclass/Internal Interfaces
02bb8761fcce Initial load
duke
parents:
diff changeset
   180
    //_____________________________________________________________________
02bb8761fcce Initial load
duke
parents:
diff changeset
   181
02bb8761fcce Initial load
duke
parents:
diff changeset
   182
02bb8761fcce Initial load
duke
parents:
diff changeset
   183
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   184
     * Convert all invalid types to valid ones.
02bb8761fcce Initial load
duke
parents:
diff changeset
   185
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   186
    protected void swapInvalidTypes () {
02bb8761fcce Initial load
duke
parents:
diff changeset
   187
        if (type.getStatus() != STATUS_VALID) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   188
            type = getValidType(type);
02bb8761fcce Initial load
duke
parents:
diff changeset
   189
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   190
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   191
02bb8761fcce Initial load
duke
parents:
diff changeset
   192
    /*
02bb8761fcce Initial load
duke
parents:
diff changeset
   193
     * Add matching types to list. Return true if this type has not
02bb8761fcce Initial load
duke
parents:
diff changeset
   194
     * been previously checked, false otherwise.
02bb8761fcce Initial load
duke
parents:
diff changeset
   195
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   196
    protected boolean addTypes (int typeCodeFilter,
02bb8761fcce Initial load
duke
parents:
diff changeset
   197
                                HashSet checked,
02bb8761fcce Initial load
duke
parents:
diff changeset
   198
                                Vector matching) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   199
02bb8761fcce Initial load
duke
parents:
diff changeset
   200
        // Check self.
02bb8761fcce Initial load
duke
parents:
diff changeset
   201
02bb8761fcce Initial load
duke
parents:
diff changeset
   202
        boolean result = super.addTypes(typeCodeFilter,checked,matching);
02bb8761fcce Initial load
duke
parents:
diff changeset
   203
02bb8761fcce Initial load
duke
parents:
diff changeset
   204
        // Have we been checked before?
02bb8761fcce Initial load
duke
parents:
diff changeset
   205
02bb8761fcce Initial load
duke
parents:
diff changeset
   206
        if (result) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   207
02bb8761fcce Initial load
duke
parents:
diff changeset
   208
            // No, so add element type...
02bb8761fcce Initial load
duke
parents:
diff changeset
   209
02bb8761fcce Initial load
duke
parents:
diff changeset
   210
            getElementType().addTypes(typeCodeFilter,checked,matching);
02bb8761fcce Initial load
duke
parents:
diff changeset
   211
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   212
02bb8761fcce Initial load
duke
parents:
diff changeset
   213
        return result;
02bb8761fcce Initial load
duke
parents:
diff changeset
   214
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   215
02bb8761fcce Initial load
duke
parents:
diff changeset
   216
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   217
     * Create an ArrayType instance for the given type.  The resulting
02bb8761fcce Initial load
duke
parents:
diff changeset
   218
     * object is not yet completely initialized.
02bb8761fcce Initial load
duke
parents:
diff changeset
   219
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   220
    private ArrayType(ContextStack stack, Type type, int arrayDimension) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   221
        super(stack,TYPE_ARRAY);
02bb8761fcce Initial load
duke
parents:
diff changeset
   222
        this.type = type;
02bb8761fcce Initial load
duke
parents:
diff changeset
   223
        this.arrayDimension = arrayDimension;
02bb8761fcce Initial load
duke
parents:
diff changeset
   224
02bb8761fcce Initial load
duke
parents:
diff changeset
   225
        // Create our brackets string...
02bb8761fcce Initial load
duke
parents:
diff changeset
   226
02bb8761fcce Initial load
duke
parents:
diff changeset
   227
        brackets = "";
02bb8761fcce Initial load
duke
parents:
diff changeset
   228
        bracketsSig = "";
02bb8761fcce Initial load
duke
parents:
diff changeset
   229
        for (int i = 0; i < arrayDimension; i ++) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   230
            brackets += "[]";
02bb8761fcce Initial load
duke
parents:
diff changeset
   231
            bracketsSig += "[";
02bb8761fcce Initial load
duke
parents:
diff changeset
   232
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   233
02bb8761fcce Initial load
duke
parents:
diff changeset
   234
        // Now set our names...
02bb8761fcce Initial load
duke
parents:
diff changeset
   235
02bb8761fcce Initial load
duke
parents:
diff changeset
   236
        String idlName = IDLNames.getArrayName(type,arrayDimension);
02bb8761fcce Initial load
duke
parents:
diff changeset
   237
        String[] module = IDLNames.getArrayModuleNames(type);
02bb8761fcce Initial load
duke
parents:
diff changeset
   238
        setNames(type.getIdentifier(),module,idlName);
02bb8761fcce Initial load
duke
parents:
diff changeset
   239
02bb8761fcce Initial load
duke
parents:
diff changeset
   240
        // Set our repositoryID...
02bb8761fcce Initial load
duke
parents:
diff changeset
   241
02bb8761fcce Initial load
duke
parents:
diff changeset
   242
        setRepositoryID();
02bb8761fcce Initial load
duke
parents:
diff changeset
   243
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   244
02bb8761fcce Initial load
duke
parents:
diff changeset
   245
02bb8761fcce Initial load
duke
parents:
diff changeset
   246
    /*
02bb8761fcce Initial load
duke
parents:
diff changeset
   247
     * Load a Class instance. Return null if fail.
02bb8761fcce Initial load
duke
parents:
diff changeset
   248
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   249
    protected Class loadClass() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   250
        Class result = null;
02bb8761fcce Initial load
duke
parents:
diff changeset
   251
        Class elementClass = type.getClassInstance();
02bb8761fcce Initial load
duke
parents:
diff changeset
   252
        if (elementClass != null) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   253
            result = Array.newInstance(elementClass, new int[arrayDimension]).getClass();
02bb8761fcce Initial load
duke
parents:
diff changeset
   254
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   255
        return result;
02bb8761fcce Initial load
duke
parents:
diff changeset
   256
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   257
02bb8761fcce Initial load
duke
parents:
diff changeset
   258
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   259
     * Release all resources
02bb8761fcce Initial load
duke
parents:
diff changeset
   260
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   261
    protected void destroy () {
02bb8761fcce Initial load
duke
parents:
diff changeset
   262
        super.destroy();
02bb8761fcce Initial load
duke
parents:
diff changeset
   263
        if (type != null) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   264
            type.destroy();
02bb8761fcce Initial load
duke
parents:
diff changeset
   265
            type = null;
02bb8761fcce Initial load
duke
parents:
diff changeset
   266
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   267
        brackets = null;
02bb8761fcce Initial load
duke
parents:
diff changeset
   268
        bracketsSig = null;
02bb8761fcce Initial load
duke
parents:
diff changeset
   269
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   270
}