return;
}
ArrayList<ElementAnnotationImpl> annotationList = new ArrayList<ElementAnnotationImpl>();
addAnnotations(annotationList, node.getMetadata());
if (node instanceof VariableDeclaration && node.getParent() instanceof VariableDeclarationList) {
VariableDeclarationList list = (VariableDeclarationList) node.getParent();
addAnnotations(annotationList, list.getMetadata());
if (list.getParent() instanceof FieldDeclaration) {
FieldDeclaration fieldDeclaration = (FieldDeclaration) list.getParent();
addAnnotations(annotationList, fieldDeclaration.getMetadata());
} else if (list.getParent() instanceof TopLevelVariableDeclaration) {
TopLevelVariableDeclaration variableDeclaration = (TopLevelVariableDeclaration) list.getParent();
addAnnotations(annotationList, variableDeclaration.getMetadata());
}
}
if (!annotationList.isEmpty()) {
((ElementImpl) element).setMetadata(annotationList.toArray(new ElementAnnotationImpl[annotationList.size()]));