You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ma...@apache.org on 2024/01/02 00:20:32 UTC

(logging-log4j2) 04/08: Make LazyUtil.Constant a record

This is an automated email from the ASF dual-hosted git repository.

mattsicker pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit 60fcb5c2d2c1e8871031e8d1667f7d740030c388
Author: Matt Sicker <ma...@apache.org>
AuthorDate: Mon Jan 1 18:13:14 2024 -0600

    Make LazyUtil.Constant a record
    
    Signed-off-by: Matt Sicker <ma...@apache.org>
---
 .../src/main/java/org/apache/logging/log4j/util/LazyUtil.java     | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/LazyUtil.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/LazyUtil.java
index a4eb0e459d..402d8eb43b 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/LazyUtil.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/LazyUtil.java
@@ -39,13 +39,7 @@ final class LazyUtil {
         return value == NULL ? null : Cast.cast(value);
     }
 
-    static class Constant<T> implements Lazy<T> {
-        private final T value;
-
-        Constant(final T value) {
-            this.value = value;
-        }
-
+    record Constant<T>(T value) implements Lazy<T> {
         @Override
         public T get() {
             return value;