ErrLookup › google/gson

google/gson

A Java serialization/deserialization library to convert Java Objects into JSON and back · Java · 103 source files

Analyzed at 8b8628c656 on 2026-08-04. 143 documented errors.

Code / MessageTypeSeverityTags
types and labels must be unique
exception error runtime-type-adapter, polymorphic, configuration, duplicate-registration
cannot deserialize {baseType} because it does not define a f
exception error runtime-type-adapter, polymorphic, deserialization, missing-field
cannot deserialize {baseType} subtype named {label}; did you
exception error runtime-type-adapter, polymorphic, deserialization, unregistered-subtype, untrusted-input
cannot serialize {srcType.getName()}; did you forget to regi
exception error runtime-type-adapter, polymorphic, serialization, unregistered-subtype
cannot serialize {srcType.getName()} because it already defi
exception error runtime-type-adapter, polymorphic, serialization, field-collision, naming
No time zone indicator
exception error date, iso8601, utc-adapter, parsing, missing-timezone
Invalid time zone indicator {timezoneIndicator}
exception error date, iso8601, utc-adapter, parsing, invalid-timezone
Failed to parse date [{input}]: {fail.getMessage()}
exception error date, iso8601, utc-adapter, parsing, parse-exception
{value}
exception error date, iso8601, utc-adapter, parsing, number-format, truncated-input
Invalid number: {value}
exception error date, iso8601, utc-adapter, parsing, number-format, non-digit
Only combinations of \n and \r are allowed in newline.
exception error formatting, newline, pretty-print, configuration, validation
Only combinations of spaces and tabs are allowed in indent.
exception error formatting, indent, pretty-print, configuration, validation
GSON ({GsonBuildConfig.VERSION}) cannot handle {type}
exception error gson-core, type-adapter, reflection, no-adapter, configuration
GSON cannot serialize or deserialize {type}
exception error gson-core, type-adapter, delegate, factory-ordering, configuration
Type adapter '{typeAdapter}' returned wrong type; requested
exception error gson-core, type-adapter, classcast, deserialization, contract-violation
JSON document was not fully consumed.
exception error gson-core, deserialization, trailing-data, json-reader, ndjson
Adapter for type with cyclic dependency has been used before
exception critical gson-core, type-adapter, cyclic-dependency, threading, initialization
Invalid version: {version}
exception error gson-builder, versioning, configuration, validation, since-until
The date pattern '{pattern}' is not valid
exception error gson-builder, date-format, configuration, simpledateformat, validation
Invalid style: {style}
exception error gson, date-format, configuration, validation
Class {typeAdapter.getClass().getName()} does not implement
exception error gson, type-adapter, configuration, registration
Cannot override built-in adapter for {type}
exception error gson, type-adapter, object-class, configuration
Array must have size 1, but has size {size}
exception error gson, json-array, parsing, type-mismatch
Not a JSON Object: {this}
exception error gson, json-element, type-mismatch, parsing
Not a JSON Array: {this}
exception error gson, json-element, type-mismatch, parsing
Not a JSON Primitive: {this}
exception error gson, json-element, type-mismatch, parsing
Not a JSON Null: {this}
exception error gson, json-element, type-mismatch, null-handling
{getClass().getSimpleName()}
exception error gson, json-element, type-mismatch, boolean
Did not consume the entire document.
exception error parsing, malformed-json, strictness
Failed parsing JSON source: {reader} to Json
exception critical parsing, resource-exhaustion, stack-overflow, oom
Primitive is neither a number nor a string
exception error json-tree, type-coercion, unsupported-operation
String value is empty
exception warning json-tree, deprecated, type-coercion
Failed parsing JSON source to Json
exception critical parsing, streaming, resource-exhaustion, stack-overflow, oom
JSON forbids NaN and infinities: {d}; at path {in.getPreviou
exception error deserialization, numbers, strictness, malformed-json
Cannot parse {value}; at path {in.getPreviousPath()}
exception error deserialization, numbers, number-format, malformed-json
Invalid EnumSet type: {type}
exception error deserialization, enum, generic-types, reflection
Invalid EnumMap type: {type}
exception error deserialization, enum, map, generic-types, reflection
Failed to invoke constructor '{constructor}' with no args
exception critical deserialization, reflection, instantiation, abstract-type
Unable to create instance of {rawType}. Registering an Insta
exception critical deserialization, reflection, unsafe, instantiation, jdk-compat
Expected a Class, ParameterizedType, or GenericArrayType, bu
exception error type-resolution, generic-types, reflection, illegal-argument
{contextRawType} is not the same as or a subtype of {superty
exception error type-resolution, generic-types, reflection, illegal-argument, invariant
Primitive type is not allowed
exception error gson, generics, reflection, primitive, type-argument
Must specify owner type for {rawType}
exception error gson, generics, reflection, inner-class, owner-type
At most one lower bound is supported
exception error gson, generics, reflection, wildcard, type-bound
Exactly one upper bound must be specified
exception error gson, generics, reflection, wildcard, type-bound
When lower bound is specified, upper bound must be Object
exception error gson, generics, reflection, wildcard, type-bound
Deserialization is unsupported
exception error gson, serialization, internal, number, invalidobjectexception
key == null
exception error gson, collection, linkedtreemap, null, map
value == null
exception error gson, collection, linkedtreemap, null, map
{className} is not Comparable
exception error gson, collection, linkedtreemap, comparable, classcastexception
Deserialization is unsupported
exception error gson, serialization, internal, linkedtreemap, invalidobjectexception
Element must be non-null
exception error gson, collection, list, null, nonnull
Number string too large: {value}...
exception error gson, number, dos, numberformatexception, limits
Number has unsupported scale: {s}
exception error gson, number, dos, numberformatexception, limits, bigdecimal
Unknown DateFormat style: {dateStyle}
exception error gson, date, dateformat, illegalargumentexception, pre-java9
Unknown DateFormat style: {timeStyle}
exception error gson, date, dateformat, illegalargumentexception, pre-java9
Failed invoking canAccess
exception error reflection, java-modules, jpms, security-manager, runtime
Cannot allocate {c}. Usage of JDK sun.misc.Unsafe is enabled
exception error reflection, unsafe, jpms, deserialization, runtime
Failed parsing '{s}' as Date; at path {path}
exception error date, deserialization, format, locale
Missing id or totalSeconds field; at path {path}
exception error java-time, zoneid, deserialization, interoperability
Missing {fieldName} field; at path {path}
exception error java-time, deserialization, missing-field, data-contract
Invalid attempt to bind an instance of {className} as a @Jso
exception error jsonadapter, annotation, type-adapter, configuration
Unexpected token: {peeked}
exception error jsonelement, json-parsing, reader-state, streaming
Couldn't write {class}
exception error jsonelement, serialization, subclass, tree
JsonReader is closed
exception error jsonreader, lifecycle, io, json-tree
Custom JsonElement subclass {className} is not supported
exception error jsonelement, json-tree, subclass, reader
Expected {expected} but was {peek}{location}
exception error jsonreader, json-tree, structure, type-adapter
Expected STRING but was {token}{location}
exception error jsonreader, json-tree, string, type-adapter
Expected NUMBER but was {token}{location}
exception error jsonreader, json-tree, number, type-adapter
JSON forbids NaN and infinities: {result}
exception error jsonreader, json-tree, number, lenient, spec
Unexpected {peeked} when reading a JsonElement.
exception error json, streaming, gson, reader-state, type-adapter
String contains non-ASCII characters: {s}{location}
exception error json, parsing, encoding, ascii, numeric, gson
Expected one JSON element but was {stack}
exception error json, streaming, writer-state, gson, resource-leak
Did not expect a name
exception error json, streaming, writer-state, gson, object-shape
Please begin an object before writing a name.
exception error json, streaming, writer-state, gson, container-mismatch
JSON forbids NaN and infinities: {value}
exception error json, numeric, nan, infinity, gson, serialization
Incomplete document
exception error json, streaming, writer-state, gson, resource-management, io
duplicate key: {key}
exception error json, gson, deserialization, map, duplicate-key, complex-keys
Expecting number, got: " + jsonToken + "; at path " + in.get
exception error json, gson, deserialization, numeric, type-mismatch
Unexpected token: " + peeked
exception error json, gson, deserialization, reader-state, object-adapter
ReflectionAccessFilter does not permit using reflection for
exception error json, gson, reflection, security, access-filter, type-adapter
memberDescription + " is not accessible and ReflectionAccess
exception error gson, reflection, access-filter, jpms, serialization
Accessor " + accessorDescription + " threw exception
exception error gson, record, serialization, accessor, invocation-target
null is not allowed as value for record component '" + field
exception error gson, record, deserialization, primitive, null
Cannot set value of 'static final' " + fieldDescription
exception error gson, deserialization, static-final, reflection, modifiers
Class " + declaringType.getName() + " declares multiple JSON
exception error gson, serializedname, duplicate, inheritance, field-naming
ReflectionAccessFilter does not permit using reflection for
exception error gson, reflection, access-filter, inheritance, supertype
@SerializedName on " + methodDescription + " is not supporte
exception error gson, record, serializedname, annotation, accessor
Could not find the index in the constructor '" + ReflectionH
exception error gson, record, internal, reflection, obfuscation
Failed to invoke constructor '" + ReflectionHelper.construct
exception error gson, record, constructor, typeadapter, deserialization
Type adapter " + typeAdapter.getClass().getName() + " must i
exception error gson, typeadapter, jsonserializer, jsondeserializer, factory
Attempted to serialize java.lang.Class: " + value.getName()
exception error gson, serialization, class, unsupported, typeadapter
Attempted to deserialize a java.lang.Class. Forgot to regist
exception error gson, deserialization, class, unsupported, security
Invalid bitset value " + intValue + ", expected 0 or 1; at p
exception error gson, bitset, deserialization, number, validation
Invalid bitset value type: " + tokenType + "; at path " + in
exception error gson, bitset, deserialization, jsontoken, malformed
Lossy conversion from " + intValue + " to byte; at path " +
exception error gson, byte, deserialization, number, range
Lossy conversion from " + intValue + " to short; at path " +
exception error gson, short, deserialization, number, range
null is not a valid AtomicLongArray element
exception error gson, atomiclongarray, deserialization, null, number
value + " is not a valid double value as per JSON specificat
exception error gson, serialization, double, float, nan, infinity
Expecting character, got: " + str + "; at " + in.getPrevious
exception error gson, character, deserialization, string, validation
Failed parsing '" + s + "' as BigDecimal; at path " + in.get
exception error gson, deserialization, big-decimal, json, number-parsing
Failed parsing '" + s + "' as BigInteger; at path " + in.get
exception error gson, deserialization, big-integer, json, number-parsing
Failed parsing '" + s + "' as InetAddress; at path " + in.ge
exception error gson, deserialization, inet-address, networking, security, dns
Failed parsing '" + s + "' as UUID; at path " + in.getPrevio
exception error gson, deserialization, uuid, json
Failed parsing '" + s + "' as Currency; at path " + in.getPr
exception error gson, deserialization, currency, i18n, json
Too big for an int: " + x
exception error gson, deserialization, calendar, integer-overflow, json
Expected a " + requestedType.getName() + " but was " + resul
exception error gson, deserialization, type-hierarchy, type-mismatch, json
No time zone indicator
exception error gson, date-parsing, iso8601, timezone, json
Mismatching time zone indicator: " + timezoneId + " given, r
exception error gson, date-parsing, iso8601, timezone, json
Invalid time zone indicator '" + timezoneIndicator + "'
exception error gson, date-parsing, iso8601, timezone, json
value
exception error gson, date-parsing, iso8601, json
Invalid number: " + value.substring(beginIndex, endIndex)
exception error gson, date-parsing, iso8601, json
Failed making " + description + " accessible; either increas
exception error gson, reflection, jpms, java-modules, encapsulation
Unexpected IllegalAccessException occurred (Gson " + GsonBui
exception error gson, reflection, runtime, java-version, bug-report
Unexpected ReflectiveOperationException occurred (Gson " + G
exception error gson, reflection, java-records, java-version, bug-report
Failed parsing '" + s + "' as SQL Date; at path " + in.getPr
exception error gson, deserialization, sql-date, date-parsing, locale, json
Failed parsing '" + s + "' as SQL Time; at path " + in.getPr
exception error gson, deserialization, sql-time, date-parsing, locale, json
TypeToken must be created with a type argument: new TypeToke
exception error gson, type-token, proguard, r8, generics, android
Must only create direct subclasses of TypeToken
exception error gson, type-token, generics, inheritance
TypeToken type argument must not contain a type variable; ca
exception error gson, typetoken, generics, reflection, type-erasure
TypeToken captured `null` as type argument; probably a compi
exception error gson, typetoken, compiler-bug, eclipse-jdt, reflection
rawType must be of type Class, but was " + rawType
exception error gson, typetoken, reflection, api-misuse
rawClass.getName() + " requires " + expectedArgsCount + " ty
exception error gson, typetoken, generics, validation
Raw type " + rawClass.getName() + " is not supported because
exception error gson, typetoken, inner-class, reflection
Type argument " + typeArgument + " does not satisfy bounds f
exception error gson, typetoken, generics, type-bounds, validation
Invalid nesting limit: " + limit
exception error gson, jsonreader, validation, configuration
JsonReader is closed
exception error gson, jsonreader, lifecycle, resource-management
Expected a long but was " + peekedString + locationString()
exception error gson, jsonreader, number-parsing, precision
Expected an int but was " + peekedLong + locationString()
exception error gson, jsonreader, number-parsing, overflow, int-range
Expected an int but was " + peekedString + locationString()
exception error gson, jsonreader, number-parsing, type-mismatch
Nesting limit " + nestingLimit + " reached" + locationString
exception error gson, jsonreader, nesting-limit, security, dos-protection
End of input" + locationString()
exception error gson, jsonreader, eof, malformed-json, truncated-input
Nesting problem.
exception error gson, jsonwriter, nesting, state-machine, api-misuse
Dangling name: " + deferredName
exception error gson, jsonwriter, state-machine, conditional-serialization
JsonWriter is closed.
exception error gson, jsonwriter, lifecycle, resource-management
Already wrote a name, expecting a value.
exception error gson, jsonwriter, state-machine, api-misuse
Please begin an object before writing a name.
exception error gson, jsonwriter, state-machine, api-misuse, nesting
Numeric values must be finite, but was " + value
exception error gson, jsonwriter, numeric, nan, infinity, validation
Numeric values must be finite, but was " + string
exception error json, gson, serialization, numeric, strictness
String created by " + numberClass + " is not a valid JSON nu
exception error json, gson, serialization, numeric, custom-type, strictness
Incomplete document
exception error json, gson, lifecycle, serialization, resource-management
JSON must have only one top-level value.
exception error json, gson, serialization, strictness, structure
${message}${locationString()} See ${TroubleshootingGuide.cre
exception error json, gson, parsing, malformed, strictness