/** * Checks a type variable signature. * * @param signature a string containing the signature that must be checked. * @param startPos index of first character to be checked. * @return the index of the first character after the checked part. */ private static int checkTypeVariableSignature(final String signature, final int startPos) { // From https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.9.1: // TypeVariableSignature: // T Identifier ; int pos = startPos; pos = checkChar('T', signature, pos); pos = checkSignatureIdentifier(signature, pos); return checkChar(';', signature, pos); }
/** * Checks a type variable signature. * * @param signature a string containing the signature that must be checked. * @param startPos index of first character to be checked. * @return the index of the first character after the checked part. */ private static int checkTypeVariableSignature(final String signature, final int startPos) { // From https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.9.1: // TypeVariableSignature: // T Identifier ; int pos = startPos; pos = checkChar('T', signature, pos); pos = checkSignatureIdentifier(signature, pos); return checkChar(';', signature, pos); }
pos = checkSignatureIdentifier(signature, pos); while (getChar(signature, pos) == '/') { pos = checkSignatureIdentifier(signature, pos + 1); pos = checkSignatureIdentifier(signature, pos + 1); if (getChar(signature, pos) == '<') { pos = checkTypeArguments(signature, pos);
pos = checkSignatureIdentifier(signature, pos); while (getChar(signature, pos) == '/') { pos = checkSignatureIdentifier(signature, pos + 1); pos = checkSignatureIdentifier(signature, pos + 1); if (getChar(signature, pos) == '<') { pos = checkTypeArguments(signature, pos);
/** * Checks a type parameter of a class or method signature. * * @param signature a string containing the signature that must be checked. * @param startPos index of first character to be checked. * @return the index of the first character after the checked part. */ private static int checkTypeParameter(final String signature, final int startPos) { // From https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.9.1: // TypeParameter: // Identifier ClassBound InterfaceBound* // ClassBound: // : [ReferenceTypeSignature] // InterfaceBound: // : ReferenceTypeSignature int pos = startPos; pos = checkSignatureIdentifier(signature, pos); pos = checkChar(':', signature, pos); if ("L[T".indexOf(getChar(signature, pos)) != -1) { pos = checkReferenceTypeSignature(signature, pos); } while (getChar(signature, pos) == ':') { pos = checkReferenceTypeSignature(signature, pos + 1); } return pos; }
/** * Checks a type parameter of a class or method signature. * * @param signature a string containing the signature that must be checked. * @param startPos index of first character to be checked. * @return the index of the first character after the checked part. */ private static int checkTypeParameter(final String signature, final int startPos) { // From https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.9.1: // TypeParameter: // Identifier ClassBound InterfaceBound* // ClassBound: // : [ReferenceTypeSignature] // InterfaceBound: // : ReferenceTypeSignature int pos = startPos; pos = checkSignatureIdentifier(signature, pos); pos = checkChar(':', signature, pos); if ("L[T".indexOf(getChar(signature, pos)) != -1) { pos = checkReferenceTypeSignature(signature, pos); } while (getChar(signature, pos) == ':') { pos = checkReferenceTypeSignature(signature, pos + 1); } return pos; }