From 8ca8a8075382780b1fbf5307f8c5154fe6a27ef1 Mon Sep 17 00:00:00 2001 From: Liam Miller-Cushon Date: Wed, 25 Aug 2021 13:56:44 -0700 Subject: [PATCH] Fix some typos --- src/main/java/org/json/Cookie.java | 2 +- src/main/java/org/json/JSONArray.java | 8 ++++---- src/main/java/org/json/JSONObject.java | 6 +++--- src/main/java/org/json/XML.java | 2 +- src/test/java/org/json/junit/EnumTest.java | 2 +- src/test/java/org/json/junit/JSONObjectTest.java | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/java/org/json/Cookie.java b/src/main/java/org/json/Cookie.java index a43d1eddd..1c5fb788c 100644 --- a/src/main/java/org/json/Cookie.java +++ b/src/main/java/org/json/Cookie.java @@ -109,7 +109,7 @@ public static JSONObject toJSONObject(String string) { // parse the remaining cookie attributes while (x.more()) { name = unescape(x.nextTo("=;")).trim().toLowerCase(Locale.ROOT); - // don't allow a cookies attributes to overwrite it's name or value. + // don't allow a cookies attributes to overwrite its name or value. if("name".equalsIgnoreCase(name)) { throw new JSONException("Illegal attribute name: 'name'"); } diff --git a/src/main/java/org/json/JSONArray.java b/src/main/java/org/json/JSONArray.java index 1e6a8a6f9..7e95a96a8 100644 --- a/src/main/java/org/json/JSONArray.java +++ b/src/main/java/org/json/JSONArray.java @@ -385,7 +385,7 @@ public > E getEnum(Class clazz, int index) throws JSONExcep /** * Get the BigDecimal value associated with an index. If the value is float - * or double, the the {@link BigDecimal#BigDecimal(double)} constructor + * or double, the {@link BigDecimal#BigDecimal(double)} constructor * will be used. See notes on the constructor for conversion issues that * may arise. * @@ -792,7 +792,7 @@ public BigInteger optBigInteger(int index, BigInteger defaultValue) { * Get the optional BigDecimal value associated with an index. The * defaultValue is returned if there is no value for the index, or if the * value is not a number and cannot be converted to a number. If the value - * is float or double, the the {@link BigDecimal#BigDecimal(double)} + * is float or double, the {@link BigDecimal#BigDecimal(double)} * constructor will be used. See notes on the constructor for conversion * issues that may arise. * @@ -1157,7 +1157,7 @@ public JSONArray put(int index, long value) throws JSONException { * The Map value. * @return this. * @throws JSONException - * If the index is negative or if the the value is an invalid + * If the index is negative or if the value is an invalid * number. * @throws NullPointerException * If a key in the map is null @@ -1180,7 +1180,7 @@ public JSONArray put(int index, Map value) throws JSONException { * String, or the JSONObject.NULL object. * @return this. * @throws JSONException - * If the index is negative or if the the value is an invalid + * If the index is negative or if the value is an invalid * number. */ public JSONArray put(int index, Object value) throws JSONException { diff --git a/src/main/java/org/json/JSONObject.java b/src/main/java/org/json/JSONObject.java index 5f7a26082..761df1df0 100644 --- a/src/main/java/org/json/JSONObject.java +++ b/src/main/java/org/json/JSONObject.java @@ -645,7 +645,7 @@ public BigInteger getBigInteger(String key) throws JSONException { /** * Get the BigDecimal value associated with a key. If the value is float or - * double, the the {@link BigDecimal#BigDecimal(double)} constructor will + * double, the {@link BigDecimal#BigDecimal(double)} constructor will * be used. See notes on the constructor for conversion issues that may * arise. * @@ -1613,7 +1613,7 @@ private static String getKeyNameFromMethod(Method method) { * @param annotationClass * annotation to look for * @return the {@link Annotation} if the annotation exists on the current method - * or one of it's super class definitions + * or one of its super class definitions */ private static A getAnnotation(final Method m, final Class annotationClass) { // if we have invalid data the result is null @@ -2236,7 +2236,7 @@ protected static Number stringToNumber(final String val) throws NumberFormatExce // This will narrow any values to the smallest reasonable Object representation // (Integer, Long, or BigInteger) - // BigInteger down conversion: We use a similar bitLenth compare as + // BigInteger down conversion: We use a similar bitLength compare as // BigInteger#intValueExact uses. Increases GC, but objects hold // only what they need. i.e. Less runtime overhead if the value is // long lived. diff --git a/src/main/java/org/json/XML.java b/src/main/java/org/json/XML.java index 805a5c376..b7f0c8b2c 100644 --- a/src/main/java/org/json/XML.java +++ b/src/main/java/org/json/XML.java @@ -532,7 +532,7 @@ private static Number stringToNumber(final String val) throws NumberFormatExcept // This will narrow any values to the smallest reasonable Object representation // (Integer, Long, or BigInteger) - // BigInteger down conversion: We use a similar bitLenth compare as + // BigInteger down conversion: We use a similar bitLength compare as // BigInteger#intValueExact uses. Increases GC, but objects hold // only what they need. i.e. Less runtime overhead if the value is // long lived. diff --git a/src/test/java/org/json/junit/EnumTest.java b/src/test/java/org/json/junit/EnumTest.java index ed2c87a6b..686712360 100644 --- a/src/test/java/org/json/junit/EnumTest.java +++ b/src/test/java/org/json/junit/EnumTest.java @@ -93,7 +93,7 @@ public void jsonObjectFromEnum() { /** * To serialize an enum by its set of allowed values, use getNames() - * and the the JSONObject Object with names constructor. + * and the JSONObject Object with names constructor. */ @Test public void jsonObjectFromEnumWithNames() { diff --git a/src/test/java/org/json/junit/JSONObjectTest.java b/src/test/java/org/json/junit/JSONObjectTest.java index 9ddbc2ec2..94c3e4b8f 100644 --- a/src/test/java/org/json/junit/JSONObjectTest.java +++ b/src/test/java/org/json/junit/JSONObjectTest.java @@ -1678,7 +1678,7 @@ public void jsonObjectIncrement() { // correct implementation (with change of behavior) would be: // this.put(key, new Float((Float) value + 1)); // Probably it would be better to deprecate the method and remove some day, while convenient processing the "payload" is not - // really in the the scope of a JSON-library (IMHO.) + // really in the scope of a JSON-library (IMHO.) }