}
}
private void addElementsToNamedMethodMap(Set<? extends Element> elements, Map<String, Map<ExecutableElement, List<Element>>> namedMethodMap) {
for (Element element : elements) {
ExecutableElement method;
switch (element.getKind()) {
case PARAMETER:
method = (ExecutableElement)element.getEnclosingElement();
assert method.getKind() == ElementKind.METHOD;
break;
case METHOD:
method = (ExecutableElement)element;
break;
default:
continue;
}
Map<ExecutableElement, List<Element>> annotatedMethodWithName =
namedMethodMap.get(method.getSimpleName().toString());
if (annotatedMethodWithName == null) {
annotatedMethodWithName = new HashMap<ExecutableElement, List<Element>>();
namedMethodMap.put(method.getSimpleName().toString(), annotatedMethodWithName);
}
List<Element> annotatedElementsOfMethod = annotatedMethodWithName.get(method);
if (annotatedElementsOfMethod == null) {
annotatedElementsOfMethod = new ArrayList<Element>();