javax.lang.model.element.QualifiedNameable#java.lang.annotation.AnnotationFormatError源码实例Demo

下面列出了javax.lang.model.element.QualifiedNameable#java.lang.annotation.AnnotationFormatError 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: jdk1.8-source-analysis   文件: Constructor.java
@Override
void handleParameterNumberMismatch(int resultLength, int numParameters) {
    Class<?> declaringClass = getDeclaringClass();
    if (declaringClass.isEnum() ||
        declaringClass.isAnonymousClass() ||
        declaringClass.isLocalClass() )
        return ; // Can't do reliable parameter counting
    else {
        if (!declaringClass.isMemberClass() || // top-level
            // Check for the enclosing instance parameter for
            // non-static member classes
            (declaringClass.isMemberClass() &&
             ((declaringClass.getModifiers() & Modifier.STATIC) == 0)  &&
             resultLength + 1 != numParameters) ) {
            throw new AnnotationFormatError(
                      "Parameter annotations don't match number of parameters");
        }
    }
}
 
源代码2 项目: dragonwell8_jdk   文件: Constructor.java
@Override
void handleParameterNumberMismatch(int resultLength, int numParameters) {
    Class<?> declaringClass = getDeclaringClass();
    if (declaringClass.isEnum() ||
        declaringClass.isAnonymousClass() ||
        declaringClass.isLocalClass() )
        return ; // Can't do reliable parameter counting
    else {
        if (!declaringClass.isMemberClass() || // top-level
            // Check for the enclosing instance parameter for
            // non-static member classes
            (declaringClass.isMemberClass() &&
             ((declaringClass.getModifiers() & Modifier.STATIC) == 0)  &&
             resultLength + 1 != numParameters) ) {
            throw new AnnotationFormatError(
                      "Parameter annotations don't match number of parameters");
        }
    }
}
 
源代码3 项目: dragonwell8_jdk   文件: TypeAnnotation.java
public static LocationInfo parseLocationInfo(ByteBuffer buf) {
    int depth = buf.get() & 0xFF;
    if (depth == 0)
        return BASE_LOCATION;
    Location[] locations = new Location[depth];
    for (int i = 0; i < depth; i++) {
        byte tag = buf.get();
        short index = (short)(buf.get() & 0xFF);
        if (!(tag == 0 || tag == 1 | tag == 2 || tag == 3))
            throw new AnnotationFormatError("Bad Location encoding in Type Annotation");
        if (tag != 3 && index != 0)
            throw new AnnotationFormatError("Bad Location encoding in Type Annotation");
        locations[i] = new Location(tag, index);
    }
    return new LocationInfo(depth, locations);
}
 
源代码4 项目: TencentKona-8   文件: Constructor.java
@Override
void handleParameterNumberMismatch(int resultLength, int numParameters) {
    Class<?> declaringClass = getDeclaringClass();
    if (declaringClass.isEnum() ||
        declaringClass.isAnonymousClass() ||
        declaringClass.isLocalClass() )
        return ; // Can't do reliable parameter counting
    else {
        if (!declaringClass.isMemberClass() || // top-level
            // Check for the enclosing instance parameter for
            // non-static member classes
            (declaringClass.isMemberClass() &&
             ((declaringClass.getModifiers() & Modifier.STATIC) == 0)  &&
             resultLength + 1 != numParameters) ) {
            throw new AnnotationFormatError(
                      "Parameter annotations don't match number of parameters");
        }
    }
}
 
源代码5 项目: TencentKona-8   文件: TypeAnnotation.java
public static LocationInfo parseLocationInfo(ByteBuffer buf) {
    int depth = buf.get() & 0xFF;
    if (depth == 0)
        return BASE_LOCATION;
    Location[] locations = new Location[depth];
    for (int i = 0; i < depth; i++) {
        byte tag = buf.get();
        short index = (short)(buf.get() & 0xFF);
        if (!(tag == 0 || tag == 1 | tag == 2 || tag == 3))
            throw new AnnotationFormatError("Bad Location encoding in Type Annotation");
        if (tag != 3 && index != 0)
            throw new AnnotationFormatError("Bad Location encoding in Type Annotation");
        locations[i] = new Location(tag, index);
    }
    return new LocationInfo(depth, locations);
}
 
