类java.lang.reflect.MalformedParameterizedTypeException源码实例Demo

下面列出了怎么用java.lang.reflect.MalformedParameterizedTypeException的API类实例代码及写法,或者点击链接到github查看源代码。

private Class<? extends Throwable> getGenericType(Class<? extends ExceptionMapper> mapper) {
    try {
        Type[] types = mapper.getGenericInterfaces();
        if (null == types || 0 == types.length) {
            types = new Type[]{mapper.getGenericSuperclass()};
        }

        for (Type type : types) {
            Class<?> rawType = ClassUtils.getRawType(type);
            if (type instanceof ParameterizedType && ExceptionMapper.class.isAssignableFrom(rawType)) {
                //noinspection unchecked
                return (Class<? extends Throwable>) ((ParameterizedType) type).getActualTypeArguments()[0];
            }
        }

        if (isProxy(mapper)) {
            return getGenericType((Class<? extends ExceptionMapper>) mapper.getSuperclass());
        }

        //Won't get in here
        throw new IllegalStateException("unable to discover exception class for " + mapper.getName());
    } catch (MalformedParameterizedTypeException e) {
        throw new IllegalStateException(mapper.getName(), e);
    }
}
 
源代码2 项目: Bytecoder   文件: ParameterizedTypeImpl.java
private void validateConstructorArguments() {
    TypeVariable<?>[] formals = rawType.getTypeParameters();
    // check correct arity of actual type args
    if (formals.length != actualTypeArguments.length) {
        throw new MalformedParameterizedTypeException(String.format("Mismatch of count of " +
                                                                    "formal and actual type " +
                                                                    "arguments in constructor " +
                                                                    "of %s: %d formal argument(s) "+
                                                                    "%d actual argument(s)",
                                                                    rawType.getName(),
                                                                    formals.length,
                                                                    actualTypeArguments.length));
    }
    for (int i = 0; i < actualTypeArguments.length; i++) {
        // check actuals against formals' bounds
    }
}
 
源代码3 项目: dragonwell8_jdk   文件: ParameterizedTypeImpl.java
private void validateConstructorArguments() {
    TypeVariable<?>[] formals = rawType.getTypeParameters();
    // check correct arity of actual type args
    if (formals.length != actualTypeArguments.length){
        throw new MalformedParameterizedTypeException();
    }
    for (int i = 0; i < actualTypeArguments.length; i++) {
        // check actuals against formals' bounds
    }
}
 
源代码4 项目: TencentKona-8   文件: ParameterizedTypeImpl.java
private void validateConstructorArguments() {
    TypeVariable<?>[] formals = rawType.getTypeParameters();
    // check correct arity of actual type args
    if (formals.length != actualTypeArguments.length){
        throw new MalformedParameterizedTypeException();
    }
    for (int i = 0; i < actualTypeArguments.length; i++) {
        // check actuals against formals' bounds
    }
}
 
源代码5 项目: TencentKona-8   文件: ParameterizedTypeImpl.java
private void validateConstructorArguments() {
        TypeVariable/*<?>*/[] formals = rawType.getTypeParameters();
        // check correct arity of actual type args
        if (formals.length != actualTypeArguments.length) {
            throw new MalformedParameterizedTypeException();
        }
/*
        for (int i = 0; i < actualTypeArguments.length; i++) {
            // check actuals against formals' bounds
        }
*/
    }
 
源代码6 项目: jdk8u60   文件: ParameterizedTypeImpl.java
private void validateConstructorArguments() {
    TypeVariable<?>[] formals = rawType.getTypeParameters();
    // check correct arity of actual type args
    if (formals.length != actualTypeArguments.length){
        throw new MalformedParameterizedTypeException();
    }
    for (int i = 0; i < actualTypeArguments.length; i++) {
        // check actuals against formals' bounds
    }
}
 
源代码7 项目: jdk8u60   文件: ParameterizedTypeImpl.java
private void validateConstructorArguments() {
        TypeVariable/*<?>*/[] formals = rawType.getTypeParameters();
        // check correct arity of actual type args
        if (formals.length != actualTypeArguments.length) {
            throw new MalformedParameterizedTypeException();
        }
/*
        for (int i = 0; i < actualTypeArguments.length; i++) {
            // check actuals against formals' bounds
        }
*/
    }
 
源代码8 项目: gadtry   文件: JavaParameterizedTypeImpl.java
private void validateConstructorArguments()
{
    TypeVariable<?>[] formals = rawType.getTypeParameters();
    // check correct arity of actual type args
    if (formals.length != actualTypeArguments.length) {
        throw new MalformedParameterizedTypeException();
    }
    for (int i = 0; i < actualTypeArguments.length; i++) {
        // check actuals against formals' bounds
    }
}
 
