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 2d1f641 cosmetic: simplify code using Java 11 Set.of feature
2d1f641 is described below
commit 2d1f64192298a9cf2a298749819a45d1d2403d30
Author: Stefan Seifert <[email protected]>
AuthorDate: Tue Apr 9 12:28:02 2024 +0200
cosmetic: simplify code using Java 11 Set.of feature
---
.../org/apache/sling/contentparser/json/JSONParserOptions.java | 10 ++++------
1 file changed, 4 insertions(+), 6 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 a704035..39d2605 100644
--- a/src/main/java/org/apache/sling/contentparser/json/JSONParserOptions.java
+++ b/src/main/java/org/apache/sling/contentparser/json/JSONParserOptions.java
@@ -18,8 +18,6 @@
*/
package org.apache.sling.contentparser.json;
-import java.util.Arrays;
-import java.util.EnumSet;
import java.util.Set;
import org.apache.sling.contentparser.api.ParserOptions;
@@ -46,18 +44,18 @@ public final class JSONParserOptions extends ParserOptions {
* @return this
*/
public JSONParserOptions withFeatures(Set<JSONParserFeature> value) {
- this.features = EnumSet.copyOf(value);
+ this.features = Set.copyOf(value);
return this;
}
/**
* Set the features the JSON parser should apply when parsing files.
*
- * @param value JSON parser features
+ * @param values JSON parser features
* @return this
*/
- public JSONParserOptions withFeatures(JSONParserFeature... value) {
- this.features = EnumSet.copyOf(Arrays.asList(value));
+ public JSONParserOptions withFeatures(JSONParserFeature... values) {
+ this.features = Set.of(values);
return this;
}