mbien commented on code in PR #4142:
URL: https://github.com/apache/netbeans/pull/4142#discussion_r916376601
##########
java/java.source.base/src/org/netbeans/api/java/source/ElementUtilities.java:
##########
@@ -365,86 +370,97 @@ public Iterable<? extends Element> getMembers(TypeMirror
type, ElementAcceptor a
return result;
}
-
- private static final ElementAcceptor ALL_ACCEPTOR = new ElementAcceptor() {
- @Override
- public boolean accept(Element e, TypeMirror type) {
- return true;
+
+ private static void addAlways(Element element, List<Element> list,
Map<String, List<Element>> members) {
+ String name = element.getSimpleName().toString();
+ List<Element> namedMembers = members.get(name);
+ if (namedMembers == null) {
+ namedMembers = new ArrayList<>();
+ members.put(name, namedMembers);
+ }
+ if (list != null) {
+ list.add(element);
}
- };
+ namedMembers.add(element);
Review Comment:
@matthiasblaesing thanks for taking a look. It is quite difficult to get
reviewers in summer :)
good idea. Will try to get this in. This would improve readability I agree.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists