matthiasblaesing commented on a change in pull request #1277: [NETBEANS-2621]
cleanup generic class iterator
URL: https://github.com/apache/netbeans/pull/1277#discussion_r289992737
##########
File path:
groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/api/parser/GroovyVirtualSourceProvider.java
##########
@@ -350,7 +350,8 @@ private void genProp(PropertyNode propNode, PrintWriter
out) {
boolean skipGetter = false;
List getterCandidates =
propNode.getField().getOwner().getMethods(getterName);
if (getterCandidates != null) {
- for (MethodNode method : getterCandidates) {
Review comment:
Are you looking for this?
```diff
---
a/groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/api/parser/GroovyVirtualSourceProvider.java
+++
b/groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/api/parser/GroovyVirtualSourceProvider.java
@@ -348,10 +348,9 @@
String getterName = "get" + name;
boolean skipGetter = false;
- List getterCandidates =
propNode.getField().getOwner().getMethods(getterName);
+ List<MethodNode> getterCandidates =
propNode.getField().getOwner().getMethods(getterName);
if (getterCandidates != null) {
- for (Iterator it = getterCandidates.iterator();
it.hasNext();) {
- MethodNode method = (MethodNode) it.next();
+ for (MethodNode method: getterCandidates) {
if (method.getParameters().length == 0) {
skipGetter = true;
}
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
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