源代码6 项目: jdk8u60   文件: Constructor.java
@Override
void handleParameterNumberMismatch(int resultLength, int numParameters) {
    Class<?> declaringClass = getDeclaringClass();
    if (declaringClass.isEnum() ||
        declaringClass.isAnonymousClass() ||
        declaringClass.isLocalClass() )
        return ; // Can't do reliable parameter counting
    else {
        if (!declaringClass.isMemberClass() || // top-level
            // Check for the enclosing instance parameter for
            // non-static member classes
            (declaringClass.isMemberClass() &&
             ((declaringClass.getModifiers() & Modifier.STATIC) == 0)  &&
             resultLength + 1 != numParameters) ) {
            throw new AnnotationFormatError(
                      "Parameter annotations don't match number of parameters");
        }
    }
}
 
源代码7 项目: jdk8u60   文件: TypeAnnotation.java
public static LocationInfo parseLocationInfo(ByteBuffer buf) {
    int depth = buf.get() & 0xFF;
    if (depth == 0)
        return BASE_LOCATION;
    Location[] locations = new Location[depth];
    for (int i = 0; i < depth; i++) {
        byte tag = buf.get();
        short index = (short)(buf.get() & 0xFF);
        if (!(tag == 0 || tag == 1 | tag == 2 || tag == 3))
            throw new AnnotationFormatError("Bad Location encoding in Type Annotation");
        if (tag != 3 && index != 0)
            throw new AnnotationFormatError("Bad Location encoding in Type Annotation");
        locations[i] = new Location(tag, index);
    }
    return new LocationInfo(depth, locations);
}
 
源代码8 项目: JDKSourceCode1.8   文件: Constructor.java
@Override
void handleParameterNumberMismatch(int resultLength, int numParameters) {
    Class<?> declaringClass = getDeclaringClass();
    if (declaringClass.isEnum() ||
        declaringClass.isAnonymousClass() ||
        declaringClass.isLocalClass() )
        return ; // Can't do reliable parameter counting
    else {
        if (!declaringClass.isMemberClass() || // top-level
            // Check for the enclosing instance parameter for
            // non-static member classes
            (declaringClass.isMemberClass() &&
             ((declaringClass.getModifiers() & Modifier.STATIC) == 0)  &&
             resultLength + 1 != numParameters) ) {
            throw new AnnotationFormatError(
                      "Parameter annotations don't match number of parameters");
        }
    }
}
 
源代码9 项目: openjdk-jdk8u   文件: Constructor.java
@Override
void handleParameterNumberMismatch(int resultLength, int numParameters) {
    Class<?> declaringClass = getDeclaringClass();
    if (declaringClass.isEnum() ||
        declaringClass.isAnonymousClass() ||
        declaringClass.isLocalClass() )
        return ; // Can't do reliable parameter counting
    else {
        if (!declaringClass.isMemberClass() || // top-level
            // Check for the enclosing instance parameter for
            // non-static member classes
            (declaringClass.isMemberClass() &&
             ((declaringClass.getModifiers() & Modifier.STATIC) == 0)  &&
             resultLength + 1 != numParameters) ) {
            throw new AnnotationFormatError(
                      "Parameter annotations don't match number of parameters");
        }
    }
}
 
源代码10 项目: openjdk-jdk8u   文件: TypeAnnotation.java
public static LocationInfo parseLocationInfo(ByteBuffer buf) {
    int depth = buf.get() & 0xFF;
    if (depth == 0)
        return BASE_LOCATION;
    Location[] locations = new Location[depth];
    for (int i = 0; i < depth; i++) {
        byte tag = buf.get();
        short index = (short)(buf.get() & 0xFF);
        if (!(tag == 0 || tag == 1 | tag == 2 || tag == 3))
            throw new AnnotationFormatError("Bad Location encoding in Type Annotation");
        if (tag != 3 && index != 0)
            throw new AnnotationFormatError("Bad Location encoding in Type Annotation");
        locations[i] = new Location(tag, index);
    }
    return new LocationInfo(depth, locations);
}
 
