Java 类java.lang.reflect.GenericSignatureFormatError 实例源码

项目:r8    文件:GenericSignatureParser.java   
private void parseFieldTypeSignature() {
  // FieldTypeSignature ::= ClassTypeSignature | ArrayTypeSignature | TypeVariableSignature.
  switch (symbol) {
    case 'L':
      parseClassTypeSignature();
      break;
    case '[':
      // ArrayTypeSignature ::= "[" TypSignature.
      actions.parsedSymbol(symbol);
      scanSymbol();
      updateTypeSignature();
      break;
    case 'T':
      updateTypeVariableSignature();
      break;
    default:
      throw new GenericSignatureFormatError();
  }
}
项目:j2objc    文件:GenericSignatureParser.java   
Type parseFieldTypeSignature() {
    // FieldTypeSignature ::= ClassTypeSignature | ArrayTypeSignature
    //         | TypeVariableSignature.

    switch (symbol) {
    case 'L':
        return parseClassTypeSignature();
    case '[':
        // ArrayTypeSignature ::= "[" TypSignature.
        scanSymbol();
        return new GenericArrayTypeImpl(parseTypeSignature());
    case 'T':
        return parseTypeVariableSignature();
    default:
        throw new GenericSignatureFormatError();
    }
}
项目:In-the-Box-Fork    文件:GenericSignatureParser.java   
Type parseFieldTypeSignature() {
    // FieldTypeSignature ::= ClassTypeSignature | ArrayTypeSignature
    //         | TypeVariableSignature.

    switch (symbol) {
    case 'L':
        return parseClassTypeSignature();
    case '[':
        // ArrayTypeSignature ::= "[" TypSignature.
        scanSymbol();
        return new ImplForArray(parseTypeSignature());
    case 'T':
        return parseTypeVariableSignature();
    default:
        throw new GenericSignatureFormatError();
    }
}
项目:cn1    文件:Class.java   
public Type getGenericSuperclass() throws GenericSignatureFormatError, TypeNotPresentException, MalformedParameterizedTypeException  {
    String tmp;
    if (isInterface() || ((tmp = getCanonicalName()) != null && tmp.equals("java.lang.Object")) || isPrimitive()) {
        return null;
    }
    if (isArray()) {
        return (Type) OBJECT_CLASS;
    }

    Class<?> clazz = getSuperclass();
    if (clazz.getTypeParameters().length == 0) {
        return (Type) clazz;
    }

    return getCache().getGenericSuperclass();
}
项目:cn1    文件:GenericSignatureParser.java   
Type parseFieldTypeSignature() {
    // FieldTypeSignature ::= ClassTypeSignature | ArrayTypeSignature
    //         | TypeVariableSignature.

    switch (symbol) {
    case 'L':
        return parseClassTypeSignature();
    case '[':
        // ArrayTypeSignature ::= "[" TypSignature.
        scanSymbol();
        return new ImplForArray(parseTypeSignature());
    case 'T':
        return parseTypeVariableSignature();
    default:
        throw new GenericSignatureFormatError();
    }
}
项目:freeVM    文件:Class.java   
public Type getGenericSuperclass() throws GenericSignatureFormatError, TypeNotPresentException, MalformedParameterizedTypeException  {
    String tmp;
    if (isInterface() || ((tmp = getCanonicalName()) != null && tmp.equals("java.lang.Object")) || isPrimitive()) {
        return null;
    }
    if (isArray()) {
        return (Type) OBJECT_CLASS;
    }

    Class<?> clazz = getSuperclass();
    if (clazz.getTypeParameters().length == 0) {
        return (Type) clazz;
    }

    return getCache().getGenericSuperclass();
}
项目:r8    文件:GenericSignatureParser.java   
private void expect(char c) {
  if (symbol == c) {
    scanSymbol();
  } else {
    throw new GenericSignatureFormatError();
  }
}
项目:leopard    文件:ErrorUtilTest.java   
@Test
public void parseMessage() {
    // Assert.assertEquals("操作数据库出错,请稍后重试.", ErrorUtil.parseMessage(new InvalidParamDataAccessException("message")));
    Assert.assertEquals("操作数据库出错,请稍后重试.", ErrorUtil.parseMessage(new SQLException("message")));
    // Assert.assertEquals("操作数据库出错,请稍后重试.", ErrorUtil.parseMessage(new JedisConnectionException("message")));
    // Assert.assertEquals("访问外部接口出错,请稍后重试.", ErrorUtil.parseMessage(new OutSideException("message")));
    Assert.assertEquals("更新程序后,还没有重启服务.", ErrorUtil.parseMessage(new GenericSignatureFormatError()));

    Assert.assertEquals("message", ErrorUtil.parseMessage(new IllegalArgumentException("message")));
    // Assert.assertEquals("message", ErrorUtil.parseMessage(new LeopardRuntimeException("message")));
    // Assert.assertEquals("message", ErrorUtil.parseMessage(new LeopardException("message")));
    Assert.assertEquals("message", ErrorUtil.parseMessage(new RuntimeException("message")));
    Assert.assertEquals("未知错误.", ErrorUtil.parseMessage(new Exception("message")));
}
项目:javify    文件:GenericSignatureParser.java   
Type readFieldTypeSignature()
{
    switch (peekChar())
    {
        case 'L':
            return readClassTypeSignature();
        case '[':
            return readArrayTypeSignature();
        case 'T':
            return readTypeVariableSignature();
        default:
            throw new GenericSignatureFormatError();
    }
}
项目:javify    文件:GenericSignatureParser.java   
Type readArrayTypeSignature()
{
    consume('[');
    switch (peekChar())
    {
        case 'L':
        case '[':
        case 'T':
            return new GenericArrayTypeImpl(readFieldTypeSignature());
        case 'Z':
            consume('Z');
            return boolean[].class;
        case 'B':
            consume('B');
            return byte[].class;
        case 'S':
            consume('S');
            return short[].class;
        case 'C':
            consume('C');
            return char[].class;
        case 'I':
            consume('I');
            return int[].class;
        case 'F':
            consume('F');
            return float[].class;
        case 'J':
            consume('J');
            return long[].class;
        case 'D':
            consume('D');
            return double[].class;
        default:
            throw new GenericSignatureFormatError();
    }
}
项目:jvm-stm    文件:GenericSignatureParser.java   
Type readFieldTypeSignature()
{
    switch (peekChar())
    {
        case 'L':
            return readClassTypeSignature();
        case '[':
            return readArrayTypeSignature();
        case 'T':
            return readTypeVariableSignature();
        default:
            throw new GenericSignatureFormatError();
    }
}
项目:jvm-stm    文件:GenericSignatureParser.java   
Type readArrayTypeSignature()
{
    consume('[');
    switch (peekChar())
    {
        case 'L':
        case '[':
        case 'T':
            return new GenericArrayTypeImpl(readFieldTypeSignature());
        case 'Z':
            consume('Z');
            return boolean[].class;
        case 'B':
            consume('B');
            return byte[].class;
        case 'S':
            consume('S');
            return short[].class;
        case 'C':
            consume('C');
            return char[].class;
        case 'I':
            consume('I');
            return int[].class;
        case 'F':
            consume('F');
            return float[].class;
        case 'J':
            consume('J');
            return long[].class;
        case 'D':
            consume('D');
            return double[].class;
        default:
            throw new GenericSignatureFormatError();
    }
}
项目:j2objc    文件:GenericSignatureParser.java   
void scanSymbol() {
    if (!eof) {
        if (pos < buffer.length) {
            symbol = buffer[pos];
            pos++;
        } else {
            symbol = 0;
            eof = true;
        }
    } else {
        throw new GenericSignatureFormatError();
    }
}
项目:j2objc    文件:GenericSignatureParser.java   
void expect(char c) {
    if (symbol == c) {
        scanSymbol();
    } else {
        throw new GenericSignatureFormatError();
    }
}
项目:j2objc    文件:GenericSignatureParser.java   
void scanIdentifier() {
    if (!eof) {
        StringBuilder identBuf = new StringBuilder(32);
        if (!isStopSymbol(symbol)) {
            identBuf.append(symbol);
            do {
                char ch = buffer[pos];
                if ((ch >= 'a') && (ch <= 'z') || (ch >= 'A') && (ch <= 'Z')
                        || !isStopSymbol(ch)) {
                    identBuf.append(ch);
                    pos++;
                } else {
                    identifier = identBuf.toString();
                    scanSymbol();
                    return;
                }
            } while (pos != buffer.length);
            identifier = identBuf.toString();
            symbol = 0;
            eof = true;
        } else {
            // Ident starts with incorrect char.
            symbol = 0;
            eof = true;
            throw new GenericSignatureFormatError();
        }
    } else {
        throw new GenericSignatureFormatError();
    }
}
项目:In-the-Box-Fork    文件:GenericSignatureParser.java   
void scanSymbol() {
    if (!eof) {
        if (pos < buffer.length) {
            symbol = buffer[pos];
            pos++;
        } else {
            symbol = 0;
            eof = true;
        }
    } else {
        throw new GenericSignatureFormatError();
    }
}
项目:In-the-Box-Fork    文件:GenericSignatureParser.java   
void expect(char c) {
    if (symbol == c) {
        scanSymbol();
    } else {
        throw new GenericSignatureFormatError();
    }
}
项目:In-the-Box-Fork    文件:GenericSignatureParser.java   
void scanIdentifier() {
    if (!eof) {
        StringBuilder identBuf = new StringBuilder(32);
        if (!isStopSymbol(symbol)) {
            identBuf.append(symbol);
            do {
                char ch = buffer[pos];
                if ((ch >= 'a') && (ch <= 'z') || (ch >= 'A') && (ch <= 'Z')
                        || !isStopSymbol(ch)) {
                    identBuf.append(buffer[pos]);
                    pos++;
                } else {
                    identifier = identBuf.toString();
                    scanSymbol();
                    return;
                }
            } while (pos != buffer.length);
            identifier = identBuf.toString();
            symbol = 0;
            eof = true;
        } else {
            // Ident starts with incorrect char.
            symbol = 0;
            eof = true;
            throw new GenericSignatureFormatError();
        }
    } else {
        throw new GenericSignatureFormatError();
    }
}
项目:In-the-Box-Fork    文件:GenericSignatureFormatErrorTest.java   
@TestTargetNew(
    level = TestLevel.PARTIAL_COMPLETE,
    notes = "",
    method = "GenericSignatureFormatError",
    args = {}
)
public void test_Constructor() {
    assertNotNull(new GenericSignatureFormatError());
}
项目:cn1    文件:Class.java   
public Type[] getGenericInterfaces() throws GenericSignatureFormatError, TypeNotPresentException, MalformedParameterizedTypeException {
    if (isArray()) {
        return new Type[]{CLONEABLE_CLASS, SERIALIZABLE_CLASS};
    }
    if (isPrimitive()) {
        return new Type[0];
    }

    return (Type[])getCache().getGenericInterfaces().clone();
}
项目:cn1    文件:GenericSignatureFormatErrorTest.java   
/**
 * @tests java.lang.reflect.GenericSignatureFormatError#
 *        GenericSignatureFormatError()
 */
