jdk/src/java.base/share/classes/java/net/URLClassLoader.java
changeset 42227 074dfec7f994
parent 41911 b3bb62588635
child 42354 131a371f5efc
equal deleted inserted replaced
42226:f55cb692058f 42227:074dfec7f994
    40 import java.security.PrivilegedExceptionAction;
    40 import java.security.PrivilegedExceptionAction;
    41 import java.security.SecureClassLoader;
    41 import java.security.SecureClassLoader;
    42 import java.util.Enumeration;
    42 import java.util.Enumeration;
    43 import java.util.List;
    43 import java.util.List;
    44 import java.util.NoSuchElementException;
    44 import java.util.NoSuchElementException;
       
    45 import java.util.Objects;
    45 import java.util.Set;
    46 import java.util.Set;
    46 import java.util.WeakHashMap;
    47 import java.util.WeakHashMap;
    47 import java.util.jar.Attributes;
    48 import java.util.jar.Attributes;
    48 import java.util.jar.Attributes.Name;
    49 import java.util.jar.Attributes.Name;
    49 import java.util.jar.JarFile;
    50 import java.util.jar.JarFile;
   299      *         The resource name
   300      *         The resource name
   300      *
   301      *
   301      * @return  An input stream for reading the resource, or {@code null}
   302      * @return  An input stream for reading the resource, or {@code null}
   302      *          if the resource could not be found
   303      *          if the resource could not be found
   303      *
   304      *
       
   305      * @throws  NullPointerException If {@code name} is {@code null}
       
   306      *
   304      * @since  1.7
   307      * @since  1.7
   305      */
   308      */
   306     public InputStream getResourceAsStream(String name) {
   309     public InputStream getResourceAsStream(String name) {
       
   310         Objects.requireNonNull(name);
   307         URL url = getResource(name);
   311         URL url = getResource(name);
   308         try {
   312         try {
   309             if (url == null) {
   313             if (url == null) {
   310                 return null;
   314                 return null;
   311             }
   315             }