This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch maven-4.0.x
in repository https://gitbox.apache.org/repos/asf/maven.git
The following commit(s) were added to refs/heads/maven-4.0.x by this push:
new 81b2983a42 fix: wait for terminal installation before caching logging
output (compat) (#13861)
81b2983a42 is described below
commit 81b2983a427df8af999d790d04fff03d296e92b5
Author: Guillaume Nodet <[email protected]>
AuthorDate: Mon Nov 9 15:16:31 2026 +0100
fix: wait for terminal installation before caching logging output (compat)
(#13861)
* fix: wait for terminal installation before caching logging output (compat)
Port of #13799 (maven-3.10.x) to maven-4.0.x, compat layer only.
- Add MessageUtils.awaitTerminalInitialization() to impl/maven-jline
(same pattern as 3.10.x — calls FastTerminal.getTerminal() to block
until async terminal init completes)
- Add awaitTerminalInitialization() in the LOG_FILE branch of
MavenCli.logging() before System.setOut/setErr, to prevent FastTerminal's
background thread from overwriting the -l file redirection (#12188)
- Add awaitTerminalInitialization() in the else branch before
slf4jConfiguration.activate(), except when color is explicitly forced
(always/yes/force), to prevent the logger from caching the wrong stream
- Add Javadoc on awaitTerminalInitialization() explaining when and why to
call it
See also: apache/maven#13793 (issue), apache/maven#13799 (3.10.x fix)
* fix: exclude logback from surefire classpath in maven-embedder tests
Exclude logback-classic from the surefire test classpath so
MavenLoggerFactory is the sole SLF4J provider. On macOS aarch64,
ServiceLoader picks Logback when both maven-logging and logback-classic
are on the test classpath; LogbackConfiguration.activate() is then a
no-op and the stream assertions in MavenCliLoggingTest fail
(expected: true was: false).
* fix: skip MavenCliLoggingTest when MavenLoggerFactory is not the active
SLF4J provider
On macOS aarch64, logback-classic may win the ServiceLoader race for SLF4J
2.x
provider selection. When logback is selected,
LogbackConfiguration.activate() is
a no-op and the stream-caching assertions in MavenCliLoggingTest cannot
hold.
The surefire classpathDependencyExcludes approach proved unreliable on some
platforms. Replace it with an Assumptions.assumeTrue guard so the tests are
skipped (not failed) when MavenLoggerFactory is not the active provider.
The fix being tested (awaitTerminalInitialization call in MavenCli.logging)
is
platform-independent and is validated on platforms where MavenLoggerFactory
is used.
* fix: scope logback-classic as provided to exclude it from test classpath
The surefire classpathDependencyExcludes approach was insufficient on
macOS aarch64 CI. Changing logback-classic to provided scope is more
reliable: compile-time visibility is preserved for LogbackConfiguration,
but the JAR is absent from the test forked JVM, ensuring MavenLoggerFactory
is the sole SLF4J provider and stream assertions in MavenCliLoggingTest
pass on all platforms.
* fix: move <optional> after <scope> in logback-classic dependency
(spotless)
* fix: replace racy latch with awaitThreadState() in
cachesOutputAfterTerminalInstallation
The overridden getTerminal() latch approach had a race condition on
macOS aarch64: on fast CPUs, getTerminal() could be called (and the
latch fired) from a configure() path rather than from
awaitTerminalInitialization(), causing releaseTerminal.countDown() to
run before the logging thread was actually blocked on
CompletableFuture.get(). activate() then ran while System.out was
still earlyStream, caching the wrong stream.
Replace with awaitThreadState(loggingThread, WAITING, 10_000) — the
same technique used by the master-branch port — which polls the thread
state directly and only releases the terminal once the thread is
provably blocked on CompletableFuture.get() inside getTerminal().
This eliminates the platform-specific scheduling dependency.
* fix: reset defaultLogLevel and logFile in SimpleLoggerConfiguration.init()
init() was not resetting defaultLogLevel and logFile to their defaults
before re-reading properties. When another test (e.g.
calculateTransferListener)
called cli.logging() with --quiet, it set maven.logger.defaultLogLevel=error
via setRootLoggerLevel(). On a subsequent init() with that property cleared,
the stale ERROR value persisted, suppressing WARN-level output and causing
MavenCliLoggingTest assertions to fail.
Also harden MavenCliLoggingTest to save/restore all logger system properties
(both maven.logger.* and org.slf4j.simpleLogger.* prefixes) and clear them
in setUp() to prevent cross-test contamination.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
---
compat/maven-embedder/pom.xml | 4 +
.../main/java/org/apache/maven/cli/MavenCli.java | 18 +-
.../org/apache/maven/cli/MavenCliLoggingTest.java | 316 +++++++++++++++++++++
.../java/org/apache/maven/jline/MessageUtils.java | 14 +
.../maven/slf4j/SimpleLoggerConfiguration.java | 2 +
5 files changed, 352 insertions(+), 2 deletions(-)
diff --git a/compat/maven-embedder/pom.xml b/compat/maven-embedder/pom.xml
index 7c1045dfcf..2085b1d695 100644
--- a/compat/maven-embedder/pom.xml
+++ b/compat/maven-embedder/pom.xml
@@ -166,6 +166,10 @@ under the License.
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
+ <!-- provided: compile-only for LogbackConfiguration; excluded from test
classpath
+ so MavenLoggerFactory is the sole SLF4J provider in tests (macOS
aarch64 CI
+ picks Logback when both providers are present, breaking stream
assertions) -->
+ <scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
diff --git
a/compat/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
b/compat/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
index c1dc6c3da2..88ceec6e02 100644
--- a/compat/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
+++ b/compat/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
@@ -557,6 +557,11 @@ void logging(CliRequest cliRequest) throws ExitException {
File logFile = new
File(commandLine.getOptionValue(CLIManager.LOG_FILE));
logFile = ResolveFile.resolveFile(logFile,
cliRequest.workingDirectory);
+ // make sure the terminal has finished installing before we grab
the streams, otherwise it
+ // could later overwrite our redirection and logs would leak back
to the console
+ // (see https://github.com/apache/maven/issues/12188)
+ MessageUtils.awaitTerminalInitialization();
+
// redirect stdout and stderr to file
try {
PrintStream ps = new PrintStream(new
FileOutputStream(logFile));
@@ -567,9 +572,18 @@ void logging(CliRequest cliRequest) throws ExitException {
// Ignore
//
}
- }
- slf4jConfiguration.activate();
+ slf4jConfiguration.activate();
+ } else {
+ // Logging caches System.out, so wait for terminal installation to
complete before
+ // activating, except when color is explicitly forced. With forced
color the user expects
+ // raw ANSI to flow through the original stdout; waiting causes
AnsiConsole to wrap that
+ // stream before the logger caches it, which may strip the escape
codes.
+ if (!"always".equals(styleColor) && !"yes".equals(styleColor) &&
!"force".equals(styleColor)) {
+ MessageUtils.awaitTerminalInitialization();
+ }
+ slf4jConfiguration.activate();
+ }
plexusLoggerManager = new Slf4jLoggerManager();
slf4jLogger = slf4jLoggerFactory.getLogger(this.getClass().getName());
diff --git
a/compat/maven-embedder/src/test/java/org/apache/maven/cli/MavenCliLoggingTest.java
b/compat/maven-embedder/src/test/java/org/apache/maven/cli/MavenCliLoggingTest.java
new file mode 100644
index 0000000000..d23866ec46
--- /dev/null
+++
b/compat/maven-embedder/src/test/java/org/apache/maven/cli/MavenCliLoggingTest.java
@@ -0,0 +1,316 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.maven.cli;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.lang.reflect.Field;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.FutureTask;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.maven.api.Constants;
+import org.apache.maven.cling.logging.Slf4jConfiguration;
+import org.apache.maven.cling.logging.Slf4jConfigurationFactory;
+import org.apache.maven.jline.FastTerminal;
+import org.apache.maven.jline.MessageUtils;
+import org.apache.maven.slf4j.MavenBaseLogger;
+import org.apache.maven.slf4j.MavenLoggerFactory;
+import org.jline.terminal.Terminal;
+import org.jline.terminal.impl.DumbTerminal;
+import org.jline.terminal.spi.TerminalExt;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.parallel.Isolated;
+import org.slf4j.LoggerFactory;
+
+import static java.nio.charset.StandardCharsets.UTF_8;
+import static java.util.concurrent.TimeUnit.SECONDS;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assumptions.assumeTrue;
+import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
+import static org.mockito.Mockito.mock;
+
+@Isolated("Changes JVM-wide streams, system properties, terminal state, and
logging configuration")
+class MavenCliLoggingTest {
+
+ private static final String[] SAVED_PROPERTIES = {
+ MavenBaseLogger.LEGACY_PREFIX + "logFile",
+ MavenBaseLogger.LEGACY_PREFIX + "cacheOutputStream",
+ MavenBaseLogger.LEGACY_PREFIX + "defaultLogLevel",
+ Constants.MAVEN_LOGGER_LOG_FILE,
+ Constants.MAVEN_LOGGER_CACHE_OUTPUT_STREAM,
+ Constants.MAVEN_LOGGER_DEFAULT_LOG_LEVEL,
+ };
+
+ private PrintStream savedOut;
+ private Terminal savedTerminal;
+ private boolean savedColor;
+ private final String[] savedPropertyValues = new
String[SAVED_PROPERTIES.length];
+
+ @BeforeEach
+ void setUp() throws Exception {
+ // These tests require MavenLoggerFactory as the active SLF4J provider
because they
+ // rely on stream caching behaviour specific to
MavenSimpleConfiguration.activate().
+ // When another binding (e.g. Logback) is on the classpath and wins
the ServiceLoader
+ // race (platform-dependent), the assertions cannot hold and the test
must be skipped
+ // rather than fail.
+ assumeTrue(
+ LoggerFactory.getILoggerFactory() instanceof
MavenLoggerFactory,
+ "MavenLoggerFactory must be the active SLF4J provider");
+ savedOut = System.out;
+ savedTerminal = getTerminalField();
+ savedColor = getColorEnabled();
+ // Null out the terminal so leftover FastTerminal threads from other
tests cannot
+ // race with this test's stream setup via their consumer callbacks.
+ injectTerminal(null);
+ for (int i = 0; i < SAVED_PROPERTIES.length; i++) {
+ savedPropertyValues[i] = System.getProperty(SAVED_PROPERTIES[i]);
+ }
+ // Clear all logger properties and re-initialize the config so
previous tests
+ // (e.g. MavenCliTest#calculateTransferListener setting
maven.logger.defaultLogLevel=error
+ // via --quiet) cannot poison this test's config. The re-init is
needed because
+ // SimpleLoggerConfiguration.init() only updates defaultLogLevel when
the property IS set;
+ // clearing the property alone leaves the stale value in the config
object.
+ for (String prop : SAVED_PROPERTIES) {
+ System.clearProperty(prop);
+ }
+ activateSlf4j();
+ }
+
+ @AfterEach
+ void tearDown() throws Exception {
+ System.setOut(savedOut);
+ injectTerminal(savedTerminal);
+ setColorEnabled(savedColor);
+ for (int i = 0; i < SAVED_PROPERTIES.length; i++) {
+ restoreProperty(SAVED_PROPERTIES[i], savedPropertyValues[i]);
+ }
+ activateSlf4j();
+ }
+
+ /**
+ * When color is explicitly forced ({@code -color=always}), {@code
logging()} must NOT call
+ * {@code awaitTerminalInitialization()} before activating the logging
configuration. The
+ * logger must therefore cache the stream that was active at activation
time (the "early"
+ * stream), not the stream installed by the terminal consumer afterwards.
+ * <p>
+ * Note: on master the logger reconfiguration ({@code
MavenSimpleLogger.configure()}) renders
+ * ANSI-coloured level labels via {@code JLineMessageBuilderFactory},
which calls
+ * {@code terminal.getType()} and therefore always awaits terminal
initialisation. The test
+ * accounts for this by completing the terminal build before running
{@code logging()} and
+ * then swapping {@code System.out} afterwards, verifying that the logger
sticks to the
+ * stream it cached at activation time.
+ */
+ @Test
+ void withColorForcedLoggerCachesEarlyStream() throws Exception {
+ ByteArrayOutputStream earlyOutput = new ByteArrayOutputStream();
+ ByteArrayOutputStream lateOutput = new ByteArrayOutputStream();
+ try (PrintStream earlyStream = new PrintStream(earlyOutput, true,
UTF_8.name());
+ PrintStream lateStream = new PrintStream(lateOutput, true,
UTF_8.name());
+ Terminal dumb = new DumbTerminal(
+ "Maven",
+ Terminal.TYPE_DUMB_COLOR,
+ InputStream.nullInputStream(),
+ OutputStream.nullOutputStream(),
+ null)) {
+ // Install a completed terminal so configure() can call getType()
without blocking.
+ injectTerminal(dumb);
+
+ // Set up logger to cache System.out at activate() time.
+ System.setProperty(MavenBaseLogger.LEGACY_PREFIX +
"cacheOutputStream", "true");
+ System.setProperty(MavenBaseLogger.LEGACY_PREFIX + "logFile",
"System.out");
+ System.setOut(earlyStream);
+ activateSlf4j();
+
+ // Run logging() with -color=always. It must NOT call
awaitTerminalInitialization()
+ // before activate(), so it completes immediately (no blocking
terminal).
+ MavenCli cli = new MavenCli();
+ CliRequest request = new CliRequest(new String[]
{"-Dstyle.color=always"}, null);
+ cli.cli(request);
+ cli.properties(request);
+ cli.logging(request);
+
+ // Swap System.out AFTER logging() has cached earlyStream.
+ System.setOut(lateStream);
+
+ // The logger must still write to earlyStream.
+
LoggerFactory.getLogger(MavenCliLoggingTest.class).warn("terminal-output-marker");
+ assertTrue(
+
earlyOutput.toString(UTF_8.name()).contains("terminal-output-marker"),
+ "Logger must write to the stream that was active when
logging() ran with -color=always");
+ assertFalse(
+
lateOutput.toString(UTF_8.name()).contains("terminal-output-marker"),
+ "Logger must not switch to the stream installed after
logging() completed");
+ }
+ }
+
+ /**
+ * When color is set to {@code never} or {@code auto} (batch mode), {@code
logging()} must call
+ * {@code awaitTerminalInitialization()} before activating the logging
configuration, so that
+ * the terminal consumer has already swapped {@code System.out} before the
logger caches it.
+ * This prevents logs from going to a stale stream instead of the
terminal-wrapped one.
+ */
+ @Test
+ void cachesOutputAfterTerminalInstallationWithColorDisabled() throws
Exception {
+ cachesOutputAfterTerminalInstallation("never");
+ }
+
+ @Test
+ void cachesOutputAfterTerminalInstallationInBatchMode() throws Exception {
+ cachesOutputAfterTerminalInstallation("batch");
+ }
+
+ private void cachesOutputAfterTerminalInstallation(String color) throws
Exception {
+ CountDownLatch buildingTerminal = new CountDownLatch(1);
+ CountDownLatch releaseTerminal = new CountDownLatch(1);
+ ByteArrayOutputStream earlyOutput = new ByteArrayOutputStream();
+ ByteArrayOutputStream terminalOutput = new ByteArrayOutputStream();
+ Thread loggingThread = null;
+ try (PrintStream earlyStream = new PrintStream(earlyOutput, true,
UTF_8.name());
+ PrintStream terminalStream = new PrintStream(terminalOutput,
true, UTF_8.name())) {
+ System.setProperty(MavenBaseLogger.LEGACY_PREFIX +
"cacheOutputStream", "true");
+ System.setProperty(MavenBaseLogger.LEGACY_PREFIX + "logFile",
"System.out");
+ System.setOut(earlyStream);
+ activateSlf4j();
+
+ FastTerminal terminal = new FastTerminal(
+ () -> {
+ buildingTerminal.countDown();
+ if (!releaseTerminal.await(10, SECONDS)) {
+ throw new IllegalStateException("Terminal
installation was not released");
+ }
+ return mock(TerminalExt.class, RETURNS_DEEP_STUBS);
+ },
+ installed -> System.setOut(terminalStream));
+ // Inject the FastTerminal directly into MessageUtils.terminal
before starting the
+ // build thread, to avoid calling systemInstall(Terminal) which
also creates a LineReader
+ // from the terminal — that would call FastTerminal.getTerminal()
and block.
+ injectTerminal(terminal);
+ terminal.start();
+ assertTrue(buildingTerminal.await(10, SECONDS));
+
+ MavenCli cli = new MavenCli();
+ CliRequest request = new CliRequest(
+ "batch".equals(color) ? new String[] {"-B"} : new String[]
{"-Dstyle.color=" + color}, null);
+ cli.cli(request);
+ cli.properties(request);
+ FutureTask<Void> logging = new FutureTask<>(() -> {
+ cli.logging(request);
+ return null;
+ });
+ loggingThread = new Thread(logging, "logging-initialization-test");
+ loggingThread.setDaemon(true);
+ loggingThread.start();
+
+ // Wait until the logging thread is blocked on
awaitTerminalInitialization() →
+ // FastTerminal.getTerminal() → CompletableFuture.get(). At this
point,
+ // config.init() has NOT yet run (it comes after
awaitTerminalInitialization()).
+ awaitThreadState(loggingThread, Thread.State.WAITING, 10_000);
+
+ // Release the terminal — the consumer sets
System.out=terminalStream.
+ // awaitTerminalInitialization() returns, then config.init()
captures terminalStream.
+ releaseTerminal.countDown();
+ logging.get(10, SECONDS);
+
+
LoggerFactory.getLogger(MavenCliLoggingTest.class).warn("terminal-output-marker");
+
assertTrue(terminalOutput.toString(UTF_8.name()).contains("terminal-output-marker"));
+
assertFalse(earlyOutput.toString(UTF_8.name()).contains("terminal-output-marker"));
+ } finally {
+ releaseTerminal.countDown();
+ if (loggingThread != null) {
+ loggingThread.join(10000);
+ }
+ }
+ }
+
+ /**
+ * Waits until the given thread enters the expected state or the timeout
expires.
+ * Used to detect when a thread is blocked on {@code
CompletableFuture.get()} inside
+ * {@code FastTerminal.getTerminal()}. This is more reliable than a fixed
sleep and
+ * avoids depending on platform-specific scheduling behaviour.
+ *
+ * @param thread the thread to monitor
+ * @param expected the expected thread state (typically {@link
Thread.State#WAITING})
+ * @param timeoutMs maximum time to wait in milliseconds
+ */
+ private static void awaitThreadState(Thread thread, Thread.State expected,
long timeoutMs)
+ throws InterruptedException {
+ long deadline = System.nanoTime() +
TimeUnit.MILLISECONDS.toNanos(timeoutMs);
+ while (thread.getState() != expected) {
+ if (System.nanoTime() > deadline) {
+ throw new AssertionError("Thread " + thread.getName() + " did
not reach state " + expected + " within "
+ + timeoutMs + "ms; actual state: " +
thread.getState());
+ }
+ Thread.sleep(10);
+ }
+ }
+
+ /**
+ * Injects the given terminal directly into {@link MessageUtils#terminal}
without creating a
+ * {@code LineReader} from it. This avoids calling {@link
MessageUtils#systemInstall(Terminal)}
+ * which on master tries to build a {@code LineReader} — that calls
+ * {@link FastTerminal#getTerminal()} which blocks until the build thread
completes.
+ */
+ private static void injectTerminal(Terminal terminal) throws Exception {
+ Field field = MessageUtils.class.getDeclaredField("terminal");
+ field.setAccessible(true);
+ field.set(null, terminal);
+ }
+
+ /**
+ * Reads the raw {@code colorEnabled} field from {@link MessageUtils}
without requiring a
+ * terminal to be installed (unlike {@link MessageUtils#isColorEnabled()}
which also checks
+ * {@code terminal != null}).
+ */
+ private static boolean getColorEnabled() throws Exception {
+ Field field = MessageUtils.class.getDeclaredField("colorEnabled");
+ field.setAccessible(true);
+ return (boolean) field.get(null);
+ }
+
+ private static void setColorEnabled(boolean value) throws Exception {
+ Field field = MessageUtils.class.getDeclaredField("colorEnabled");
+ field.setAccessible(true);
+ field.set(null, value);
+ }
+
+ private static Terminal getTerminalField() throws Exception {
+ Field field = MessageUtils.class.getDeclaredField("terminal");
+ field.setAccessible(true);
+ return (Terminal) field.get(null);
+ }
+
+ private static void activateSlf4j() {
+ Slf4jConfiguration config =
Slf4jConfigurationFactory.getConfiguration(LoggerFactory.getILoggerFactory());
+ config.activate();
+ }
+
+ private static void restoreProperty(String name, String value) {
+ if (value == null) {
+ System.clearProperty(name);
+ } else {
+ System.setProperty(name, value);
+ }
+ }
+}
diff --git
a/impl/maven-jline/src/main/java/org/apache/maven/jline/MessageUtils.java
b/impl/maven-jline/src/main/java/org/apache/maven/jline/MessageUtils.java
index a04a54eb4b..a32b25c4fc 100644
--- a/impl/maven-jline/src/main/java/org/apache/maven/jline/MessageUtils.java
+++ b/impl/maven-jline/src/main/java/org/apache/maven/jline/MessageUtils.java
@@ -110,6 +110,20 @@ private static void doSystemUninstall() {
}
}
+ /**
+ * Blocks until the asynchronous terminal installation completes.
+ * Call this before redirecting {@code System.out}/{@code System.err} to
avoid the terminal
+ * thread overwriting your redirection, and before activating logging
configuration to ensure
+ * it caches the correct output stream.
+ *
+ * @see <a href="https://github.com/apache/maven/issues/12188">#12188</a>
+ */
+ public static void awaitTerminalInitialization() {
+ if (terminal instanceof FastTerminal fastTerminal) {
+ fastTerminal.getTerminal();
+ }
+ }
+
public static void setColorEnabled(boolean enabled) {
colorEnabled = enabled;
}
diff --git
a/impl/maven-logging/src/main/java/org/apache/maven/slf4j/SimpleLoggerConfiguration.java
b/impl/maven-logging/src/main/java/org/apache/maven/slf4j/SimpleLoggerConfiguration.java
index 27776f1e77..fe5654bfa7 100644
---
a/impl/maven-logging/src/main/java/org/apache/maven/slf4j/SimpleLoggerConfiguration.java
+++
b/impl/maven-logging/src/main/java/org/apache/maven/slf4j/SimpleLoggerConfiguration.java
@@ -93,6 +93,8 @@ public class SimpleLoggerConfiguration {
void init() {
// Reset state before initialization
+ defaultLogLevel = DEFAULT_LOG_LEVEL_DEFAULT;
+ logFile = LOG_FILE_DEFAULT;
dateFormatter = null;
loadProperties();