private void validateConstructorArguments() {
    TypeVariable/*<?>*/[] formals = rawType.getTypeParameters();
    // check correct arity of actual type args
    if (formals.length != actualTypeArguments.length){
        throw new MalformedParameterizedTypeException();
    }
    for (int i = 0; i < actualTypeArguments.length; i++) {
        // check actuals against formals' bounds
    }

}
 
源代码10 项目: openjdk-jdk8u   文件: ParameterizedTypeImpl.java
private void validateConstructorArguments() {
    TypeVariable<?>[] formals = rawType.getTypeParameters();
    // check correct arity of actual type args
    if (formals.length != actualTypeArguments.length){
        throw new MalformedParameterizedTypeException();
    }
    for (int i = 0; i < actualTypeArguments.length; i++) {
        // check actuals against formals' bounds
    }
}
 
源代码11 项目: openjdk-jdk8u   文件: ParameterizedTypeImpl.java
private void validateConstructorArguments() {
        TypeVariable/*<?>*/[] formals = rawType.getTypeParameters();
        // check correct arity of actual type args
        if (formals.length != actualTypeArguments.length) {
            throw new MalformedParameterizedTypeException();
        }
/*
        for (int i = 0; i < actualTypeArguments.length; i++) {
            // check actuals against formals' bounds
        }
*/
    }
 
private void validateConstructorArguments() {
    TypeVariable<?>[] formals = rawType.getTypeParameters();
    // check correct arity of actual type args
    if (formals.length != actualTypeArguments.length){
        throw new MalformedParameterizedTypeException();
    }
    for (int i = 0; i < actualTypeArguments.length; i++) {
        // check actuals against formals' bounds
    }
}
 
private void validateConstructorArguments() {
        TypeVariable/*<?>*/[] formals = rawType.getTypeParameters();
        // check correct arity of actual type args
        if (formals.length != actualTypeArguments.length) {
            throw new MalformedParameterizedTypeException();
        }
/*
        for (int i = 0; i < actualTypeArguments.length; i++) {
            // check actuals against formals' bounds
        }
*/
    }
 
源代码14 项目: javaide   文件: ParameterizedTypeImpl.java
private void validateConstructorArguments() {
    TypeVariable/*<?>*/[] formals = rawType.getTypeParameters();
    // check correct arity of actual type args
    if (formals.length != actualTypeArguments.length){
        throw new MalformedParameterizedTypeException();
    }
    for (int i = 0; i < actualTypeArguments.length; i++) {
        // check actuals against formals' bounds
    }

}
 
源代码15 项目: openjdk-jdk9   文件: ParameterizedTypeImpl.java
private void validateConstructorArguments() {
    TypeVariable<?>[] formals = rawType.getTypeParameters();
    // check correct arity of actual type args
    if (formals.length != actualTypeArguments.length){
        throw new MalformedParameterizedTypeException();
    }
    for (int i = 0; i < actualTypeArguments.length; i++) {
        // check actuals against formals' bounds
    }
}
 
源代码16 项目: openjdk-jdk9   文件: ParameterizedTypeImpl.java
private void validateConstructorArguments() {
        TypeVariable/*<?>*/[] formals = rawType.getTypeParameters();
        // check correct arity of actual type args
        if (formals.length != actualTypeArguments.length) {
            throw new MalformedParameterizedTypeException();
        }
/*
        for (int i = 0; i < actualTypeArguments.length; i++) {
            // check actuals against formals' bounds
        }
*/
    }
 
源代码17 项目: jdk8u-jdk   文件: ParameterizedTypeImpl.java
private void validateConstructorArguments() {
    TypeVariable<?>[] formals = rawType.getTypeParameters();
    // check correct arity of actual type args
    if (formals.length != actualTypeArguments.length){
        throw new MalformedParameterizedTypeException();
    }
    for (int i = 0; i < actualTypeArguments.length; i++) {
        // check actuals against formals' bounds
    }
}
 
源代码18 项目: hottub   文件: ParameterizedTypeImpl.java
private void validateConstructorArguments() {
    TypeVariable<?>[] formals = rawType.getTypeParameters();
    // check correct arity of actual type args
    if (formals.length != actualTypeArguments.length){
        throw new MalformedParameterizedTypeException();
    }
    for (int i = 0; i < actualTypeArguments.length; i++) {
        // check actuals against formals' bounds
    }
}
 
源代码19 项目: hottub   文件: ParameterizedTypeImpl.java
private void validateConstructorArguments() {
        TypeVariable/*<?>*/[] formals = rawType.getTypeParameters();
        // check correct arity of actual type args
        if (formals.length != actualTypeArguments.length) {
            throw new MalformedParameterizedTypeException();
        }
/*
        for (int i = 0; i < actualTypeArguments.length; i++) {
            // check actuals against formals' bounds
        }
*/
    }
 
