~ubuntu-branches/ubuntu/raring/libjaxp1.3-java/raring

« back to all changes in this revision

Viewing changes to javax/xml/validation/SchemaFactoryFinder.java

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-11-17 14:36:04 UTC
  • mfrom: (3.2.2 sid)
  • Revision ID: james.westby@ubuntu.com-20101117143604-o14s4i5mg3sr0s0v
Tags: 1.3.05-1ubuntu1
* Merge with Debian, remaining changes:
  - Adjust versioned conflict with libxalan2-java.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
 * See the License for the specific language governing permissions and
15
15
 * limitations under the License.
16
16
 */
17
 
// $Id: SchemaFactoryFinder.java 446598 2006-09-15 12:55:40Z jeremias $
 
17
// $Id: SchemaFactoryFinder.java 727365 2008-12-17 12:59:01Z mrglavas $
18
18
 
19
19
package javax.xml.validation;
20
20
 
30
30
import java.util.NoSuchElementException;
31
31
import java.util.Properties;
32
32
 
 
33
import javax.xml.XMLConstants;
 
34
 
33
35
/**
34
36
 * Implementation of {@link SchemaFactory#newInstance(String)}.
35
37
 * 
36
38
 * @author <a href="Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a>
37
 
 * @version $Revision: 446598 $, $Date: 2006-09-15 08:55:40 -0400 (Fri, 15 Sep 2006) $
 
39
 * @version $Revision: 727365 $, $Date: 2008-12-17 07:59:01 -0500 (Wed, 17 Dec 2008) $
38
40
 * @since 1.5
39
41
 */
40
42
final class SchemaFactoryFinder  {
108
110
                debugPrintln("using thread context class loader ("+classLoader+") for search");
109
111
                return;
110
112
            }
111
 
        } catch( Throwable _ ) {
 
113
        }
 
114
        // The VM ran out of memory or there was some other serious problem. Re-throw.
 
115
        catch (VirtualMachineError vme) {
 
116
            throw vme;
 
117
        }
 
118
        // ThreadDeath should always be re-thrown
 
119
        catch (ThreadDeath td) {
 
120
            throw td;
 
121
        }
 
122
        catch (Throwable _) {
112
123
            ; // getContextClassLoader() undefined in JDK1.1 
113
124
        }
114
125
        
161
172
        try {
162
173
            if (debug) debugPrintln("Looking up system property '"+propertyName+"'" );
163
174
            String r = SecuritySupport.getSystemProperty(propertyName);
164
 
            if (r != null) {
 
175
            if (r != null && r.length() > 0) {
165
176
                if (debug) debugPrintln("The value is '"+r+"'");
166
177
                sf = createInstance(r);
167
178
                if(sf!=null)    return sf;
169
180
            else if (debug) {
170
181
                debugPrintln("The property is undefined.");
171
182
            }
172
 
        } catch( Throwable t ) {
 
183
        }
 
184
        // The VM ran out of memory or there was some other serious problem. Re-throw.
 
185
        catch (VirtualMachineError vme) {
 
186
            throw vme;
 
187
        }
 
188
        // ThreadDeath should always be re-thrown
 
189
        catch (ThreadDeath td) {
 
190
            throw td;
 
191
        }
 
192
        catch (Throwable t) {
173
193
            if( debug ) {
174
194
                debugPrintln("failed to look up system property '"+propertyName+"'" );
175
195
                t.printStackTrace();
250
270
        }
251
271
        
252
272
        // platform default
253
 
        if (schemaLanguage.equals("http://www.w3.org/2001/XMLSchema")) {
 
273
        if (schemaLanguage.equals(XMLConstants.W3C_XML_SCHEMA_NS_URI)) {
254
274
            if (debug) debugPrintln("attempting to use the platform default XML Schema validator");
255
275
            return createInstance("org.apache.xerces.jaxp.validation.XMLSchemaFactory");
256
276
        }
263
283
     * <p>Creates an instance of the specified and returns it.</p>
264
284
     * 
265
285
     * @param className
266
 
     *      fully qualified class name to be instanciated.
 
286
     *      fully qualified class name to be instantiated.
267
287
     * 
268
288
     * @return null
269
289
     *      if it fails. Error messages will be printed by this method. 
283
303
                return (SchemaFactory)o;
284
304
            
285
305
            if (debug) debugPrintln(className+" is not assignable to "+SERVICE_CLASS.getName());
286
 
        } catch( Throwable t ) {
 
306
        }
 
307
        // The VM ran out of memory or there was some other serious problem. Re-throw.
 
308
        catch (VirtualMachineError vme) {
 
309
            throw vme;
 
310
        }
 
311
        // ThreadDeath should always be re-thrown
 
312
        catch (ThreadDeath td) {
 
313
            throw td;
 
314
        }
 
315
        catch (Throwable t) {
287
316
            debugPrintln("failed to instanciate "+className);
288
317
            if(debug)   t.printStackTrace();
289
318
        }