源代码11 项目: openjdk-jdk8u-backup   文件: Constructor.java
@Override
void handleParameterNumberMismatch(int resultLength, int numParameters) {
    Class<?> declaringClass = getDeclaringClass();
    if (declaringClass.isEnum() ||
        declaringClass.isAnonymousClass() ||
        declaringClass.isLocalClass() )
        return ; // Can't do reliable parameter counting
    else {
        if (!declaringClass.isMemberClass() || // top-level
            // Check for the enclosing instance parameter for
            // non-static member classes
            (declaringClass.isMemberClass() &&
             ((declaringClass.getModifiers() & Modifier.STATIC) == 0)  &&
             resultLength + 1 != numParameters) ) {
            throw new AnnotationFormatError(
                      "Parameter annotations don't match number of parameters");
        }
    }
}
 
源代码12 项目: openjdk-jdk8u-backup   文件: TypeAnnotation.java
public static LocationInfo parseLocationInfo(ByteBuffer buf) {
    int depth = buf.get() & 0xFF;
    if (depth == 0)
        return BASE_LOCATION;
    Location[] locations = new Location[depth];
    for (int i = 0; i < depth; i++) {
        byte tag = buf.get();
        short index = (short)(buf.get() & 0xFF);
        if (!(tag == 0 || tag == 1 | tag == 2 || tag == 3))
            throw new AnnotationFormatError("Bad Location encoding in Type Annotation");
        if (tag != 3 && index != 0)
            throw new AnnotationFormatError("Bad Location encoding in Type Annotation");
        locations[i] = new Location(tag, index);
    }
    return new LocationInfo(depth, locations);
}
 
源代码13 项目: Bytecoder   文件: Constructor.java
@Override
boolean handleParameterNumberMismatch(int resultLength, int numParameters) {
    Class<?> declaringClass = getDeclaringClass();
    if (declaringClass.isEnum() ||
        declaringClass.isAnonymousClass() ||
        declaringClass.isLocalClass() )
        return false; // Can't do reliable parameter counting
    else {
        if (declaringClass.isMemberClass() &&
            ((declaringClass.getModifiers() & Modifier.STATIC) == 0)  &&
            resultLength + 1 == numParameters) {
            return true;
        } else {
            throw new AnnotationFormatError(
                      "Parameter annotations don't match number of parameters");
        }
    }
}
 
源代码14 项目: Bytecoder   文件: Method.java
/**
 * Returns the default value for the annotation member represented by
 * this {@code Method} instance.  If the member is of a primitive type,
 * an instance of the corresponding wrapper type is returned. Returns
 * null if no default is associated with the member, or if the method
 * instance does not represent a declared member of an annotation type.
 *
 * @return the default value for the annotation member represented
 *     by this {@code Method} instance.
 * @throws TypeNotPresentException if the annotation is of type
 *     {@link Class} and no definition can be found for the
 *     default class value.
 * @since  1.5
 */
public Object getDefaultValue() {
    if  (annotationDefault == null)
        return null;
    Class<?> memberType = AnnotationType.invocationHandlerReturnType(
        getReturnType());
    Object result = AnnotationParser.parseMemberValue(
        memberType, ByteBuffer.wrap(annotationDefault),
        SharedSecrets.getJavaLangAccess().
            getConstantPool(getDeclaringClass()),
        getDeclaringClass());
    if (result instanceof ExceptionProxy) {
        if (result instanceof TypeNotPresentExceptionProxy) {
            TypeNotPresentExceptionProxy proxy = (TypeNotPresentExceptionProxy)result;
            throw new TypeNotPresentException(proxy.typeName(), proxy.getCause());
        }
        throw new AnnotationFormatError("Invalid default: " + this);
    }
    return result;
}
 
源代码15 项目: Bytecoder   文件: TypeAnnotation.java
public static LocationInfo parseLocationInfo(ByteBuffer buf) {
    int depth = buf.get() & 0xFF;
    if (depth == 0)
        return BASE_LOCATION;
    Location[] locations = new Location[depth];
    for (int i = 0; i < depth; i++) {
        byte tag = buf.get();
        short index = (short)(buf.get() & 0xFF);
        if (!(tag == 0 || tag == 1 | tag == 2 || tag == 3))
            throw new AnnotationFormatError("Bad Location encoding in Type Annotation");
        if (tag != 3 && index != 0)
            throw new AnnotationFormatError("Bad Location encoding in Type Annotation");
        locations[i] = new Location(tag, index);
    }
    return new LocationInfo(depth, locations);
}
 