源代码20 项目: openjdk-8-source   文件: ParameterizedTypeImpl.java
private void validateConstructorArguments() {
    TypeVariable<?>[] formals = rawType.getTypeParameters();
    // check correct arity of actual type args
    if (formals.length != actualTypeArguments.length){
        throw new MalformedParameterizedTypeException();
    }
    for (int i = 0; i < actualTypeArguments.length; i++) {
        // check actuals against formals' bounds
    }
}
 
源代码21 项目: openjdk-8-source   文件: ParameterizedTypeImpl.java
private void validateConstructorArguments() {
        TypeVariable/*<?>*/[] formals = rawType.getTypeParameters();
        // check correct arity of actual type args
        if (formals.length != actualTypeArguments.length) {
            throw new MalformedParameterizedTypeException();
        }
/*
        for (int i = 0; i < actualTypeArguments.length; i++) {
            // check actuals against formals' bounds
        }
*/
    }
 
源代码22 项目: blueocean-plugin   文件: TypeUtil.java
private void validateConstructorArguments() {
    TypeVariable/*<?>*/[] formals = rawType.getTypeParameters();
    // check correct arity of actual type args
    if (formals.length != actualTypeArguments.length) {
        throw new MalformedParameterizedTypeException();
    }
    for (int i = 0; i < actualTypeArguments.length; i++) {
        // check actuals against formals' bounds
    }

}
 
源代码23 项目: openjdk-8   文件: ParameterizedTypeImpl.java
private void validateConstructorArguments() {
    TypeVariable<?>[] formals = rawType.getTypeParameters();
    // check correct arity of actual type args
    if (formals.length != actualTypeArguments.length){
        throw new MalformedParameterizedTypeException();
    }
    for (int i = 0; i < actualTypeArguments.length; i++) {
        // check actuals against formals' bounds
    }
}
 
源代码24 项目: openjdk-8   文件: ParameterizedTypeImpl.java
private void validateConstructorArguments() {
        TypeVariable/*<?>*/[] formals = rawType.getTypeParameters();
        // check correct arity of actual type args
        if (formals.length != actualTypeArguments.length) {
            throw new MalformedParameterizedTypeException();
        }
/*
        for (int i = 0; i < actualTypeArguments.length; i++) {
            // check actuals against formals' bounds
        }
*/
    }
 
源代码25 项目: jdk8u_jdk   文件: ParameterizedTypeImpl.java
private void validateConstructorArguments() {
    TypeVariable<?>[] formals = rawType.getTypeParameters();
    // check correct arity of actual type args
    if (formals.length != actualTypeArguments.length){
        throw new MalformedParameterizedTypeException();
    }
    for (int i = 0; i < actualTypeArguments.length; i++) {
        // check actuals against formals' bounds
    }
}
 
源代码26 项目: jdk8u-jdk   文件: ParameterizedTypeImpl.java
private void validateConstructorArguments() {
    TypeVariable<?>[] formals = rawType.getTypeParameters();
    // check correct arity of actual type args
    if (formals.length != actualTypeArguments.length){
        throw new MalformedParameterizedTypeException();
    }
    for (int i = 0; i < actualTypeArguments.length; i++) {
        // check actuals against formals' bounds
    }
}
 
源代码27 项目: jdk8u-dev-jdk   文件: ParameterizedTypeImpl.java
private void validateConstructorArguments() {
    TypeVariable<?>[] formals = rawType.getTypeParameters();
    // check correct arity of actual type args
    if (formals.length != actualTypeArguments.length){
        throw new MalformedParameterizedTypeException();
    }
    for (int i = 0; i < actualTypeArguments.length; i++) {
        // check actuals against formals' bounds
    }
}
 
源代码28 项目: AutoLoadCache   文件: ParameterizedTypeImpl.java
private void validateConstructorArguments() {
    @SuppressWarnings("rawtypes")
    TypeVariable[] arrayOfTypeVariable = this.rawType.getTypeParameters();

    if (arrayOfTypeVariable.length != this.actualTypeArguments.length) {
        throw new MalformedParameterizedTypeException();
    }
    // for(int i=0; i < this.actualTypeArguments.length; i++);
}
 
/**
 * java.lang.reflect.MalformedParameterizedTypeException#MalformedParameterizedTypeException()
 */
public void test_Constructor() throws Exception {
    Constructor<MalformedParameterizedTypeException> ctor = MalformedParameterizedTypeException.class
            .getDeclaredConstructor();
    assertNotNull("Parameterless constructor does not exist.", ctor);
    assertTrue("Constructor is not protected", Modifier.isPublic(ctor
            .getModifiers()));
    assertNotNull(ctor.newInstance());
}
 
/**
 * java.lang.reflect.MalformedParameterizedTypeException#
 * MalformedParameterizedTypeException()
 */
public void testMalformedParameterizedTypeException() {
    MalformedParameterizedTypeException e = new MalformedParameterizedTypeException();
    assertNotNull(e);
    assertNull(e.getMessage());
}