Here's one of them:
@Override
public void resultChanged(LookupEvent le) {
- quotes = new ArrayList<ShakesWsClient>();
- Collection<? extends ShakesWsClient> coll = result.allInstances();
- for (ShakesWsClient client : coll) {
- //Add all the ShakesWsClient in the context to the ArrayList:
- quotes.add(client);
- //Call "createKeys":
- refresh(true);
- }
-
+ quotes = new ArrayList<ShakesWsClient>(result.allInstances());
+ //Call "createKeys":
+ refresh(true);
}
I.e., no need to iterate through the result instances, just pass them in as the ArrayList parameter.
Groovyness would dictate that you forgo with the semicolons as well :)