* Fix `OperatorPrecedence` warn in `JsonWriter#close`
* Fix `ReferenceEquality` warn in `LinkedTreeMap#replaceInParent`
* Fix `UnnecessaryParentheses` warn in `LinkedTreeMap#replaceInParent`
* Fix `ReferenceEquality` warn in `LinkedTreeMap#hasNext`
* Fix `ReferenceEquality` warn in `LinkedTreeMap#nextNode`
* Adds `error_prone_annotations` to the `pom.xml` of `gson`
* Fix `InlineMeSuggester` warns in `JsonParser`
* Fix `UnnecessaryParentheses` warns in `ConstructorConstructor#newDefaultImplementationConstructor`
* Fix `ThreadLocalUsage` warn in `Gson`
* Fix `JdkObsolete` warn in `GsonBuilder`
* Fix `ReferenceEquality` warn in `LazilyParsedNumber#equals`
* Fix `OperatorPrecedence` warn in `TreeTypeAdapter#create`
* Fix `OperatorPrecedence` warn in `ArrayTypeAdapter`
* Fix `UnnecessaryParentheses` warn in `TypeAdapters`
* Adds `-XepExcludedPaths` flag to ErrorProne plugin to exclude tests and proto path
* Fix `ClassNewInstance` warn in `InterceptorAdapter`
* Fix `ThreadLocalUsage` warn in `GraphAdapterBuilder`
* Fix `JdkObsolete` warn in `GraphAdapterBuilder`
* Revert "Adds `error_prone_annotations` to the `pom.xml` of `gson`"
This reverts commit 14af14dfa23b46a54f4855a70ccf2b0a2cdc3e3f.
* Revert "Fix `InlineMeSuggester` warns in `JsonParser`"
This reverts commit 095bfd517e06510e4cc9cc6b1aac58ad9bf3038a.
* Adds `@SuppressWarnings("ThreadLocalUsage")`
* Fix `OperatorPrecedence` in `JsonWriter`
* Revert "Fix `ReferenceEquality` warn in `LinkedTreeMap#nextNode`"
This reverts commit 387746c7f7e3d0943c8f80501f5d9c3710f4862e.
* Adds `@SuppressWarnings("ReferenceEquality")`
* Adds `guava-testlib` to the gson `pom.xml`
* `@SuppressWarnings("TruthSelfEquals")` removed to use `EqualsTester()`
* Add settings for kind of newline to use
* Fix amp in javadoc
* Fixing link in javadoc
* Doc: use JSON instead of Json
Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>
* PR Feedback: Objects.requireNonNull
Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>
* PR Feedback: $next-version$, don't hardcode
Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>
* s/testNewlineLF/testNewlineLf/
Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>
* Implement PR feedback
* Round two of review
* Restore copyright year, no reason to update
* Rename OS named enum values to CR and LF
* Add javadoc to NewlineStyle.getValue()
* Implement PR feedback, round 2
* Fix typo
Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>
* No need for line break
Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>
* Shorter, cleaner doc
Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>
* Using a FormattingStyle for pretty print
* Fix Junit4 and Truth after merge from master
* Implement review feedback
* Double backslash in message
---------
Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>
* Adds Error Prone to the `pom.xml`
* Adds Error Prone annotations to avoid compiling errors
* Adds profile to run Error Prone in JDK8
* Revert "Adds profile to run Error Prone in JDK8"
This reverts commit 61771d0da55003ea5bc8c6f086d925aec583c9a2.
* Fix Error Prone warn
* Add comment to `pom.xml`
* Fix the `@SuppressWarnings("GetClassOnClass")`
* Replace the Error Prone link in the `pom.xml`
* Disable Error Prone with jdk-15`
* Remove a new-line in `pom.xml`
* Port Junit assert to Truth in `com.google.gson.stream`
* Port Junit assert to Truth in `com.google.gson.regression`
* Port Junit assert to Truth in `om.google.gson.reflect`
* Port Junit assert to Truth in `com.google.gson.metrics`
* Port Junit assert to Truth in `com.google.gson.internal`
* Port Junit assert to Truth in `com.google.gson.internal.sql`
* Port Junit assert to Truth in `com.google.gson.internal.reflect`
* Port Junit assert to Truth in `com.google.gson.internal.bind`
* Port Junit assert to Truth in `com.google.gson.internal.bind.util`
* Port Junit assert to Truth in `com.google.gson.functional`
* Replaces `List.of` with `Arrays.asList` to grant legacy
* Simplify `==` asserts
* Simplify `.contain()` asserts + Minor fixes
* Simplify asserts
* Add the Truth dependency
* Port Junit test to Truth in the package `com.google.gson` of the module `gson`
* Replace the `assertThat(e.getMessage()).isEqualTo(...)"` with `assertThat(e).hasMessageThat().isEqualTo(...)`
* Minor fixes
* Rewrite the `testParsingDatesFormattedWithSystemLocale()`, Fix#2199
* Format the test
* Format the code following Google Java Style Guide
* Revert "Format the code following Google Java Style Guide"
This reverts commit f5e2e16b290a4bed09ed7fcc162d4a2529fe4c38.
* Remove EOFException special casing of JsonStreamParser.next()
The previous behavior violated the Iterator contract where for
`JsonStreamParser("[")` a call to `hasNext()` would return true,
but `next()` would throw a NoSuchElementException.
* Fix incorrect documented thrown exception type for JsonStreamParser
* Fix non-threadsafe creation of adapter for type with cyclic dependency
* Improve handling of broken adapters during Gson.getAdapter(...) call
* Improve test
* Slightly improve implementation and extend tests
* Simplify getAdapter implementation
* Convert GsonTest to JUnit 4 test
* Clarify getAdapter concurrency behavior
* Adjust version numbers and a test to conform to the SemVer spec.
Gson releases since 2.8.0 have been following this spec. We mistakenly released 2.10
without the .0 patch version, and adjusted `GsonVersionDiagnosticsTest` so it would
accept that, as well as the two-digit `10`. Here we make the test no longer accept
versions without a patch number, while still accepting two-digit minor versions of course.
We also change the snapshot version to 2.11.0-SNAPSHOT instead of 2.11-SNAPSHOT.
* Add 2.10 changes to CHANGELOG; minor release follow-ups
* Use GitHub URLs in CHANGELOG
GitHub automatically displays them only as short reference with link and
additionally shows a preview when hovering over them.
* Add `id` to pom.xml developer entry
Otherwise BND plugin shows a warning.
* Run unit tests during release preparation
* Move git option before pathspec
* Automatically replace version references on `release:prepare`
* Specify encoding and improve placeholder replacements
* Add `since $next-version$` for `JsonArray.asList` and `JsonObject.asMap`
* Adjust Record adapter and extend test coverage
* Address review feedback
* Make constructor string more concise
* Add tests for Gson default behavior for static fields
* Improve exception for deserializing static final field
Previously it would report "Unexpected IllegalAccessException occurred..."
due to the uncaught IllegalAccessException.
* Improve handling of exception thrown by accessor
Such an exception is not 'unexpected' (which was claimed by the previous
exception handling) because user code could throw it.
* Improve constructor invocation exception handling and add tests