mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2026-04-04 00:00:01 -04:00
Minor servlet clean-up.
This commit is contained in:
@@ -30,14 +30,15 @@
|
||||
|
||||
package com.twelvemonkeys.servlet.image;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.imageio.spi.IIORegistry;
|
||||
import javax.imageio.spi.ServiceRegistry;
|
||||
import javax.servlet.ServletContextEvent;
|
||||
import javax.servlet.ServletContextListener;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Takes care of registering and de-registering local ImageIO plugins (service providers) for the servlet context.
|
||||
@@ -72,7 +73,7 @@ public final class IIOProviderContextListener implements ServletContextListener
|
||||
Iterator<?> providers = registry.getServiceProviders(category, localFilter, false);
|
||||
|
||||
// Copy the providers, as de-registering while iterating over providers will lead to ConcurrentModificationExceptions.
|
||||
List<Object> providersCopy = new ArrayList<Object>();
|
||||
List<Object> providersCopy = new ArrayList<>();
|
||||
while (providers.hasNext()) {
|
||||
providersCopy.add(providers.next());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user