--- old/src/java.xml/share/classes/javax/xml/transform/FactoryFinder.java 2016-12-14 14:27:36.156987658 +0300
+++ new/src/java.xml/share/classes/javax/xml/transform/FactoryFinder.java 2016-12-14 14:27:36.084985884 +0300
@@ -1,5 +1,5 @@
/*
- * 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
@@ -34,6 +34,7 @@
import java.util.Properties;
import java.util.ServiceConfigurationError;
import java.util.ServiceLoader;
+import java.util.function.Supplier;
/**
*
Implements pluggable Datatypes.
@@ -83,9 +84,9 @@
}
}
- private static void dPrint(String msg) {
+ private static void dPrint(Supplier msgGen) {
if (debug) {
- System.err.println("JAXP: " + msg);
+ System.err.println("JAXP: " + msgGen.get());
}
}
@@ -177,10 +178,9 @@
if (instance == null) {
instance = providerClass.newInstance();
}
- if (debug) { // Extra check to avoid computing cl strings
- dPrint("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- }
+ final ClassLoader clD = cl;
+ dPrint(()->"created new instance of " + providerClass +
+ " using ClassLoader: " + clD);
return type.cast(instance);
}
catch (ClassNotFoundException x) {
@@ -255,12 +255,12 @@
final String factoryId = type.getName();
- dPrint("find factoryId =" + factoryId);
+ dPrint(()->"find factoryId =" + factoryId);
// Use the system property first
try {
String systemProp = ss.getSystemProperty(factoryId);
if (systemProp != null) {
- dPrint("found system property, value=" + systemProp);
+ dPrint(()->"found system property, value=" + systemProp);
return newInstance(type, systemProp, null, true, true);
}
}
@@ -278,7 +278,7 @@
File f = new File(configFile);
firstTime = false;
if (ss.doesFileExist(f)) {
- dPrint("Read properties file "+f);
+ dPrint(()->"Read properties file "+f);
cacheProps.load(ss.getFileInputStream(f));
}
}
@@ -287,7 +287,7 @@
final String factoryClassName = cacheProps.getProperty(factoryId);
if (factoryClassName != null) {
- dPrint("found in ${java.home}/conf/jaxp.properties, value=" + factoryClassName);
+ dPrint(()->"found in ${java.home}/conf/jaxp.properties, value=" + factoryClassName);
return newInstance(type, factoryClassName, null, true, true);
}
}
@@ -305,7 +305,7 @@
"Provider for " + factoryId + " cannot be found");
}
- dPrint("loaded from fallback value: " + fallbackClassName);
+ dPrint(()->"loaded from fallback value: " + fallbackClassName);
return newInstance(type, fallbackClassName, null, true, true);
}