源代码16 项目: openjdk-jdk9   文件: Constructor.java
@Override
boolean handleParameterNumberMismatch(int resultLength, int numParameters) {
    Class<?> declaringClass = getDeclaringClass();
    if (declaringClass.isEnum() ||
        declaringClass.isAnonymousClass() ||
        declaringClass.isLocalClass() )
        return false; // Can't do reliable parameter counting
    else {
        if (declaringClass.isMemberClass() &&
            ((declaringClass.getModifiers() & Modifier.STATIC) == 0)  &&
            resultLength + 1 == numParameters) {
            return true;
        } else {
            throw new AnnotationFormatError(
                      "Parameter annotations don't match number of parameters");
        }
    }
}
 
源代码17 项目: openjdk-jdk9   文件: Method.java
/**
 * Returns the default value for the annotation member represented by
 * this {@code Method} instance.  If the member is of a primitive type,
 * an instance of the corresponding wrapper type is returned. Returns
 * null if no default is associated with the member, or if the method
 * instance does not represent a declared member of an annotation type.
 *
 * @return the default value for the annotation member represented
 *     by this {@code Method} instance.
 * @throws TypeNotPresentException if the annotation is of type
 *     {@link Class} and no definition can be found for the
 *     default class value.
 * @since  1.5
 */
public Object getDefaultValue() {
    if  (annotationDefault == null)
        return null;
    Class<?> memberType = AnnotationType.invocationHandlerReturnType(
        getReturnType());
    Object result = AnnotationParser.parseMemberValue(
        memberType, ByteBuffer.wrap(annotationDefault),
        SharedSecrets.getJavaLangAccess().
            getConstantPool(getDeclaringClass()),
        getDeclaringClass());
    if (result instanceof ExceptionProxy) {
        if (result instanceof TypeNotPresentExceptionProxy) {
            TypeNotPresentExceptionProxy proxy = (TypeNotPresentExceptionProxy)result;
            throw new TypeNotPresentException(proxy.typeName(), proxy.getCause());
        }
        throw new AnnotationFormatError("Invalid default: " + this);
    }
    return result;
}
 
源代码18 项目: openjdk-jdk9   文件: TypeAnnotation.java
public static LocationInfo parseLocationInfo(ByteBuffer buf) {
    int depth = buf.get() & 0xFF;
    if (depth == 0)
        return BASE_LOCATION;
    Location[] locations = new Location[depth];
    for (int i = 0; i < depth; i++) {
        byte tag = buf.get();
        short index = (short)(buf.get() & 0xFF);
        if (!(tag == 0 || tag == 1 | tag == 2 || tag == 3))
            throw new AnnotationFormatError("Bad Location encoding in Type Annotation");
        if (tag != 3 && index != 0)
            throw new AnnotationFormatError("Bad Location encoding in Type Annotation");
        locations[i] = new Location(tag, index);
    }
    return new LocationInfo(depth, locations);
}
 
源代码19 项目: jdk8u-jdk   文件: Constructor.java
@Override
void handleParameterNumberMismatch(int resultLength, int numParameters) {
    Class<?> declaringClass = getDeclaringClass();
    if (declaringClass.isEnum() ||
        declaringClass.isAnonymousClass() ||
        declaringClass.isLocalClass() )
        return ; // Can't do reliable parameter counting
    else {
        if (!declaringClass.isMemberClass() || // top-level
            // Check for the enclosing instance parameter for
            // non-static member classes
            (declaringClass.isMemberClass() &&
             ((declaringClass.getModifiers() & Modifier.STATIC) == 0)  &&
             resultLength + 1 != numParameters) ) {
            throw new AnnotationFormatError(
                      "Parameter annotations don't match number of parameters");
        }
    }
}
 
