equal
deleted
inserted
replaced
26 package jdk.internal.module; |
26 package jdk.internal.module; |
27 |
27 |
28 import java.lang.module.ModuleDescriptor; |
28 import java.lang.module.ModuleDescriptor; |
29 import java.lang.module.ModuleDescriptor.Provides; |
29 import java.lang.module.ModuleDescriptor.Provides; |
30 import java.util.ArrayList; |
30 import java.util.ArrayList; |
31 import java.util.Collections; |
|
32 import java.util.List; |
31 import java.util.List; |
33 import java.util.Map; |
32 import java.util.Map; |
34 import java.util.Objects; |
33 import java.util.Objects; |
35 import java.util.concurrent.ConcurrentHashMap; |
34 import java.util.concurrent.ConcurrentHashMap; |
36 import java.util.concurrent.CopyOnWriteArrayList; |
35 import java.util.concurrent.CopyOnWriteArrayList; |
145 /** |
144 /** |
146 * Returns the (possibly empty) list of service providers that implement |
145 * Returns the (possibly empty) list of service providers that implement |
147 * the given service type. |
146 * the given service type. |
148 */ |
147 */ |
149 public List<ServiceProvider> findServices(String service) { |
148 public List<ServiceProvider> findServices(String service) { |
150 return map.getOrDefault(service, Collections.emptyList()); |
149 return map.getOrDefault(service, List.of()); |
151 } |
150 } |
152 |
151 |
153 /** |
152 /** |
154 * Returns the ServicesCatalog for the given class loader or {@code null} |
153 * Returns the ServicesCatalog for the given class loader or {@code null} |
155 * if there is none. |
154 * if there is none. |