@Test
public void test_GenericSignatureFormatError() {
    GenericSignatureFormatError e = new GenericSignatureFormatError();
    assertNotNull(e);
    assertNull(e.getMessage());
}
项目:cn1    文件:GenericSignatureParser.java   
void scanSymbol() {
    if (!eof) {
        if (pos < buffer.length) {
            symbol = buffer[pos];
            pos++;
        } else {
            symbol = 0;
            eof = true;
        }
    } else {
        throw new GenericSignatureFormatError();
    }
}
项目:cn1    文件:GenericSignatureParser.java   
void expect(char c) {
    if (symbol == c) {
        scanSymbol();
    } else {
        throw new GenericSignatureFormatError();
    }
}
项目:cn1    文件:GenericSignatureParser.java   
void scanIdentifier() {
    if (!eof) {
        StringBuilder identBuf = new StringBuilder(32);
        if (!isStopSymbol(symbol)) {
            identBuf.append(symbol);
            do {
                char ch = buffer[pos];
                if ((ch >= 'a') && (ch <= 'z') || (ch >= 'A') && (ch <= 'Z')
                        || !isStopSymbol(ch)) {
                    identBuf.append(buffer[pos]);
                    pos++;
                } else {
                    identifier = identBuf.toString();
                    scanSymbol();
                    return;
                }
            } while (pos != buffer.length);
            identifier = identBuf.toString();
            symbol = 0;
            eof = true;
        } else {
            // Ident starts with incorrect char.
            symbol = 0;
            eof = true;
            throw new GenericSignatureFormatError();
        }
    } else {
        throw new GenericSignatureFormatError();
    }
}
项目:JamVM-PH    文件:GenericSignatureParser.java   
Type readFieldTypeSignature()
{
    switch (peekChar())
    {
        case 'L':
            return readClassTypeSignature();
        case '[':
            return readArrayTypeSignature();
        case 'T':
            return readTypeVariableSignature();
        default:
            throw new GenericSignatureFormatError();
    }
}
项目:JamVM-PH    文件:GenericSignatureParser.java   
Type readArrayTypeSignature()
{
    consume('[');
    switch (peekChar())
    {
        case 'L':
        case '[':
        case 'T':
            return new GenericArrayTypeImpl(readFieldTypeSignature());
        case 'Z':
            consume('Z');
            return boolean[].class;
        case 'B':
            consume('B');
            return byte[].class;
        case 'S':
            consume('S');
            return short[].class;
        case 'C':
            consume('C');
            return char[].class;
        case 'I':
            consume('I');
            return int[].class;
        case 'F':
            consume('F');
            return float[].class;
        case 'J':
            consume('J');
            return long[].class;
        case 'D':
            consume('D');
            return double[].class;
        default:
            throw new GenericSignatureFormatError();
    }
}
项目:classpath    文件:GenericSignatureParser.java   
Type readFieldTypeSignature()
{
    switch (peekChar())
    {
        case 'L':
            return readClassTypeSignature();
        case '[':
            return readArrayTypeSignature();
        case 'T':
            return readTypeVariableSignature();
        default:
            throw new GenericSignatureFormatError();
    }
}
项目:classpath    文件:GenericSignatureParser.java   
Type readArrayTypeSignature()
{
    consume('[');
    switch (peekChar())
    {
        case 'L':
        case '[':
        case 'T':
            return new GenericArrayTypeImpl(readFieldTypeSignature());
        case 'Z':
            consume('Z');
            return boolean[].class;
        case 'B':
            consume('B');
            return byte[].class;
        case 'S':
            consume('S');
            return short[].class;
        case 'C':
            consume('C');
            return char[].class;
        case 'I':
            consume('I');
            return int[].class;
        case 'F':
            consume('F');
            return float[].class;
        case 'J':
            consume('J');
            return long[].class;
        case 'D':
            consume('D');
            return double[].class;
        default:
            throw new GenericSignatureFormatError();
    }
}
项目:freeVM    文件:Class.java   
public Type[] getGenericInterfaces() throws GenericSignatureFormatError, TypeNotPresentException, MalformedParameterizedTypeException {
    if (isArray()) {
        return new Type[]{CLONEABLE_CLASS, SERIALIZABLE_CLASS};
    }
    if (isPrimitive()) {
        return new Type[0];
    }

    return (Type[])getCache().getGenericInterfaces().clone();
}
项目:freeVM    文件:GenericSignatureFormatErrorTest.java   
/**
 * @tests java.lang.reflect.GenericSignatureFormatError#
 *        GenericSignatureFormatError()
 */
