"RuntimeInvisibleParameterAnnotations");
AnnotationEntry[][] oldAnnots;
if(index == -1)
oldAnnots = new AnnotationEntry[0][0];
else{
ParameterAnnotations pa = (ParameterAnnotations)attribs.get(index);
ParameterAnnotationEntry[] paes =
pa.getParameterAnnotationEntries();
oldAnnots = new AnnotationEntry[pa.getNumParameterAnnotation()][];
for(int i = 0; i < oldAnnots.length; i++)
oldAnnots[i] = paes[i].getAnnotationEntries();
}
int num_paes = newAnnots.length;
if(oldAnnots.length > num_paes)
num_paes = oldAnnots.length;
// Unify...
List<ParameterAnnotationEntry> paes =
new ArrayList<ParameterAnnotationEntry>();
for(int i = 0; i < num_paes; i++){
List<AnnotationEntry> aes = new ArrayList<AnnotationEntry>();
// Add old annotations.
if(oldAnnots.length > i){
entries: for(AnnotationEntry oldAe : oldAnnots[i]){
if(remAnnots.length > i){
for(AnnotationEntry remAe : remAnnots[i]){
if(Util.equals(oldAe, remAe))
continue entries;
}
}
aes.add(oldAe);
}
}
// Add new annotations
if(newAnnots.length > i){
for(AnnotationEntry newAe : newAnnots[i])
aes.add(newAe);
}
// Pack into ParameterAnnotationEntry
ParameterAnnotationEntry pae = new ParameterAnnotationEntry(
aes.toArray(new AnnotationEntry[aes.size()]));
paes.add(pae);
}
// Get length
boolean nonEmptyFound = false;
int length = 1; // num_parameters
for(int i = 0; i < paes.size(); i++){
length += 2; // num_annotations
for(AnnotationEntry e : paes.get(i).getAnnotationEntries()){
length += Util.getLength(e);
nonEmptyFound = true;
}
}
if(!nonEmptyFound)
return attribs;
// Pack into ParamterAnnotations
ParameterAnnotations pa;
if(isRuntime)
pa = new RuntimeVisibleParameterAnnotations(
Util.findConstantStringIn(map,
"RuntimeVisibleParameterAnnotations"),
length,