This is an automated email from the ASF dual-hosted git repository. vy pushed a commit to branch recycler-api-3.x in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
commit 3ab7a6971ab468232baeedb13ac5929d3af7281f Author: Volkan Yazıcı <[email protected]> AuthorDate: Mon Mar 20 13:07:43 2023 +0100 Move `RecyclerFactory` type converter to `log4j-plugins` --- .../json/util/RecyclerFactoryConverter.java | 37 ---------------------- .../plugins/convert/TypeConverterFactory.java | 3 ++ 2 files changed, 3 insertions(+), 37 deletions(-) diff --git a/log4j-layout-template-json/src/main/java/org/apache/logging/log4j/layout/template/json/util/RecyclerFactoryConverter.java b/log4j-layout-template-json/src/main/java/org/apache/logging/log4j/layout/template/json/util/RecyclerFactoryConverter.java deleted file mode 100644 index 4d59687208..0000000000 --- a/log4j-layout-template-json/src/main/java/org/apache/logging/log4j/layout/template/json/util/RecyclerFactoryConverter.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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.logging.log4j.layout.template.json.util; - -import org.apache.logging.log4j.plugins.Plugin; -import org.apache.logging.log4j.plugins.convert.TypeConverter; -import org.apache.logging.log4j.plugins.convert.TypeConverters; -import org.apache.logging.log4j.spi.RecyclerFactories; -import org.apache.logging.log4j.spi.RecyclerFactory; - -/** - * The default string (i.e., recycler factory spec) to {@link RecyclerFactory} type converter. - */ -@TypeConverters -@Plugin -public final class RecyclerFactoryConverter implements TypeConverter<RecyclerFactory> { - - @Override - public RecyclerFactory convert(final String recyclerFactorySpec) { - return RecyclerFactories.ofSpec(recyclerFactorySpec); - } - -} diff --git a/log4j-plugins/src/main/java/org/apache/logging/log4j/plugins/convert/TypeConverterFactory.java b/log4j-plugins/src/main/java/org/apache/logging/log4j/plugins/convert/TypeConverterFactory.java index 8332258268..2d800ab728 100644 --- a/log4j-plugins/src/main/java/org/apache/logging/log4j/plugins/convert/TypeConverterFactory.java +++ b/log4j-plugins/src/main/java/org/apache/logging/log4j/plugins/convert/TypeConverterFactory.java @@ -27,6 +27,8 @@ import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.plugins.Inject; import org.apache.logging.log4j.plugins.Singleton; import org.apache.logging.log4j.plugins.util.TypeUtil; +import org.apache.logging.log4j.spi.RecyclerFactories; +import org.apache.logging.log4j.spi.RecyclerFactory; import org.apache.logging.log4j.status.StatusLogger; import org.apache.logging.log4j.util.EnglishEnums; @@ -57,6 +59,7 @@ public class TypeConverterFactory { registerTypeAlias(Integer.class, Integer.TYPE); registerTypeConverter(Long.class, Long::valueOf); registerTypeAlias(Long.class, Long.TYPE); + registerTypeConverter(RecyclerFactory.class, RecyclerFactories::ofSpec); registerTypeConverter(Short.class, Short::valueOf); registerTypeAlias(Short.class, Short.TYPE); registerTypeConverter(String.class, s -> s);
