mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8263763: Synthetic constructor parameters of enum are not considered for annotation indices
Reviewed-by: darcy, jfranck
This commit is contained in:
parent
1ee80e03ad
commit
9dd96257c6
4 changed files with 73 additions and 9 deletions
|
@ -566,17 +566,19 @@ public abstract class Executable extends AccessibleObject
|
|||
Annotation[][] result = parseParameterAnnotations(parameterAnnotations);
|
||||
|
||||
if (result.length != numParameters &&
|
||||
handleParameterNumberMismatch(result.length, numParameters)) {
|
||||
Annotation[][] tmp = new Annotation[result.length+1][];
|
||||
// Shift annotations down one to account for an implicit leading parameter
|
||||
System.arraycopy(result, 0, tmp, 1, result.length);
|
||||
tmp[0] = new Annotation[0];
|
||||
handleParameterNumberMismatch(result.length, parameterTypes)) {
|
||||
Annotation[][] tmp = new Annotation[numParameters][];
|
||||
// Shift annotations down to account for any implicit leading parameters
|
||||
System.arraycopy(result, 0, tmp, numParameters - result.length, result.length);
|
||||
for (int i = 0; i < numParameters - result.length; i++) {
|
||||
tmp[i] = new Annotation[0];
|
||||
}
|
||||
result = tmp;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
abstract boolean handleParameterNumberMismatch(int resultLength, int numParameters);
|
||||
abstract boolean handleParameterNumberMismatch(int resultLength, Class<?>[] parameterTypes);
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue