This is an automated email from the ASF dual-hosted git repository.
sseifert pushed a commit to branch master
in repository
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-contentparser-json.git
The following commit(s) were added to refs/heads/master by this push:
new d32e6ad cosmetic: simplify code using Java 11 Set.of feature
d32e6ad is described below
commit d32e6adb89ebb6f1b271cc3b7a658269d5dd5f65
Author: Stefan Seifert <[email protected]>
AuthorDate: Tue Apr 9 12:24:13 2024 +0200
cosmetic: simplify code using Java 11 Set.of feature
---
.../java/org/apache/sling/contentparser/json/JSONParserOptions.java | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git
a/src/main/java/org/apache/sling/contentparser/json/JSONParserOptions.java
b/src/main/java/org/apache/sling/contentparser/json/JSONParserOptions.java
index baa6939..a704035 100644
--- a/src/main/java/org/apache/sling/contentparser/json/JSONParserOptions.java
+++ b/src/main/java/org/apache/sling/contentparser/json/JSONParserOptions.java
@@ -19,7 +19,6 @@
package org.apache.sling.contentparser.json;
import java.util.Arrays;
-import java.util.Collections;
import java.util.EnumSet;
import java.util.Set;
@@ -36,8 +35,7 @@ public final class JSONParserOptions extends ParserOptions {
/**
* List of JSON parser features activated by default.
*/
- public static final Set<JSONParserFeature> DEFAULT_JSON_PARSER_FEATURES =
-
Collections.unmodifiableSet(EnumSet.of(JSONParserFeature.COMMENTS));
+ public static final Set<JSONParserFeature> DEFAULT_JSON_PARSER_FEATURES =
Set.of(JSONParserFeature.COMMENTS);
private Set<JSONParserFeature> features = DEFAULT_JSON_PARSER_FEATURES;
@@ -70,6 +68,6 @@ public final class JSONParserOptions extends ParserOptions {
* @return the features the JSON parser should apply when parsing files
*/
public Set<JSONParserFeature> getFeatures() {
- return EnumSet.copyOf(features);
+ return Set.copyOf(features);
}
}