From bc347d2c19311db90925f187f6b6a5ae422e3af2 Mon Sep 17 00:00:00 2001 From: "John J. Aylward" Date: Tue, 2 Oct 2018 13:14:22 -0400 Subject: [PATCH] cleanup of minor warnings --- JSONArray.java | 2 +- JSONPointer.java | 4 ++-- JSONWriter.java | 1 - XMLTokener.java | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/JSONArray.java b/JSONArray.java index dd22046..9314438 100644 --- a/JSONArray.java +++ b/JSONArray.java @@ -1491,7 +1491,7 @@ public class JSONArray implements Iterable { * @return true if JSONArray is empty, otherwise false. */ public boolean isEmpty() { - return myArrayList.isEmpty(); + return this.myArrayList.isEmpty(); } } diff --git a/JSONPointer.java b/JSONPointer.java index fc0b04b..df06f22 100644 --- a/JSONPointer.java +++ b/JSONPointer.java @@ -233,8 +233,8 @@ public class JSONPointer { int index = Integer.parseInt(indexToken); JSONArray currentArr = (JSONArray) current; if (index >= currentArr.length()) { - throw new JSONPointerException(format("index %d is out of bounds - the array has %d elements", index, - currentArr.length())); + throw new JSONPointerException(format("index %s is out of bounds - the array has %d elements", indexToken, + Integer.valueOf(currentArr.length()))); } try { return currentArr.get(index); diff --git a/JSONWriter.java b/JSONWriter.java index 8ef6084..a30a222 100644 --- a/JSONWriter.java +++ b/JSONWriter.java @@ -1,7 +1,6 @@ package org.json; import java.io.IOException; -import java.math.BigDecimal; import java.util.Collection; import java.util.Map; diff --git a/XMLTokener.java b/XMLTokener.java index 50e3acc..8490bec 100644 --- a/XMLTokener.java +++ b/XMLTokener.java @@ -135,7 +135,7 @@ public class XMLTokener extends JSONTokener { * @return A Character or an entity String if the entity is not recognized. * @throws JSONException If missing ';' in XML entity. */ - public Object nextEntity(char ampersand) throws JSONException { + public Object nextEntity(@SuppressWarnings("unused") char ampersand) throws JSONException { StringBuilder sb = new StringBuilder(); for (;;) { char c = next();