jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathFactoryFinder.java
changeset 44378 06aa1b671d17
parent 42806 35843e3d5ef1
child 45853 bfa06be36a17
equal deleted inserted replaced
44377:664d5912500e 44378:06aa1b671d17
     1 /*
     1 /*
     2  * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   174             }
   174             }
   175         }
   175         }
   176 
   176 
   177         String javah = ss.getSystemProperty( "java.home" );
   177         String javah = ss.getSystemProperty( "java.home" );
   178         String configFile = javah + File.separator +
   178         String configFile = javah + File.separator +
   179         "lib" + File.separator + "jaxp.properties";
   179         "conf" + File.separator + "jaxp.properties";
   180 
   180 
   181         // try to read from $java.home/lib/jaxp.properties
   181         // try to read from $java.home/conf/jaxp.properties
   182         try {
   182         try {
   183             if(firstTime){
   183             if(firstTime){
   184                 synchronized(cacheProps){
   184                 synchronized(cacheProps){
   185                     if(firstTime){
   185                     if(firstTime){
   186                         File f=new File( configFile );
   186                         File f=new File( configFile );
   191                         }
   191                         }
   192                     }
   192                     }
   193                 }
   193                 }
   194             }
   194             }
   195             final String factoryClassName = cacheProps.getProperty(propertyName);
   195             final String factoryClassName = cacheProps.getProperty(propertyName);
   196             debugPrintln(()->"found " + factoryClassName + " in $java.home/jaxp.properties");
   196             debugPrintln(()->"found " + factoryClassName + " in $java.home/conf/jaxp.properties");
   197 
   197 
   198             if (factoryClassName != null) {
   198             if (factoryClassName != null) {
   199                 xpathFactory = createInstance(factoryClassName, true);
   199                 xpathFactory = createInstance(factoryClassName, true);
   200                 if(xpathFactory != null){
   200                 if(xpathFactory != null){
   201                     return xpathFactory;
   201                     return xpathFactory;