提交 b36d0282 编写于 作者: C Christoph Kutzinski

prevent string concatenation if log level is coarser than FINE

上级 ae70e829
...@@ -33,6 +33,7 @@ import org.xml.sax.SAXException; ...@@ -33,6 +33,7 @@ import org.xml.sax.SAXException;
import java.io.IOException; import java.io.IOException;
import java.net.URL; import java.net.URL;
import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
/** /**
...@@ -57,7 +58,9 @@ public class XMLEntityResolver extends ParserConfigurator implements EntityResol ...@@ -57,7 +58,9 @@ public class XMLEntityResolver extends ParserConfigurator implements EntityResol
*/ */
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
if (systemId != null) { if (systemId != null) {
LOGGER.fine("Will try to resolve systemId [" + systemId + "]"); if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine("Will try to resolve systemId [" + systemId + "]");
}
// TestNG system-ids // TestNG system-ids
if (systemId.startsWith(TESTNG_NAMESPACE)) { if (systemId.startsWith(TESTNG_NAMESPACE)) {
LOGGER.fine("It's a TestNG document, will try to lookup DTD in classpath"); LOGGER.fine("It's a TestNG document, will try to lookup DTD in classpath");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册