# HG changeset patch # User msheppar # Date 1486655563 0 # Node ID b1a42dfc5eec4300a25f7638def93cd9b73eb417 # Parent 06bce0388880b5ff8e040e4a9d72a3ea11dac321 8049375: Extend how the org.omg.CORBA.ORB handles the search for orb.properties Reviewed-by: lancea, alanb diff -r 06bce0388880 -r b1a42dfc5eec corba/src/java.corba/share/classes/org/omg/CORBA/ORB.java --- a/corba/src/java.corba/share/classes/org/omg/CORBA/ORB.java Wed Jul 05 22:48:37 2017 +0200 +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/ORB.java Thu Feb 09 15:52:43 2017 +0000 @@ -106,13 +106,13 @@ * *
* When a per-application ORB is created via the 2-arg init methods, * then it will be located using the thread context class loader. + *
+ * The IDL to Java Language OMG specification documents the ${java.home}/lib directory as the location, + * in the Java run-time image, to search for orb.properties. + * This location is not intended for user editable configuration files. + * Therefore, the implementation first checks the ${java.home}/conf directory for orb.properties, + * and thereafter the ${java.home}/lib directory. * * @since JDK1.2 */ @@ -271,14 +277,25 @@ } String javaHome = System.getProperty("java.home"); - fileName = javaHome + File.separator - + "lib" + File.separator + "orb.properties"; - props = getFileProperties( fileName ) ; + + fileName = javaHome + File.separator + "conf" + + File.separator + "orb.properties"; + props = getFileProperties(fileName); + + if (props != null) { + String value = props.getProperty(name); + if (value != null) + return value; + } + + fileName = javaHome + File.separator + "lib" + + File.separator + "orb.properties"; + props = getFileProperties(fileName); if (props == null) - return null ; + return null; else - return props.getProperty( name ) ; + return props.getProperty(name); } } );