668 throw new IllegalArgumentException(
669 "final and abstract are mutually exclusive: " + access);
670 }
671 }
672
673 /**
674 * Checks a class signature.
675 *
676 * @param signature
677 * a string containing the signature that must be checked.
678 */
679 public static void checkClassSignature(final String signature) {
680 // ClassSignature:
681 // FormalTypeParameters? ClassTypeSignature ClassTypeSignature*
682
683 int pos = 0;
684 if (getChar(signature, 0) == '<') {
685 pos = checkFormalTypeParameters(signature, pos);
686 }
687 pos = checkClassTypeSignature(signature, pos);
688 while (getChar(signature, pos) == 'L') {
689 pos = checkClassTypeSignature(signature, pos);
690 }
691 if (pos != signature.length()) {
692 throw new IllegalArgumentException(signature + ": error at index "
693 + pos);
694 }
695 }
696
697 /**
698 * Checks a method signature.
699 *
700 * @param signature
701 * a string containing the signature that must be checked.
702 */
703 public static void checkMethodSignature(final String signature) {
704 // MethodTypeSignature:
705 // FormalTypeParameters? ( TypeSignature* ) ( TypeSignature | V ) (
706 // ^ClassTypeSignature | ^TypeVariableSignature )*
707
708 int pos = 0;
|
668 throw new IllegalArgumentException(
669 "final and abstract are mutually exclusive: " + access);
670 }
671 }
672
673 /**
674 * Checks a class signature.
675 *
676 * @param signature
677 * a string containing the signature that must be checked.
678 */
679 public static void checkClassSignature(final String signature) {
680 // ClassSignature:
681 // FormalTypeParameters? ClassTypeSignature ClassTypeSignature*
682
683 int pos = 0;
684 if (getChar(signature, 0) == '<') {
685 pos = checkFormalTypeParameters(signature, pos);
686 }
687 pos = checkClassTypeSignature(signature, pos);
688 while (getChar(signature, pos) == 'L' || getChar(signature, pos) == 'Q') {
689 pos = checkClassTypeSignature(signature, pos);
690 }
691 if (pos != signature.length()) {
692 throw new IllegalArgumentException(signature + ": error at index "
693 + pos);
694 }
695 }
696
697 /**
698 * Checks a method signature.
699 *
700 * @param signature
701 * a string containing the signature that must be checked.
702 */
703 public static void checkMethodSignature(final String signature) {
704 // MethodTypeSignature:
705 // FormalTypeParameters? ( TypeSignature* ) ( TypeSignature | V ) (
706 // ^ClassTypeSignature | ^TypeVariableSignature )*
707
708 int pos = 0;
|