From eebcfe8e50b8681f8a1422106b72e25b48d7be12 Mon Sep 17 00:00:00 2001 From: Corby Page Date: Sat, 22 Jun 2024 14:00:14 -0500 Subject: [PATCH] Update to Java 21 (#188) * Setting maven.compiler.release to 21 * Updating nexus staging maven plugin * Updated source/Javadoc plugin --- pom.xml | 84 ++++++++++++++----- .../jsonassert/ArrayValueMatcher.java | 2 +- .../jsonassert/JSONCompareMode.java | 5 +- .../jsonassert/LocationAwareValueMatcher.java | 2 +- .../RegularExpressionValueMatcher.java | 2 +- .../comparator/AbstractComparator.java | 22 +++++ 6 files changed, 92 insertions(+), 25 deletions(-) diff --git a/pom.xml b/pom.xml index 80d19f69..68d0cdac 100644 --- a/pom.xml +++ b/pom.xml @@ -2,21 +2,19 @@ 4.0.0 - - org.sonatype.oss - oss-parent - 7 - - org.skyscreamer jsonassert - 1.5.2-SNAPSHOT + 1.5.2 jar JSONassert A library to develop RESTful but flexible APIs https://github.com/skyscreamer/JSONassert + + 21 + + The Apache Software License, Version 2.0 @@ -60,6 +58,12 @@ 4.13.2 test + + org.hamcrest + hamcrest + 2.2 + test + @@ -67,25 +71,59 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.1 - - 1.8 - 1.8 - + 3.11.0 org.apache.maven.plugins maven-site-plugin - 3.10.0 + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.9.1 + + + attach-javadocs + + jar + + + + + ${java.home}/bin/javadoc + 8 + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.7 + true - - - org.codehaus.mojo - cobertura-maven-plugin - 2.7 - - + ossrh + https://oss.sonatype.org/ + true + + + com.thoughtworks.xstream + xstream + 1.4.15 + + @@ -112,6 +150,10 @@ github-project-site gitsite:git@github.com/skyscreamer/JSONassert.git + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + @@ -128,7 +170,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.0.1 + 1.5 sign-artifacts diff --git a/src/main/java/org/skyscreamer/jsonassert/ArrayValueMatcher.java b/src/main/java/org/skyscreamer/jsonassert/ArrayValueMatcher.java index ea3ebaf8..2d4dd8ec 100644 --- a/src/main/java/org/skyscreamer/jsonassert/ArrayValueMatcher.java +++ b/src/main/java/org/skyscreamer/jsonassert/ArrayValueMatcher.java @@ -133,7 +133,7 @@ *

To simplify complexity of expected JSON string, the value "{a:[[9]]}" may be replaced by "{a:[9]}" or "{a:9}"

* * @author Duncan Mackinder - * + * @param Array Type */ public class ArrayValueMatcher implements LocationAwareValueMatcher { private final JSONComparator comparator; diff --git a/src/main/java/org/skyscreamer/jsonassert/JSONCompareMode.java b/src/main/java/org/skyscreamer/jsonassert/JSONCompareMode.java index d676be45..8185b065 100644 --- a/src/main/java/org/skyscreamer/jsonassert/JSONCompareMode.java +++ b/src/main/java/org/skyscreamer/jsonassert/JSONCompareMode.java @@ -18,7 +18,10 @@ *

These different modes define different behavior for the comparison of JSON for testing. * Each mode encapsulates two underlying behaviors: extensibility and strict ordering.

* - * + *
+ * * * * diff --git a/src/main/java/org/skyscreamer/jsonassert/LocationAwareValueMatcher.java b/src/main/java/org/skyscreamer/jsonassert/LocationAwareValueMatcher.java index 32891b62..cc2b7449 100644 --- a/src/main/java/org/skyscreamer/jsonassert/LocationAwareValueMatcher.java +++ b/src/main/java/org/skyscreamer/jsonassert/LocationAwareValueMatcher.java @@ -21,7 +21,7 @@ * A ValueMatcher extension that provides location in form of prefix to the equals method. * * @author Duncan Mackinder - * + * @param Generic Type */ public interface LocationAwareValueMatcher extends ValueMatcher { diff --git a/src/main/java/org/skyscreamer/jsonassert/RegularExpressionValueMatcher.java b/src/main/java/org/skyscreamer/jsonassert/RegularExpressionValueMatcher.java index 2a9efa54..19a4ef1d 100644 --- a/src/main/java/org/skyscreamer/jsonassert/RegularExpressionValueMatcher.java +++ b/src/main/java/org/skyscreamer/jsonassert/RegularExpressionValueMatcher.java @@ -28,7 +28,7 @@ * specify regular expression pattern that actual value must match. * * @author Duncan Mackinder - * + * @param Generic Type */ public class RegularExpressionValueMatcher implements ValueMatcher { diff --git a/src/main/java/org/skyscreamer/jsonassert/comparator/AbstractComparator.java b/src/main/java/org/skyscreamer/jsonassert/comparator/AbstractComparator.java index 4f68e2d1..45b98a96 100644 --- a/src/main/java/org/skyscreamer/jsonassert/comparator/AbstractComparator.java +++ b/src/main/java/org/skyscreamer/jsonassert/comparator/AbstractComparator.java @@ -26,9 +26,17 @@ /** * This class provides a skeletal implementation of the {@link JSONComparator} * interface, to minimize the effort required to implement this interface. + * + * */ public abstract class AbstractComparator implements JSONComparator { + /** + * Default constructor + */ + public AbstractComparator() { + } + /** * Compares JSONObject provided to the expected JSONObject, and returns the results of the comparison. * @@ -57,6 +65,12 @@ public final JSONCompareResult compareJSON(JSONArray expected, JSONArray actual) return result; } + /** + * @param prefix + * @param expected + * @param actual + * @param result + */ protected void checkJsonObjectKeysActualInExpected(String prefix, JSONObject expected, JSONObject actual, JSONCompareResult result) { Set actualKeys = getKeys(actual); for (String key : actualKeys) { @@ -66,6 +80,14 @@ protected void checkJsonObjectKeysActualInExpected(String prefix, JSONObject exp } } + /** + * + * @param prefix + * @param expected + * @param actual + * @param result + * @throws JSONException + */ protected void checkJsonObjectKeysExpectedInActual(String prefix, JSONObject expected, JSONObject actual, JSONCompareResult result) throws JSONException { Set expectedKeys = getKeys(expected); for (String key : expectedKeys) {
+ * Behavior of JSONCompareMode + *
 ExtensibleStrict Ordering
STRICTnoyes
LENIENTyesno