geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/util/TypeLiteral.java [75:110]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private Type getDefinedType(Class<?> clazz)
    {
        Type type = null;

        if (clazz == null)
        {
            throw new RuntimeException("Class parameter can not be null!");
        }

        Type superClazz = clazz.getGenericSuperclass();

        if (superClazz.equals(Object.class))
        {
            throw new RuntimeException("Super class must be parametrized type!");
        }
        else if (superClazz instanceof ParameterizedType)
        {
            ParameterizedType pt = (ParameterizedType) superClazz;            
            Type[] actualArgs = pt.getActualTypeArguments();

            if (actualArgs.length == 1)
            {
                type = actualArgs[0];
            }
            else
            {
                throw new RuntimeException("More than one parametric type!");
            }
        }
        else
        {
            type = getDefinedType((Class<?>) superClazz);
        }

        return type;
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



geronimo-jcdi_1.0_spec/src/main/java/javax/enterprise/util/TypeLiteral.java [75:110]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private Type getDefinedType(Class<?> clazz)
    {
        Type type = null;

        if (clazz == null)
        {
            throw new RuntimeException("Class parameter can not be null!");
        }

        Type superClazz = clazz.getGenericSuperclass();

        if (superClazz.equals(Object.class))
        {
            throw new RuntimeException("Super class must be parametrized type!");
        }
        else if (superClazz instanceof ParameterizedType)
        {
            ParameterizedType pt = (ParameterizedType) superClazz;            
            Type[] actualArgs = pt.getActualTypeArguments();

            if (actualArgs.length == 1)
            {
                type = actualArgs[0];
            }
            else
            {
                throw new RuntimeException("More than one parametric type!");
            }
        }
        else
        {
            type = getDefinedType((Class<?>) superClazz);
        }

        return type;
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



