Skip to content

Commit 75d94ef

Browse files
committed
Backport the InternalApi annotation
Signed-off-by: Matt Sicker <[email protected]>
1 parent f8cd0cc commit 75d94ef

File tree

12 files changed

+44
-0
lines changed

12 files changed

+44
-0
lines changed

log4j-api/src/main/java/org/apache/logging/log4j/util/Activator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
*/
4949
@Header(name = Constants.BUNDLE_ACTIVATOR, value = "${@class}")
5050
@Header(name = Constants.BUNDLE_ACTIVATIONPOLICY, value = Constants.ACTIVATION_LAZY)
51+
@InternalApi
5152
public class Activator implements BundleActivator, SynchronousBundleListener {
5253

5354
private static final SecurityManager SECURITY_MANAGER = System.getSecurityManager();

log4j-api/src/main/java/org/apache/logging/log4j/util/Chars.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
/**
2020
* <em>Consider this class private.</em>
2121
*/
22+
@InternalApi
2223
public final class Chars {
2324

2425
/** Carriage Return. */

log4j-api/src/main/java/org/apache/logging/log4j/util/EnglishEnums.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
* avoid problems on the Turkish locale. Do not use with Turkish enum values.
3131
* </p>
3232
*/
33+
@InternalApi
3334
public final class EnglishEnums {
3435

3536
private EnglishEnums() {
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to you under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package org.apache.logging.log4j.util;
18+
19+
import java.lang.annotation.Documented;
20+
import java.lang.annotation.Retention;
21+
import java.lang.annotation.RetentionPolicy;
22+
23+
/**
24+
* Indicates that the annotated element is considered an internal API to Log4j and should not be used by external
25+
* code. Internal APIs do not provide any stability guarantees between versions.
26+
*
27+
* @since 2.22.0
28+
*/
29+
@Retention(RetentionPolicy.CLASS)
30+
@Documented
31+
public @interface InternalApi {
32+
}

log4j-api/src/main/java/org/apache/logging/log4j/util/ProviderUtil.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
* container framework, any Log4j Providers not accessible through standard classpath scanning should
3939
* {@link #loadProvider(java.net.URL, ClassLoader)} a classpath accordingly.
4040
*/
41+
@InternalApi
4142
@ServiceConsumer(value = Provider.class, resolution = Resolution.OPTIONAL, cardinality = Cardinality.MULTIPLE)
4243
public final class ProviderUtil {
4344

log4j-api/src/main/java/org/apache/logging/log4j/util/ServiceLoaderUtil.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
/**
4141
* This class should be considered internal.
4242
*/
43+
@InternalApi
4344
public final class ServiceLoaderUtil {
4445

4546
private static final int MAX_BROKEN_SERVICES = 8;

log4j-api/src/main/java/org/apache/logging/log4j/util/SortedArrayStringMap.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
*
5151
* @since 2.7
5252
*/
53+
@InternalApi
5354
public class SortedArrayStringMap implements IndexedStringMap {
5455

5556
/**

log4j-api/src/main/java/org/apache/logging/log4j/util/StackLocator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
* examination of every virtual frame of execution.
4747
* </p>
4848
*/
49+
@InternalApi
4950
public final class StackLocator {
5051

5152
/** TODO Consider removing now that we require Java 8. */

log4j-api/src/main/java/org/apache/logging/log4j/util/StackLocatorUtil.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
/**
2626
* <em>Consider this class private.</em> Provides various methods to determine the caller class. <h3>Background</h3>
2727
*/
28+
@InternalApi
2829
public final class StackLocatorUtil {
2930
private static StackLocator stackLocator = null;
3031
private static volatile boolean errorLogged;

log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
/**
2424
* <em>Consider this class private.</em>
2525
*/
26+
@InternalApi
2627
public final class StringBuilders {
2728

2829
private static final Class<?> timeClass;

0 commit comments

Comments
 (0)