< prev index next >
src/java.xml/share/classes/javax/xml/validation/SchemaFactoryFinder.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -286,11 +286,15 @@
Class<?> clazz = createClass(className);
if (clazz == null) {
debugPrintln("failed to getClass(" + className + ")");
return null;
}
- debugPrintln("loaded " + className + " from " + which(clazz));
+ // SecuritySupport::getClassSource is expensive and can result in unnecessary
+ // I/O. It needs to be called only when 'debug' flag is set
+ if (debug) {
+ debugPrintln("loaded " + className + " from " + ss.getClassSource(clazz));
+ }
// instantiate Class as a SchemaFactory
try {
if (!SchemaFactory.class.isAssignableFrom(clazz)) {
throw new ClassCastException(clazz.getName()
@@ -414,11 +418,6 @@
}
}
private static final Class<SchemaFactory> SERVICE_CLASS = SchemaFactory.class;
-
- // Used for debugging purposes
- private static String which( Class<?> clazz ) {
- return ss.getClassSource(clazz);
- }
}
< prev index next >