src/share/classes/java/util/ServiceLoader.java
Print this page
rev 3186 : 6880112: Project Coin: Port JDK core library code to use diamond operator
*** 189,199 ****
// The class loader used to locate, load, and instantiate providers
private ClassLoader loader;
// Cached providers, in instantiation order
! private LinkedHashMap<String,S> providers = new LinkedHashMap<String,S>();
// The current lazy-lookup iterator
private LazyIterator lookupIterator;
/**
--- 189,199 ----
// The class loader used to locate, load, and instantiate providers
private ClassLoader loader;
// Cached providers, in instantiation order
! private LinkedHashMap<String,S> providers = new LinkedHashMap<>();
// The current lazy-lookup iterator
private LazyIterator lookupIterator;
/**
*** 289,299 ****
private Iterator<String> parse(Class service, URL u)
throws ServiceConfigurationError
{
InputStream in = null;
BufferedReader r = null;
! ArrayList<String> names = new ArrayList<String>();
try {
in = u.openStream();
r = new BufferedReader(new InputStreamReader(in, "utf-8"));
int lc = 1;
while ((lc = parseLine(service, u, r, lc, names)) >= 0);
--- 289,299 ----
private Iterator<String> parse(Class service, URL u)
throws ServiceConfigurationError
{
InputStream in = null;
BufferedReader r = null;
! ArrayList<String> names = new ArrayList<>();
try {
in = u.openStream();
r = new BufferedReader(new InputStreamReader(in, "utf-8"));
int lc = 1;
while ((lc = parseLine(service, u, r, lc, names)) >= 0);
*** 461,471 ****
* @return A new service loader
*/
public static <S> ServiceLoader<S> load(Class<S> service,
ClassLoader loader)
{
! return new ServiceLoader<S>(service, loader);
}
/**
* Creates a new service loader for the given service type, using the
* current thread's {@linkplain java.lang.Thread#getContextClassLoader
--- 461,471 ----
* @return A new service loader
*/
public static <S> ServiceLoader<S> load(Class<S> service,
ClassLoader loader)
{
! return new ServiceLoader<>(service, loader);
}
/**
* Creates a new service loader for the given service type, using the
* current thread's {@linkplain java.lang.Thread#getContextClassLoader