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
|
* @author Joel Leitch
|
||||||
*/
|
*/
|
||||||
public final class $Gson$Preconditions {
|
public final class $Gson$Preconditions {
|
||||||
|
private $Gson$Preconditions() {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
public static <T> T checkNotNull(T obj) {
|
public static <T> T checkNotNull(T obj) {
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
throw new NullPointerException();
|
throw new NullPointerException();
|
||||||
|
@ -43,7 +43,9 @@ import java.util.Properties;
|
|||||||
public final class $Gson$Types {
|
public final class $Gson$Types {
|
||||||
static final Type[] EMPTY_TYPE_ARRAY = new Type[] {};
|
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
|
* Returns a new parameterized type, applying {@code typeArguments} to
|
||||||
|
@ -29,7 +29,9 @@ import java.util.Map;
|
|||||||
* @author Kevin Bourrillion
|
* @author Kevin Bourrillion
|
||||||
*/
|
*/
|
||||||
public final class Primitives {
|
public final class Primitives {
|
||||||
private Primitives() {}
|
private Primitives() {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
/** A map from primitive types to their corresponding wrapper types. */
|
/** A map from primitive types to their corresponding wrapper types. */
|
||||||
private static final Map<Class<?>, Class<?>> PRIMITIVE_TO_WRAPPER_TYPE;
|
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.
|
* Reads and writes GSON parse trees over streams.
|
||||||
*/
|
*/
|
||||||
public final class Streams {
|
public final class Streams {
|
||||||
|
private Streams() {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Takes a reader in any state and returns the next value as a JsonElement.
|
* 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.
|
* Type adapters for basic types.
|
||||||
*/
|
*/
|
||||||
public final class TypeAdapters {
|
public final class TypeAdapters {
|
||||||
private TypeAdapters() {}
|
private TypeAdapters() {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
public static final TypeAdapter<Class> CLASS = new TypeAdapter<Class>() {
|
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(null));
|
||||||
Assert.assertFalse(a.equals(new Object()));
|
Assert.assertFalse(a.equals(new Object()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user