Merge pull request #689 from vbauer/util-classes
Add unit tests for constructors from util classes
This commit is contained in:
commit
87717662f7
@ -30,6 +30,10 @@ package com.google.gson.internal;
|
||||
* @author Joel Leitch
|
||||
*/
|
||||
public final class $Gson$Preconditions {
|
||||
private $Gson$Preconditions() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public static <T> T checkNotNull(T obj) {
|
||||
if (obj == null) {
|
||||
throw new NullPointerException();
|
||||
|
@ -43,7 +43,9 @@ import java.util.Properties;
|
||||
public final class $Gson$Types {
|
||||
static final Type[] EMPTY_TYPE_ARRAY = new Type[] {};
|
||||
|
||||
private $Gson$Types() {}
|
||||
private $Gson$Types() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new parameterized type, applying {@code typeArguments} to
|
||||
|
@ -29,7 +29,9 @@ import java.util.Map;
|
||||
* @author Kevin Bourrillion
|
||||
*/
|
||||
public final class Primitives {
|
||||
private Primitives() {}
|
||||
private Primitives() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/** A map from primitive types to their corresponding wrapper types. */
|
||||
private static final Map<Class<?>, Class<?>> PRIMITIVE_TO_WRAPPER_TYPE;
|
||||
|
@ -33,6 +33,10 @@ import java.io.Writer;
|
||||
* Reads and writes GSON parse trees over streams.
|
||||
*/
|
||||
public final class Streams {
|
||||
private Streams() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes a reader in any state and returns the next value as a JsonElement.
|
||||
*/
|
||||
|
@ -55,7 +55,9 @@ import com.google.gson.stream.JsonWriter;
|
||||
* Type adapters for basic types.
|
||||
*/
|
||||
public final class TypeAdapters {
|
||||
private TypeAdapters() {}
|
||||
private TypeAdapters() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public static final TypeAdapter<Class> CLASS = new TypeAdapter<Class>() {
|
||||
|
@ -69,4 +69,5 @@ public class MoreAsserts {
|
||||
Assert.assertFalse(a.equals(null));
|
||||
Assert.assertFalse(a.equals(new Object()));
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user