源代码20 项目: jdk8u-jdk   文件: TypeAnnotation.java
public static LocationInfo parseLocationInfo(ByteBuffer buf) {
    int depth = buf.get() & 0xFF;
    if (depth == 0)
        return BASE_LOCATION;
    Location[] locations = new Location[depth];
    for (int i = 0; i < depth; i++) {
        byte tag = buf.get();
        short index = (short)(buf.get() & 0xFF);
        if (!(tag == 0 || tag == 1 | tag == 2 || tag == 3))
            throw new AnnotationFormatError("Bad Location encoding in Type Annotation");
        if (tag != 3 && index != 0)
            throw new AnnotationFormatError("Bad Location encoding in Type Annotation");
        locations[i] = new Location(tag, index);
    }
    return new LocationInfo(depth, locations);
}
 
源代码21 项目: Java8CN   文件: Constructor.java
@Override
void handleParameterNumberMismatch(int resultLength, int numParameters) {
    Class<?> declaringClass = getDeclaringClass();
    if (declaringClass.isEnum() ||
        declaringClass.isAnonymousClass() ||
        declaringClass.isLocalClass() )
        return ; // Can't do reliable parameter counting
    else {
        if (!declaringClass.isMemberClass() || // top-level
            // Check for the enclosing instance parameter for
            // non-static member classes
            (declaringClass.isMemberClass() &&
             ((declaringClass.getModifiers() & Modifier.STATIC) == 0)  &&
             resultLength + 1 != numParameters) ) {
            throw new AnnotationFormatError(
                      "Parameter annotations don't match number of parameters");
        }
    }
}
 
源代码22 项目: hottub   文件: Constructor.java
@Override
void handleParameterNumberMismatch(int resultLength, int numParameters) {
    Class<?> declaringClass = getDeclaringClass();
    if (declaringClass.isEnum() ||
        declaringClass.isAnonymousClass() ||
        declaringClass.isLocalClass() )
        return ; // Can't do reliable parameter counting
    else {
        if (!declaringClass.isMemberClass() || // top-level
            // Check for the enclosing instance parameter for
            // non-static member classes
            (declaringClass.isMemberClass() &&
             ((declaringClass.getModifiers() & Modifier.STATIC) == 0)  &&
             resultLength + 1 != numParameters) ) {
            throw new AnnotationFormatError(
                      "Parameter annotations don't match number of parameters");
        }
    }
}
 
源代码23 项目: hottub   文件: TypeAnnotation.java
public static LocationInfo parseLocationInfo(ByteBuffer buf) {
    int depth = buf.get() & 0xFF;
    if (depth == 0)
        return BASE_LOCATION;
    Location[] locations = new Location[depth];
    for (int i = 0; i < depth; i++) {
        byte tag = buf.get();
        short index = (short)(buf.get() & 0xFF);
        if (!(tag == 0 || tag == 1 | tag == 2 || tag == 3))
            throw new AnnotationFormatError("Bad Location encoding in Type Annotation");
        if (tag != 3 && index != 0)
            throw new AnnotationFormatError("Bad Location encoding in Type Annotation");
        locations[i] = new Location(tag, index);
    }
    return new LocationInfo(depth, locations);
}
 
源代码24 项目: openjdk-8-source   文件: Constructor.java
@Override
void handleParameterNumberMismatch(int resultLength, int numParameters) {
    Class<?> declaringClass = getDeclaringClass();
    if (declaringClass.isEnum() ||
        declaringClass.isAnonymousClass() ||
        declaringClass.isLocalClass() )
        return ; // Can't do reliable parameter counting
    else {
        if (!declaringClass.isMemberClass() || // top-level
            // Check for the enclosing instance parameter for
            // non-static member classes
            (declaringClass.isMemberClass() &&
             ((declaringClass.getModifiers() & Modifier.STATIC) == 0)  &&
             resultLength + 1 != numParameters) ) {
            throw new AnnotationFormatError(
                      "Parameter annotations don't match number of parameters");
        }
    }
}
 
源代码25 项目: openjdk-8-source   文件: TypeAnnotation.java
public static LocationInfo parseLocationInfo(ByteBuffer buf) {
    int depth = buf.get() & 0xFF;
    if (depth == 0)
        return BASE_LOCATION;
    Location[] locations = new Location[depth];
    for (int i = 0; i < depth; i++) {
        byte tag = buf.get();
        short index = (short)(buf.get() & 0xFF);
        if (!(tag == 0 || tag == 1 | tag == 2 || tag == 3))
            throw new AnnotationFormatError("Bad Location encoding in Type Annotation");
        if (tag != 3 && index != 0)
            throw new AnnotationFormatError("Bad Location encoding in Type Annotation");
        locations[i] = new Location(tag, index);
    }
    return new LocationInfo(depth, locations);
}
 
