/** * Checks a reference type signature. * * @param signature a string containing the signature that must be checked. * @param pos index of first character to be checked. * @return the index of the first character after the checked part. */ private static int checkReferenceTypeSignature(final String signature, final int pos) { // From https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.9.1: // ReferenceTypeSignature: // ClassTypeSignature // TypeVariableSignature // ArrayTypeSignature // ArrayTypeSignature: // [ JavaTypeSignature switch (getChar(signature, pos)) { case 'L': return checkClassTypeSignature(signature, pos); case '[': return checkJavaTypeSignature(signature, pos + 1); default: return checkTypeVariableSignature(signature, pos); } }
/** * Checks a field type signature. * * @param signature * a string containing the signature that must be checked. * @param pos * index of first character to be checked. * @return the index of the first character after the checked part. */ private static int checkFieldTypeSignature(final String signature, int pos) { // FieldTypeSignature: // ClassTypeSignature | ArrayTypeSignature | TypeVariableSignature // // ArrayTypeSignature: // [ TypeSignature switch (getChar(signature, pos)) { case 'L': return checkClassTypeSignature(signature, pos); case '[': return checkTypeSignature(signature, pos + 1); default: return checkTypeVariableSignature(signature, pos); } }
/** * Checks a reference type signature. * * @param signature a string containing the signature that must be checked. * @param pos index of first character to be checked. * @return the index of the first character after the checked part. */ private static int checkReferenceTypeSignature(final String signature, final int pos) { // From https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.9.1: // ReferenceTypeSignature: // ClassTypeSignature // TypeVariableSignature // ArrayTypeSignature // ArrayTypeSignature: // [ JavaTypeSignature switch (getChar(signature, pos)) { case 'L': return checkClassTypeSignature(signature, pos); case '[': return checkJavaTypeSignature(signature, pos + 1); default: return checkTypeVariableSignature(signature, pos); } }
pos = checkClassTypeSignature(signature, pos); } else { pos = checkTypeVariableSignature(signature, pos);
pos = checkClassTypeSignature(signature, pos); } else { pos = checkTypeVariableSignature(signature, pos);
pos = checkClassTypeSignature(signature, pos); } else { pos = checkTypeVariableSignature(signature, pos);