Removed compiler warnings.
This commit is contained in:
parent
10db917e93
commit
7b99419aea
@ -36,7 +36,7 @@ public final class JsonSyntaxException extends JsonParseException {
|
||||
|
||||
/**
|
||||
* Creates exception with the specified cause. Consider using
|
||||
* {@link #JsonIOException(String, Throwable)} instead if you can describe what happened.
|
||||
* {@link #JsonSyntaxException(String, Throwable)} instead if you can describe what happened.
|
||||
*
|
||||
* @param cause root exception that caused this exception to be thrown.
|
||||
*/
|
||||
|
@ -41,6 +41,7 @@ final class LruCache<K, V> extends LinkedHashMap<K, V> implements Cache<K, V> {
|
||||
put(key, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
super.clear();
|
||||
}
|
||||
@ -53,6 +54,7 @@ final class LruCache<K, V> extends LinkedHashMap<K, V> implements Cache<K, V> {
|
||||
return remove(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return super.size();
|
||||
}
|
||||
|
@ -154,8 +154,8 @@ final class Streams {
|
||||
appendable.append((char) i);
|
||||
}
|
||||
|
||||
@Override public void flush() throws IOException {}
|
||||
@Override public void close() throws IOException {}
|
||||
@Override public void flush() {}
|
||||
@Override public void close() {}
|
||||
|
||||
/**
|
||||
* A mutable char sequence pointing at a single char[].
|
||||
|
@ -564,7 +564,7 @@ public final class JsonReader implements Closeable {
|
||||
} catch (NumberFormatException ignored) {
|
||||
double asDouble = Double.parseDouble(value); // don't catch this NumberFormatException
|
||||
result = (long) asDouble;
|
||||
if ((double) result != asDouble) {
|
||||
if (result != asDouble) {
|
||||
throw new NumberFormatException(value);
|
||||
}
|
||||
}
|
||||
@ -599,7 +599,7 @@ public final class JsonReader implements Closeable {
|
||||
} catch (NumberFormatException ignored) {
|
||||
double asDouble = Double.parseDouble(value); // don't catch this NumberFormatException
|
||||
result = (int) asDouble;
|
||||
if ((double) result != asDouble) {
|
||||
if (result != asDouble) {
|
||||
throw new NumberFormatException(value);
|
||||
}
|
||||
}
|
||||
@ -665,6 +665,7 @@ public final class JsonReader implements Closeable {
|
||||
stack.set(stack.size() - 1, newTop);
|
||||
}
|
||||
|
||||
@SuppressWarnings("fallthrough")
|
||||
private JsonToken nextInArray(boolean firstElement) throws IOException {
|
||||
if (firstElement) {
|
||||
replaceTop(JsonScope.NONEMPTY_ARRAY);
|
||||
@ -706,6 +707,7 @@ public final class JsonReader implements Closeable {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("fallthrough")
|
||||
private JsonToken nextInObject(boolean firstElement) throws IOException {
|
||||
/*
|
||||
* Read delimiters. Either a comma/semicolon separating this and the
|
||||
@ -780,6 +782,7 @@ public final class JsonReader implements Closeable {
|
||||
return nextValue();
|
||||
}
|
||||
|
||||
@SuppressWarnings("fallthrough")
|
||||
private JsonToken nextValue() throws IOException {
|
||||
int c = nextNonWhitespace();
|
||||
switch (c) {
|
||||
@ -968,6 +971,7 @@ public final class JsonReader implements Closeable {
|
||||
* Returns the string up to but not including any delimiter characters. This
|
||||
* does not consume the delimiter character.
|
||||
*/
|
||||
@SuppressWarnings("fallthrough")
|
||||
private String nextLiteral() throws IOException {
|
||||
StringBuilder builder = null;
|
||||
do {
|
||||
|
@ -97,7 +97,7 @@ public final class JsonReaderTest extends TestCase {
|
||||
}
|
||||
}
|
||||
|
||||
public void testEmptyString() throws IOException {
|
||||
public void testEmptyString() {
|
||||
try {
|
||||
new JsonReader(new StringReader("")).beginArray();
|
||||
} catch (IOException expected) {
|
||||
@ -108,7 +108,7 @@ public final class JsonReaderTest extends TestCase {
|
||||
}
|
||||
}
|
||||
|
||||
public void testNoTopLevelObject() throws IOException {
|
||||
public void testNoTopLevelObject() {
|
||||
try {
|
||||
new JsonReader(new StringReader("true")).nextBoolean();
|
||||
} catch (IOException expected) {
|
||||
|
Loading…
Reference in New Issue
Block a user