Skip to content
Snippets Groups Projects
Commit 5104f974 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

convert loop to functional style

parent 6b47d1fc
No related branches found
No related tags found
No related merge requests found
...@@ -59,17 +59,16 @@ public class ModelRunPreprocessorFactory { ...@@ -59,17 +59,16 @@ public class ModelRunPreprocessorFactory {
Set<Class<? extends ModelRunPreprocessor>> subTypes = new HashSet(); Set<Class<? extends ModelRunPreprocessor>> subTypes = new HashSet();
reflections = new Reflections("no.nibio.vips.logic"); reflections = new Reflections("no.nibio.vips.logic");
subTypes.addAll(reflections.getSubTypesOf(ModelRunPreprocessor.class)); subTypes.addAll(reflections.getSubTypesOf(ModelRunPreprocessor.class));
for(Class<? extends ModelRunPreprocessor> subType : subTypes) subTypes.forEach((subType) -> {
{
try try
{ {
modelRunPreprocessors.put(subType.newInstance().getModelId(), subType); modelRunPreprocessors.put(subType.newInstance().getModelId(), subType);
} }
catch ( InstantiationException | IllegalAccessException ex) catch ( InstantiationException | IllegalAccessException ex)
{ {
Logger.getLogger(ModelRunPreprocessorFactory.class.getName()).log(Level.SEVERE, null, ex); Logger.getLogger(ModelRunPreprocessorFactory.class.getName()).log(Level.SEVERE, null, ex);
} }
} });
} }
return modelRunPreprocessors; return modelRunPreprocessors;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment