We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f1e3e2f commit c4c941eCopy full SHA for c4c941e
log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java
@@ -506,6 +506,9 @@ private static void closeListenerSafely(final StatusListener listener) {
506
* @return a thread-safe read-only collection of buffered events
507
*/
508
public List<StatusData> getStatusData() {
509
+ // Wrapping the buffer clone with an unmodifiable list.
510
+ // By disallowing modifications, we make it clear to the user that mutations will not get propagated.
511
+ // `Collections.unmodifiableList(new ArrayList<>(...))` should be replaced with `List.of()` in Java 9+.
512
return Collections.unmodifiableList(new ArrayList<>(buffer));
513
}
514
0 commit comments