You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by pk...@apache.org on 2024/12/29 09:44:22 UTC
(logging-log4j2) 08/29: Document `log4j-api` changes in version 2.8
This is an automated email from the ASF dual-hosted git repository.
pkarwasz pushed a commit to branch doc/2.x/since-tag
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
commit d6fa8c83b21cd42a79c35af6f794b15b551eed0b
Author: Piotr P. Karwasz <pi...@karwasz.org>
AuthorDate: Sun Dec 29 07:00:38 2024 +0100
Document `log4j-api` changes in version 2.8
---
.../src/main/java/org/apache/logging/log4j/message/MapMessage.java | 2 ++
.../java/org/apache/logging/log4j/message/StructuredDataMessage.java | 1 +
.../java/org/apache/logging/log4j/spi/DefaultThreadContextMap.java | 3 +++
.../src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java | 2 ++
.../main/java/org/apache/logging/log4j/util/SortedArrayStringMap.java | 3 +++
.../src/main/java/org/apache/logging/log4j/util/StringBuilders.java | 2 ++
6 files changed, 13 insertions(+)
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
index 7c0be68e47..12b36af341 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
@@ -79,6 +79,7 @@ public class MapMessage<M extends MapMessage<M, V>, V> implements MultiFormatStr
*
* @param format a MapFormat name
* @return a MapFormat
+ * @since 2.8
*/
public static MapFormat lookupIgnoreCase(final String format) {
return XML.name().equalsIgnoreCase(format)
@@ -96,6 +97,7 @@ public class MapMessage<M extends MapMessage<M, V>, V> implements MultiFormatStr
* All {@code MapFormat} names.
*
* @return All {@code MapFormat} names.
+ * @since 2.8
*/
public static String[] names() {
return new String[] {XML.name(), JSON.name(), JAVA.name(), JAVA_UNQUOTED.name()};
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataMessage.java
index 75ca3ef301..a282d101a3 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataMessage.java
@@ -318,6 +318,7 @@ public class StructuredDataMessage extends MapMessage<StructuredDataMessage, Str
* @param structuredDataId The SD-ID as described in RFC 5424. If null the value in the StructuredData
* will be used.
* @param sb The StringBuilder to append the formatted message to.
+ * @since 2.8
*/
public final void asString(final Format format, final StructuredDataId structuredDataId, final StringBuilder sb) {
final boolean full = Format.FULL.equals(format);
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/spi/DefaultThreadContextMap.java b/log4j-api/src/main/java/org/apache/logging/log4j/spi/DefaultThreadContextMap.java
index 471dba72fd..f8ea436284 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/spi/DefaultThreadContextMap.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/spi/DefaultThreadContextMap.java
@@ -97,6 +97,9 @@ public class DefaultThreadContextMap implements ThreadContextMap, ReadOnlyString
}
}
+ /**
+ * @since 2.8
+ */
public void removeAll(final Iterable<String> keys) {
final Object[] state = localState.get();
if (state != null) {
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java
index 2679cd44f4..33c276a28b 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java
@@ -228,6 +228,7 @@ public final class PropertiesUtil {
*
* @param name the name of the property to look up
* @return the Charset value of the property or {@link Charset#defaultCharset()} if undefined.
+ * @since 2.8
*/
public Charset getCharsetProperty(final String name) {
return getCharsetProperty(name, Charset.defaultCharset());
@@ -240,6 +241,7 @@ public final class PropertiesUtil {
* @param name the name of the property to look up
* @param defaultValue the default value to use if the property is undefined
* @return the Charset value of the property or {@code defaultValue} if undefined.
+ * @since 2.8
*/
public Charset getCharsetProperty(final String name, final Charset defaultValue) {
final String charsetName = getStringProperty(name);
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/SortedArrayStringMap.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/SortedArrayStringMap.java
index 2d2a67c257..ac6b3ed199 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/SortedArrayStringMap.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/SortedArrayStringMap.java
@@ -109,6 +109,9 @@ public class SortedArrayStringMap implements IndexedStringMap {
}
}
+ /**
+ * @since 2.8
+ */
public SortedArrayStringMap(final Map<String, ?> map) {
resize(ceilingNextPowerOfTwo(map.size()));
for (final Map.Entry<String, ?> entry : map.entrySet()) {
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java
index 2fd901cfe3..9a72fa6245 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java
@@ -157,6 +157,7 @@ public final class StringBuilders {
* @param rightOffset start index in the right CharSequence
* @param rightLength length of the section in the right CharSequence
* @return true if equal, false otherwise
+ * @since 2.8
*/
public static boolean equals(
final CharSequence left,
@@ -187,6 +188,7 @@ public final class StringBuilders {
* @param rightOffset start index in the right CharSequence
* @param rightLength length of the section in the right CharSequence
* @return true if equal ignoring case, false otherwise
+ * @since 2.8
*/
public static boolean equalsIgnoreCase(
final CharSequence left,