Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion log4j-core-java9/src/assembly/java9.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
<include>org/apache/logging/log4j/core/jackson/Log4jStackTraceElementDeserializer.class</include>
<include>org/apache/logging/log4j/core/jackson/StackTraceElementMixIn.class</include>
<include>org/apache/logging/log4j/core/util/internal/UnsafeUtil*.class</include>
<include>org/apache/logging/log4j/core/util/SystemClock.class</include>
</includes>
</fileSet>
</fileSets>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@
*/
package org.apache.logging.log4j.core.util;

import java.time.Instant;
import org.apache.logging.log4j.core.time.MutableInstant;
import org.apache.logging.log4j.core.time.PreciseClock;

/**
* Implementation of the {@code Clock} interface that returns the system time.
*/
public final class SystemClock implements Clock {
public final class SystemClock implements Clock, PreciseClock {

/**
* Returns the system time.
Expand All @@ -29,4 +33,10 @@ public final class SystemClock implements Clock {
public long currentTimeMillis() {
return System.currentTimeMillis();
}

@Override
public void init(final MutableInstant mutableInstant) {
final Instant instant = java.time.Clock.systemUTC().instant();
mutableInstant.initFromEpochSecond(instant.getEpochSecond(), instant.getNano());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Log4j 2 helper classes.
*/
@Export
@Version("2.24.2")
@Version("2.25.0")
package org.apache.logging.log4j.core.util;

import org.osgi.annotation.bundle.Export;
Expand Down
Loading
Loading