This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia.git
The following commit(s) were added to refs/heads/master by this push:
new d3d942e9 Simplify containsAttributes with a stream
d3d942e9 is described below
commit d3d942e99d3a03a578fc612e30134de9f87a38b7
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Thu Nov 19 01:20:11 2026 +0100
Simplify containsAttributes with a stream
---
.../org/apache/maven/doxia/sink/SinkEventAttributeSet.java | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git
a/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/SinkEventAttributeSet.java
b/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/SinkEventAttributeSet.java
index 7546866f..2e79140d 100644
---
a/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/SinkEventAttributeSet.java
+++
b/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/SinkEventAttributeSet.java
@@ -256,16 +256,8 @@ public class SinkEventAttributeSet implements
SinkEventAttributes, Cloneable {
@Override
public boolean containsAttributes(AttributeSet attributes) {
- boolean result = true;
-
- Enumeration<?> names = attributes.getAttributeNames();
-
- while (result && names.hasMoreElements()) {
- Object name = names.nextElement();
- result = attributes.getAttribute(name).equals(getAttribute(name));
- }
-
- return result;
+ return Collections.list(attributes.getAttributeNames()).stream()
+ .allMatch(name ->
attributes.getAttribute(name).equals(getAttribute(name)));
}
/**