< prev index next >
src/java.base/share/classes/java/lang/reflect/Executable.java
Print this page
@@ -541,25 +541,14 @@
* the formal and implicit parameters, in declaration order, of
* the executable represented by this object
*/
public abstract Annotation[][] getParameterAnnotations();
- Annotation[][] sharedGetParameterAnnotations(Class<?>[] parameterTypes,
- byte[] parameterAnnotations) {
- int numParameters = parameterTypes.length;
- if (parameterAnnotations == null)
- return new Annotation[numParameters][0];
-
- Annotation[][] result = parseParameterAnnotations(parameterAnnotations);
-
- if (result.length != numParameters)
- handleParameterNumberMismatch(result.length, numParameters);
- return result;
+ void throwParameterAnnotationsDontMatchNumberOfParameters() {
+ throw new AnnotationFormatError("Parameter annotations don't match number of parameters");
}
- abstract void handleParameterNumberMismatch(int resultLength, int numParameters);
-
/**
* {@inheritDoc}
* @throws NullPointerException {@inheritDoc}
*/
public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
< prev index next >