Deprecating Service in favor of ServiceLoader.

This commit is contained in:
Jesse Glick committed 2017-12-11 17:44:55 -05:00
1 parent 30ab4481f2
commit b6088dc456
5 files changed
+25 -18

No files matched your search

+3 -1
View File
@@ -120,7 +120,6 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
@@ -144,6 +143,7 @@ import hudson.util.FormValidation;
import java.io.ByteArrayInputStream;
import java.net.JarURLConnection;
import java.net.URLConnection;
import java.util.ServiceLoader;
import java.util.jar.JarEntry;
import static java.util.logging.Level.FINE;
@@ -1195,7 +1195,9 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
/**
* Discover all the service provider implementations of the given class,
* via <tt>META-INF/services</tt>.
* @deprecated Use {@link ServiceLoader} instead, or (more commonly) {@link ExtensionList}.
*/
@Deprecated
public <T> Collection<Class<? extends T>> discover( Class<T> spi ) {
Set<Class<? extends T>> result = new HashSet<Class<? extends T>>();