源代码26 项目: openjdk-8   文件: Constructor.java
@Override
void handleParameterNumberMismatch(int resultLength, int numParameters) {
    Class<?> declaringClass = getDeclaringClass();
    if (declaringClass.isEnum() ||
        declaringClass.isAnonymousClass() ||
        declaringClass.isLocalClass() )
        return ; // Can't do reliable parameter counting
    else {
        if (!declaringClass.isMemberClass() || // top-level
            // Check for the enclosing instance parameter for
            // non-static member classes
            (declaringClass.isMemberClass() &&
             ((declaringClass.getModifiers() & Modifier.STATIC) == 0)  &&
             resultLength + 1 != numParameters) ) {
            throw new AnnotationFormatError(
                      "Parameter annotations don't match number of parameters");
        }
    }
}
 
源代码27 项目: openjdk-8   文件: TypeAnnotation.java
public static LocationInfo parseLocationInfo(ByteBuffer buf) {
    int depth = buf.get() & 0xFF;
    if (depth == 0)
        return BASE_LOCATION;
    Location[] locations = new Location[depth];
    for (int i = 0; i < depth; i++) {
        byte tag = buf.get();
        short index = (short)(buf.get() & 0xFF);
        if (!(tag == 0 || tag == 1 | tag == 2 || tag == 3))
            throw new AnnotationFormatError("Bad Location encoding in Type Annotation");
        if (tag != 3 && index != 0)
            throw new AnnotationFormatError("Bad Location encoding in Type Annotation");
        locations[i] = new Location(tag, index);
    }
    return new LocationInfo(depth, locations);
}
 
源代码28 项目: jdk8u_jdk   文件: Constructor.java
@Override
void handleParameterNumberMismatch(int resultLength, int numParameters) {
    Class<?> declaringClass = getDeclaringClass();
    if (declaringClass.isEnum() ||
        declaringClass.isAnonymousClass() ||
        declaringClass.isLocalClass() )
        return ; // Can't do reliable parameter counting
    else {
        if (!declaringClass.isMemberClass() || // top-level
            // Check for the enclosing instance parameter for
            // non-static member classes
            (declaringClass.isMemberClass() &&
             ((declaringClass.getModifiers() & Modifier.STATIC) == 0)  &&
             resultLength + 1 != numParameters) ) {
            throw new AnnotationFormatError(
                      "Parameter annotations don't match number of parameters");
        }
    }
}
 
源代码29 项目: jdk8u_jdk   文件: TypeAnnotation.java
public static LocationInfo parseLocationInfo(ByteBuffer buf) {
    int depth = buf.get() & 0xFF;
    if (depth == 0)
        return BASE_LOCATION;
    Location[] locations = new Location[depth];
    for (int i = 0; i < depth; i++) {
        byte tag = buf.get();
        short index = (short)(buf.get() & 0xFF);
        if (!(tag == 0 || tag == 1 | tag == 2 || tag == 3))
            throw new AnnotationFormatError("Bad Location encoding in Type Annotation");
        if (tag != 3 && index != 0)
            throw new AnnotationFormatError("Bad Location encoding in Type Annotation");
        locations[i] = new Location(tag, index);
    }
    return new LocationInfo(depth, locations);
}
 
源代码30 项目: jdk8u-jdk   文件: Constructor.java
@Override
void handleParameterNumberMismatch(int resultLength, int numParameters) {
    Class<?> declaringClass = getDeclaringClass();
    if (declaringClass.isEnum() ||
        declaringClass.isAnonymousClass() ||
        declaringClass.isLocalClass() )
        return ; // Can't do reliable parameter counting
    else {
        if (!declaringClass.isMemberClass() || // top-level
            // Check for the enclosing instance parameter for
            // non-static member classes
            (declaringClass.isMemberClass() &&
             ((declaringClass.getModifiers() & Modifier.STATIC) == 0)  &&
             resultLength + 1 != numParameters) ) {
            throw new AnnotationFormatError(
                      "Parameter annotations don't match number of parameters");
        }
    }
}