changeset 10844:652e4f19cdf6

Update references to jndi.properties from lib to conf
author chegar
date Mon, 20 Oct 2014 13:51:25 +0100
parents 1a85907e23c4
children 848ba2d66942
files src/java.naming/share/classes/com/sun/naming/internal/ResourceManager.java src/java.naming/share/classes/com/sun/naming/internal/VersionHelper.java src/java.naming/share/classes/javax/naming/Context.java
diffstat 3 files changed, 10 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.naming/share/classes/com/sun/naming/internal/ResourceManager.java	Sun Oct 19 20:02:40 2014 +0100
+++ b/src/java.naming/share/classes/com/sun/naming/internal/ResourceManager.java	Mon Oct 20 13:51:25 2014 +0100
@@ -60,9 +60,9 @@
     private static final String APP_RESOURCE_FILE_NAME = "jndi.properties";
 
     /*
-     * Name of properties file in <java.home>/lib.
+     * Name of properties file in <java.home>/conf.
      */
-    private static final String JRELIB_PROPERTY_FILE_NAME = "jndi.properties";
+    private static final String JRE_CONF_PROPERTY_FILE_NAME = "jndi.properties";
 
     /*
      * Internal environment property, that when set to "true", disables
@@ -474,7 +474,7 @@
     /*
      * Returns the Hashtable (never null) that results from merging
      * all application resource files available to this thread's
-     * context class loader.  The properties file in <java.home>/lib
+     * context class loader.  The properties file in <java.home>/conf
      * is also merged in.  The results are cached.
      *
      * SECURITY NOTES:
@@ -523,9 +523,9 @@
                     }
                 }
 
-                // Merge in properties from file in <java.home>/lib.
+                // Merge in properties from file in <java.home>/conf.
                 InputStream istream =
-                    helper.getJavaHomeLibStream(JRELIB_PROPERTY_FILE_NAME);
+                    helper.getJavaHomeConfStream(JRE_CONF_PROPERTY_FILE_NAME);
                 if (istream != null) {
                     try {
                         Properties props = new Properties();
--- a/src/java.naming/share/classes/com/sun/naming/internal/VersionHelper.java	Sun Oct 19 20:02:40 2014 +0100
+++ b/src/java.naming/share/classes/com/sun/naming/internal/VersionHelper.java	Mon Oct 20 13:51:25 2014 +0100
@@ -159,12 +159,12 @@
     }
 
     /*
-     * Returns an input stream for a file in <java.home>/lib,
+     * Returns an input stream for a file in <java.home>/conf,
      * or null if it cannot be located or opened.
      *
      * @param filename  The file name, sans directory.
      */
-    InputStream getJavaHomeLibStream(String filename) {
+    InputStream getJavaHomeConfStream(String filename) {
         PrivilegedAction<InputStream> act = () -> {
             try {
                 String javahome = System.getProperty("java.home");
@@ -172,7 +172,7 @@
                     return null;
                 }
                 String pathname = javahome + File.separator +
-                        "lib" + File.separator + filename;
+                        "conf" + File.separator + filename;
                 return new FileInputStream(pathname);
             } catch (Exception e) {
                 return null;
--- a/src/java.naming/share/classes/javax/naming/Context.java	Sun Oct 19 20:02:40 2014 +0100
+++ b/src/java.naming/share/classes/javax/naming/Context.java	Mon Oct 20 13:51:25 2014 +0100
@@ -207,11 +207,9 @@
  * {@link ClassLoader#getResources <tt>ClassLoader.getResources()</tt>})
  * all <em>application resource files</em> named <tt>jndi.properties</tt>
  * in the classpath.
- * In addition, if the file <i>java.home</i><tt>/lib/jndi.properties</tt>
- * exists and is readable,
+ * In addition, if the Java installation directory contains a built-in
+ * properties file, typically <tt>conf/jndi.properties</tt>,
  * JNDI treats it as an additional application resource file.
- * (<i>java.home</i> indicates the
- * directory named by the <tt>java.home</tt> system property.)
  * All of the properties contained in these files are placed
  * into the environment of the initial context.  This environment
  * is then inherited by other contexts.