From 086f661a29305b8ed3bfad48b547ccc62b51aecc Mon Sep 17 00:00:00 2001 From: merorai Date: Tue, 23 Apr 2019 10:58:04 +0100 Subject: [PATCH] Removed Java 8 code from LoggingConfigImpl.java --- .../util/logging/LoggingConfigImpl.java | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/nucleus/common/common-util/src/main/java/com/sun/common/util/logging/LoggingConfigImpl.java b/nucleus/common/common-util/src/main/java/com/sun/common/util/logging/LoggingConfigImpl.java index f3f853ab561..9857e3eaf71 100644 --- a/nucleus/common/common-util/src/main/java/com/sun/common/util/logging/LoggingConfigImpl.java +++ b/nucleus/common/common-util/src/main/java/com/sun/common/util/logging/LoggingConfigImpl.java @@ -68,7 +68,6 @@ import org.jvnet.hk2.annotations.Contract; import org.jvnet.hk2.annotations.Service; -import static com.sun.common.util.logging.LoggingXMLNames.xmltoPropsMap; /** @@ -435,29 +434,30 @@ private void addDirectory(ZipOutputStream zout, File fileSource, int ignoreLengt } } } - - /* Return a logging file details in the logging.properties file. + + /* Return a logging file details in the logging.properties file. * @throws IOException - */ + */ + public synchronized String getLoggingFileDetails() throws IOException { - loadLoggingProperties(); - - @SuppressWarnings("unchecked") - Enumeration loggingPropertyNames = (Enumeration) props.propertyNames(); - - while (loggingPropertyNames.hasMoreElements()) { - String key = loggingPropertyNames.nextElement(); - - // Convert the name in domain.xml to the name in logging.properties if needed - key = xmltoPropsMap.getOrDefault(key, key); + try { + loadLoggingProperties(); + Enumeration e = props.propertyNames(); + + while (e.hasMoreElements()) { + String key = (String) e.nextElement(); + // convert the name in domain.xml to the name in logging.properties if needed + if (LoggingXMLNames.xmltoPropsMap.get(key) != null) { + key = LoggingXMLNames.xmltoPropsMap.get(key); + } - if (key != null && key.equals("com.sun.enterprise.server.logging.GFFileHandler.file")) { - return props.getProperty(key); + if (key != null && key.equals("com.sun.enterprise.server.logging.GFFileHandler.file")) { + return props.getProperty(key); + } } + } catch (IOException ex) { + throw ex; } - - // If "com.sun.enterprise.server.logging.GFFileHandler.file" not found, check "java.util.logging.FileHandler.pattern" - // This property can have been set by Payara Micro when using the --logtofile - return props.getProperty("java.util.logging.FileHandler.pattern"); + return null; } }