private Class<?> arrayClass(Class<?> componentClass, int dimensions) {
        Class<?>[] arraysByDimension = _arrayTypeCache.get(componentClass);
        Class<?> result = null;
        if (arraysByDimension != null && arraysByDimension.length > dimensions)
            result = arraysByDimension[dimensions];
        if (result != null)
            return result;

        if (dimensions == 1)
            result = Array.newInstance(componentClass, 0).getClass();

        else
            result = Array.newInstance(componentClass, new int[dimensions]).getClass();
        if (arraysByDimension != null) {
            if (arraysByDimension.length <= dimensions) {
                Class<?>[] temp = new Class<?>[dimensions + 2];
                System.arraycopy(arraysByDimension, 0, temp, 0, arraysByDimension.length);
                arraysByDimension = temp;
                _arrayTypeCache.put(componentClass, arraysByDimension);
            }
        } else
            arraysByDimension = new Class<?>[dimensions + 2];

        arraysByDimension[dimensions] = result;
        return result;
    }