changeset 762:425ca13f66db

8154956: Module system implementation refresh (4/2016) Reviewed-by: mchung, chegar, redestad
author alanb
date Tue, 03 May 2016 09:09:14 +0100
parents 7a1b36bf2fe5
children d5bbdec1fa7c
files src/java.corba/share/classes/com/sun/tools/corba/se/idl/som/cff/FileLocator.java src/java.corba/share/classes/module-info.java
diffstat 2 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/som/cff/FileLocator.java	Thu Apr 28 08:26:32 2016 -0700
+++ b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/som/cff/FileLocator.java	Tue May 03 09:09:14 2016 +0100
@@ -222,7 +222,8 @@
 
     /**
      * locateFileInClassPath returns a DataInputStream that can be used
-     * to read the requested file.  The CLASSPATH is used to locate the file.
+     * to read the requested file.  The resource is located in the java.corba
+     * module or if not found, then the CLASSPATH is searched.
      *
      * @param fileName The name of the file to locate.  The file name
      * may be qualified with a partial path name, using '/' as the separator
@@ -238,6 +239,12 @@
     public static DataInputStream locateFileInClassPath (String fileName)
         throws FileNotFoundException, IOException {
 
+        // The resource should be in the java.corba module
+        InputStream in = FileLocator.class.getResourceAsStream("/" + fileName);
+        if (in != null) {
+            return new DataInputStream(in);
+        }
+
         boolean notFound = true;
         StringTokenizer st;
         String path = "";
--- a/src/java.corba/share/classes/module-info.java	Thu Apr 28 08:26:32 2016 -0700
+++ b/src/java.corba/share/classes/module-info.java	Tue May 03 09:09:14 2016 +0100
@@ -71,7 +71,4 @@
         java.naming;
     exports com.sun.jndi.url.iiopname to
         java.naming;
-
-    provides javax.naming.spi.InitialContextFactory
-        with com.sun.jndi.cosnaming.CNCtxFactory;
 }