@Test
public void test_GenericSignatureFormatError() {
    GenericSignatureFormatError e = new GenericSignatureFormatError();
    assertNotNull(e);
    assertNull(e.getMessage());
}
项目:byte-buddy    文件:TypePool.java   
@Override
public TypeList.Generic resolveTypeVariables(TypePool typePool,
                                             TypeVariableSource typeVariableSource,
                                             Map<Integer, Map<String, List<AnnotationToken>>> annotationTokens,
                                             Map<Integer, Map<Integer, Map<String, List<AnnotationToken>>>> boundAnnotationTokens) {
    throw new GenericSignatureFormatError();
}
项目:byte-buddy    文件:FieldDescription.java   
@Override
public String getGenericSignature() {
    TypeDescription.Generic fieldType = getType();
    try {
        return fieldType.getSort().isNonGeneric()
                ? NON_GENERIC_SIGNATURE
                : fieldType.accept(new TypeDescription.Generic.Visitor.ForSignatureVisitor(new SignatureWriter())).toString();
    } catch (GenericSignatureFormatError ignored) {
        return NON_GENERIC_SIGNATURE;
    }
}
项目:byte-buddy    文件:MethodDescription.java   
@Override
public String getGenericSignature() {
    try {
        SignatureWriter signatureWriter = new SignatureWriter();
        boolean generic = false;
        for (TypeDescription.Generic typeVariable : getTypeVariables()) {
            signatureWriter.visitFormalTypeParameter(typeVariable.getSymbol());
            boolean classBound = true;
            for (TypeDescription.Generic upperBound : typeVariable.getUpperBounds()) {
                upperBound.accept(new TypeDescription.Generic.Visitor.ForSignatureVisitor(classBound
                        ? signatureWriter.visitClassBound()
                        : signatureWriter.visitInterfaceBound()));
                classBound = false;
            }
            generic = true;
        }
        for (TypeDescription.Generic parameterType : getParameters().asTypeList()) {
            parameterType.accept(new TypeDescription.Generic.Visitor.ForSignatureVisitor(signatureWriter.visitParameterType()));
            generic = generic || !parameterType.getSort().isNonGeneric();
        }
        TypeDescription.Generic returnType = getReturnType();
        returnType.accept(new TypeDescription.Generic.Visitor.ForSignatureVisitor(signatureWriter.visitReturnType()));
        generic = generic || !returnType.getSort().isNonGeneric();
        TypeList.Generic exceptionTypes = getExceptionTypes();
        if (!exceptionTypes.filter(not(ofSort(TypeDefinition.Sort.NON_GENERIC))).isEmpty()) {
            for (TypeDescription.Generic exceptionType : exceptionTypes) {
                exceptionType.accept(new TypeDescription.Generic.Visitor.ForSignatureVisitor(signatureWriter.visitExceptionType()));
                generic = generic || !exceptionType.getSort().isNonGeneric();
            }
        }
        return generic
                ? signatureWriter.toString()
                : NON_GENERIC_SIGNATURE;
    } catch (GenericSignatureFormatError ignored) {
        return NON_GENERIC_SIGNATURE;
    }
}
项目:javaide    文件:SignatureParser.java   
private Error error(String errorMsg) {
    if (DEBUG) System.out.println("Parse error:" + errorMsg);
    return new GenericSignatureFormatError();
}
项目:OpenJSharp    文件:SignatureParser.java   
private Error error(String errorMsg) {
    return new GenericSignatureFormatError("Signature Parse error: " + errorMsg +
                                           "\n\tRemaining input: " + remainder());
}
项目:OpenJSharp    文件:AnnotationAttributeBase.java   
private static Class classFromSig(ClassLoader loader, String name)
{
    if (name.length() == 1)
    {
        switch (name.charAt(0))
        {
            case 'Z':
                return Boolean.TYPE;
            case 'B':
                return Byte.TYPE;
            case 'C':
                return Character.TYPE;
            case 'S':
                return Short.TYPE;
            case 'I':
                return Integer.TYPE;
            case 'F':
                return Float.TYPE;
            case 'J':
                return Long.TYPE;
            case 'D':
                return Double.TYPE;
            case 'V':
                return Void.TYPE;
            default:
                throw new GenericSignatureFormatError();
        }
    }

    if (!isValidTypeSig(name, 0, name.length()))
    {
        throw new GenericSignatureFormatError();
    }

    if (name.charAt(0) == 'L')
    {
        name = name.substring(1, name.length() - 1).replace('/', '.');
    }
    else // must be an array then
    {
        name = name.replace('/', '.');
    }
    try
    {
        return Class.forName(name, false, loader);
    }
    catch (ClassNotFoundException x)
    {
        throw new TypeNotPresentException(name, x);
    }
}
项目:jdk8u-jdk    文件:SignatureParser.java   
private Error error(String errorMsg) {
    return new GenericSignatureFormatError("Signature Parse error: " + errorMsg +
                                           "\n\tRemaining input: " + remainder());
}
项目:openjdk-jdk10    文件:SignatureParser.java   
private Error error(String errorMsg) {
    return new GenericSignatureFormatError("Signature Parse error: " + errorMsg +
                                           "\n\tRemaining input: " + remainder());
}
项目:openjdk9    文件:SignatureParser.java   
private Error error(String errorMsg) {
    return new GenericSignatureFormatError("Signature Parse error: " + errorMsg +
                                           "\n\tRemaining input: " + remainder());
}
项目:leopard    文件:ErrorUtil.java   
/**
 * 获取异常信息.
 * 
 * @param e
 * @return
 */
public static String parseMessage(Throwable e) {
    if (e == null) {
        throw new IllegalArgumentException("exception不能为空?");
    }

    String className = e.getClass().getName();

    String message = MESSAGE_MAP.get(className);
    if (message != null) {
        return message;
    }
    if (e instanceof GenericSignatureFormatError) {
        printStartupTime();
        return "更新程序后,还没有重启服务.";
    }
    if (e instanceof NoSuchMethodError) {
        printStartupTime();
        return "NoSuchMethodError:方法找不到.";
    }
    if (e instanceof SQLException) {
        return "操作数据库出错,请稍后重试.";
    }
    if (e instanceof DataIntegrityViolationException) {
        Exception exception = (Exception) e.getCause();
        if (exception instanceof MysqlDataTruncation) {
            return MessageParserImpl.parse((MysqlDataTruncation) exception);
        }
        else {
            return "操作数据库出错,请稍后重试.";
        }
        // try {
        // return parseDataIntegrityViolationException((DataIntegrityViolationException) e);
        // }
        // catch (Exception e1) {
        // e1.printStackTrace();
        // return "字段太长,请稍后重试.";
        // }

    }
    message = e.getMessage();
    if (message == null) {
        return null;
    }
    return fillterDebugInfo(message);
}