Commit Graph

1445 Commits

Author SHA1 Message Date
Marcono1234 26b5a668b3
Add integration test for GraalVM Native Image (#2466)
* Add integration test for GraalVM Native Image

* Enable 'quickBuild' mode

Seems to improve build speed, and at least for the previous issue with
`RecordComponent` still causes test failures (as expected) if the fix
is reverted.
2023-08-13 08:44:00 -07:00
Éamonn McManus c5c1fbf9a1
Access `RecordComponent` via `Class.forName`. (#2465)
This should mean that GraalVM will understand the reflective lookup of its methods.
See [documentation](https://www.graalvm.org/latest/reference-manual/native-image/dynamic-features/Reflection/#automatic-detection).
2023-08-11 10:57:53 -07:00
Éamonn McManus cdbbee4e72
Bump com.google.errorprone:error_prone_core from 2.20.0 to 2.21.1 (#2463)
Suppress a couple of new Error Prone warnings.
2023-08-08 14:21:06 -07:00
dependabot[bot] e0cbbcc52b
Bump com.google.guava:guava-testlib from 32.1.1-jre to 32.1.2-jre (#2458)
Bumps [com.google.guava:guava-testlib](https://github.com/google/guava) from 32.1.1-jre to 32.1.2-jre.
- [Release notes](https://github.com/google/guava/releases)
- [Commits](https://github.com/google/guava/commits)

---
updated-dependencies:
- dependency-name: com.google.guava:guava-testlib
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-08 06:41:52 -07:00
dependabot[bot] f07fa7f487
Bump com.google.errorprone:error_prone_annotations from 2.20.0 to 2.21.1 (#2460)
Bumps [com.google.errorprone:error_prone_annotations](https://github.com/google/error-prone) from 2.20.0 to 2.21.1.
- [Release notes](https://github.com/google/error-prone/releases)
- [Commits](https://github.com/google/error-prone/compare/v2.20.0...v2.21.1)

---
updated-dependencies:
- dependency-name: com.google.errorprone:error_prone_annotations
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-08 06:39:17 -07:00
Marcono1234 f72824e2e4
Improve documentation about default `JsonReader` and `JsonWriter` behavior (#2341)
* Improve documentation about default `JsonWriter` behavior

* Revert accidental formatting change

* Document default JsonReader configuration & improve doc
2023-08-05 11:29:27 -07:00
Éamonn McManus b3dce2dc17
Strict mode for JSON parsing, contributed by @marten-voorberg. (#2437)
* Strict mode for JSON parsing (#2323)

* Feat #6: Add strict flag to Gson and GsonBuilder

* Test #2: Add failing tests for capitalized keywords

* Feat #2: JsonReader does not read (partially) capitalized keywords if strict mode is used

* Feat #3: Added implementation and tests for JSONReader not accepting specific escape sequence representing in strict mode

* Test #3: Simplify test cases by removing unnecessary array

* Feat #3: Improve error by including the illegal character

* Feat #5: JsonReader does not allow unespaced control flow characters in strict mode

* Test #5: Test unespaced control flow characters in strict mode

* Feat #4: Disallow espaced newline character in strict mode

* Test #4: Add tests for (dis)allowing newline character depensding on strictness

* Test #5: Test case for unescaped control char in non-strict mode

* Test #2: Simplify test cases

* Feat #13: Change leniency API to Strictness enum in JsonReader, Gson, and GsonBuilder

* Feat #15: Change JsonWriter API to also use Strictness

* Test #15: Test Strictness in JsonWriter API

* Doc #15: Add and update documentation for Strictness in JsonWriter API

* refactor #12: Fixed typos and empty catch brackets in tests

* refactor #12: Resolved importing wildcards, made some lines adhere to Google java style

* #5 Add test case for unescaped control characters

* Feat #5: add new lines to make JsonReader able to detect unescaped control characters (U+0000 through U+001F) and throw exceptions.

* Feat #5: add new lines to make JsonReader able to detect unescaped control characters (U+0000 through U+001F) and throw exceptions.

* Test #11: Added two tests for testing implementation of control character handling in strict mode and moved the implementation to nextQuotedValue

* Test #11: Added two tests for testing implementation of control character handling in strict mode and moved the implementation to nextQuotedValue

---------

Co-authored-by: LMC117 <2295699210@qq.com>
Co-authored-by: Marten Voorberg <martenvoorberg@gmail.com>

* Doc #17: Add and change javadoc of public methods

* Doc #17: Update JavaDoc in JsonReader and Strictness

* Doc #17: Update JavaDoc in Gson and GsonBuilder

* Test #34: Add tests for setting strictness through GsonBuilder

* Fix: Add Fix broken test

* Fix: Invalid JavaDoc in Gson.java

* Doc #17: update outdated javadoc

* #37: Resolve more PR feedback 

* Fix #37: Resolve various PR comments

* Fix #37: Resolve various PR comments

* Refactor #35: Refactor JsonReader#peekKeyword to reduce the amount of strictness checks (#39)

* Doc #40: Update JavaDoc based on PR feedback

* Doc #40: Update old RFC in GsonBuilder documentation

* Doc #40: Fix formatting error in JavaDoc

* Doc #40: Add tests for setting strictness and lenient to JsonReaderTest

* Test #43: Changed tests to make use of assertThrows

* test #43: Changed tests to make use of assertThrows as per feedback

* Test #43: Update JsonWriterTest#testStrictnessNull to use assertThrows

* Test #43: Update JsonWriterTest#testStrictnessNull to use assertThrows

* test #43: Resolve PR recommendations

* Test #43: Mini change to TC

* Test #43: Mini change to TC

---------

Co-authored-by: Marten Voorberg <martenvoorberg@gmail.com>

* doc #46: Resolved comments in main PR

* Feat #45: Change Gson.fromJson and Gson.toJson to be strict when the provided writer/reader is strict

* Fix #45: Small type

* Update gson/src/test/java/com/google/gson/stream/JsonReaderTest.java

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>

* Fix #45: Resolve various comments by Marcono1234

* Update gson/src/main/java/com/google/gson/GsonBuilder.java

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>

* Fix #45: Resolve various comments by Marcono1234

* Fix #45: Resolve various comments by eamonmcmanus

* Strictness mode follow-up

* Update Troubleshooting.md and Gson default lenient mode documentation

* Always use GSON strictness when set.

* Rename Strictness.DEFAULT to Strictness.LEGACY_STRICT

* Update JavaDoc with new strictness functionality

* Replace default with legacy strict for JsonReader javadoc

* Add JSONReader test cases for U2028 and U2029

* Refactor JSONReader#peekKeyWord() based on @eamonmcmanus's suggestion

* Deprecate setLenient in favor of setStrictness

---------

Co-authored-by: Carl Peterson <unknown>
Co-authored-by: Gustaf Johansson <gustajoh@kth.se>
Co-authored-by: gustajoh <58432871+gustajoh@users.noreply.github.com>
Co-authored-by: LMC117 <2295699210@qq.com>
Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>

* Strictness follow-up (#2408)

* Strictness mode follow-up

- Remove mentions of `null` Gson strictness; this is an implementation detail
- Fix incorrect / outdated documentation
- Reduce links to RFC; if there is already a link to it in a previous sentence
  don't link to it again
- Extend and update tests
- Minor punctuation changes in documentation for consistency

* Deprecate `setLenient` methods

* `strictness2` fixes & improvements (#2456)

* Adjust ProGuard default rules and shrinking tests (#2420)

* Adjust ProGuard default rules and shrinking tests

* Adjust comment

* Add shrinking test for class without no-args constructor; improve docs

* Improve Unsafe mention in Troubleshooting Guide

* Improve comment for `-if class *`

* Bump com.google.guava:guava from 32.0.1-jre to 32.1.1-jre (#2444)

Bumps [com.google.guava:guava](https://github.com/google/guava) from 32.0.1-jre to 32.1.1-jre.
- [Release notes](https://github.com/google/guava/releases)
- [Commits](https://github.com/google/guava/commits)

---
updated-dependencies:
- dependency-name: com.google.guava:guava
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump com.google.guava:guava-testlib from 32.0.1-jre to 32.1.1-jre (#2443)

Bumps [com.google.guava:guava-testlib](https://github.com/google/guava) from 32.0.1-jre to 32.1.1-jre.
- [Release notes](https://github.com/google/guava/releases)
- [Commits](https://github.com/google/guava/commits)

---
updated-dependencies:
- dependency-name: com.google.guava:guava-testlib
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Support non-generic type for `TypeToken.getParameterized` for legacy reasons (#2447)

This partially restores the behavior before a589ef2008,
except that back then for a non-generic type a bogus `TypeToken(ParameterizedType)`
was created, whereas now a `TypeToken(Class)` is created instead.

* Fixed Typo in GsonBuilder.java (#2449)

* Make date-formatting tests less fragile with regular expressions. (#2450)

* Make date-formatting tests less fragile with regular expressions.

This is not great. We should really ensure that formatted dates are the same
regardless of JDK version. There is code that attempts to do that but it is not
really effective. So for now we fudge around the differences by using regular
expressions to paper over the differences.

* Temporarily add test-debugging code.

* Another attempt at debugging a test failure.

* Fix pattern in assertion.

* Modification in test cases (#2454)

* Fixed Typo in GsonBuilder.java

* Suggestions on Test cases

* Modified test cases using assertThrows method (JUnit)

* Update gson/src/test/java/com/google/gson/JsonArrayAsListTest.java

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>

* Update gson/src/test/java/com/google/gson/GsonTest.java

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>

* Update gson/src/test/java/com/google/gson/JsonArrayAsListTest.java

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>

* Update gson/src/test/java/com/google/gson/JsonStreamParserTest.java

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>

* Update gson/src/test/java/com/google/gson/JsonStreamParserTest.java

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>

* Update gson/src/test/java/com/google/gson/JsonStreamParserTest.java

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>

* Update gson/src/test/java/com/google/gson/ToNumberPolicyTest.java

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>

* Update gson/src/test/java/com/google/gson/TypeAdapterTest.java

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>

* Update gson/src/test/java/com/google/gson/TypeAdapterTest.java

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>

* Update gson/src/test/java/com/google/gson/ToNumberPolicyTest.java

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>

* Update gson/src/test/java/com/google/gson/ToNumberPolicyTest.java

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>

---------

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>

* Minor follow-up changes

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: elevne <97422844+elevne@users.noreply.github.com>
Co-authored-by: Éamonn McManus <emcmanus@google.com>
Co-authored-by: Wonil <cwi5525@naver.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Marten <martenvoorberg@gmail.com>
Co-authored-by: Gustaf Johansson <gustajoh@kth.se>
Co-authored-by: gustajoh <58432871+gustajoh@users.noreply.github.com>
Co-authored-by: LMC117 <2295699210@qq.com>
Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: elevne <97422844+elevne@users.noreply.github.com>
Co-authored-by: Wonil <cwi5525@naver.com>
2023-07-30 09:20:32 -07:00
Wonil 3d241ca0a6
Modification in test cases (#2454)
* Fixed Typo in GsonBuilder.java

* Suggestions on Test cases

* Modified test cases using assertThrows method (JUnit)

* Update gson/src/test/java/com/google/gson/JsonArrayAsListTest.java

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>

* Update gson/src/test/java/com/google/gson/GsonTest.java

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>

* Update gson/src/test/java/com/google/gson/JsonArrayAsListTest.java

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>

* Update gson/src/test/java/com/google/gson/JsonStreamParserTest.java

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>

* Update gson/src/test/java/com/google/gson/JsonStreamParserTest.java

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>

* Update gson/src/test/java/com/google/gson/JsonStreamParserTest.java

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>

* Update gson/src/test/java/com/google/gson/ToNumberPolicyTest.java

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>

* Update gson/src/test/java/com/google/gson/TypeAdapterTest.java

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>

* Update gson/src/test/java/com/google/gson/TypeAdapterTest.java

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>

* Update gson/src/test/java/com/google/gson/ToNumberPolicyTest.java

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>

* Update gson/src/test/java/com/google/gson/ToNumberPolicyTest.java

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>

---------

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>
2023-07-29 14:18:45 -07:00
Éamonn McManus 5055b62463
Make date-formatting tests less fragile with regular expressions. (#2450)
* Make date-formatting tests less fragile with regular expressions.

This is not great. We should really ensure that formatted dates are the same
regardless of JDK version. There is code that attempts to do that but it is not
really effective. So for now we fudge around the differences by using regular
expressions to paper over the differences.

* Temporarily add test-debugging code.

* Another attempt at debugging a test failure.

* Fix pattern in assertion.
2023-07-26 12:24:04 -07:00
elevne 5a87d80655
Fixed Typo in GsonBuilder.java (#2449) 2023-07-26 08:47:28 -07:00
Marcono1234 a38b757bc4
Support non-generic type for `TypeToken.getParameterized` for legacy reasons (#2447)
This partially restores the behavior before a589ef2008,
except that back then for a non-generic type a bogus `TypeToken(ParameterizedType)`
was created, whereas now a `TypeToken(Class)` is created instead.
2023-07-25 13:00:26 -07:00
dependabot[bot] 79ae239a49
Bump com.google.guava:guava-testlib from 32.0.1-jre to 32.1.1-jre (#2443)
Bumps [com.google.guava:guava-testlib](https://github.com/google/guava) from 32.0.1-jre to 32.1.1-jre.
- [Release notes](https://github.com/google/guava/releases)
- [Commits](https://github.com/google/guava/commits)

---
updated-dependencies:
- dependency-name: com.google.guava:guava-testlib
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-24 07:55:59 -07:00
Marcono1234 ecb9f8c8ad
Adjust ProGuard default rules and shrinking tests (#2420)
* Adjust ProGuard default rules and shrinking tests

* Adjust comment

* Add shrinking test for class without no-args constructor; improve docs

* Improve Unsafe mention in Troubleshooting Guide

* Improve comment for `-if class *`
2023-07-24 07:34:02 -07:00
Marcono1234 6d9c3566b7
Document minimum Android API level and add workflow to check compatibility (#2431) 2023-07-06 10:04:36 -07:00
Marcono1234 a589ef2008
Improve creation of `ParameterizedType` (#2375)
- Reject non-generic raw types for TypeToken.getParameterized
- Fix ParameterizedTypeImpl erroneously requiring owner type for types
  without owner
2023-06-23 15:24:23 -07:00
Éamonn McManus 9cf0f8d302
Update to latest Error Prone and fix some newly-flagged problems. (#2426) 2023-06-19 14:22:28 -07:00
dependabot[bot] 500ec501a7
Bump error_prone_annotations from 2.19.1 to 2.20.0 (#2421)
Bumps [error_prone_annotations](https://github.com/google/error-prone) from 2.19.1 to 2.20.0.
- [Release notes](https://github.com/google/error-prone/releases)
- [Commits](https://github.com/google/error-prone/compare/v2.19.1...v2.20.0)

---
updated-dependencies:
- dependency-name: com.google.errorprone:error_prone_annotations
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Éamonn McManus <emcmanus@google.com>
2023-06-19 09:16:18 -07:00
dependabot[bot] 621a6a2d9a
Bump guava-testlib from 32.0.0-jre to 32.0.1-jre (#2416)
Bumps [guava-testlib](https://github.com/google/guava) from 32.0.0-jre to 32.0.1-jre.
- [Release notes](https://github.com/google/guava/releases)
- [Commits](https://github.com/google/guava/commits)

---
updated-dependencies:
- dependency-name: com.google.guava:guava-testlib
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-14 14:03:15 -07:00
Éamonn McManus a80bc24e04
Rename `master` to `main` everywhere. (#2410) 2023-06-07 11:02:13 -07:00
dependabot[bot] e7f85dff8a
Bump maven-surefire-plugin from 3.1.0 to 3.1.2 (#2411)
Bumps [maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.1.0 to 3.1.2.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.1.0...surefire-3.1.2)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-surefire-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-07 08:17:46 -07:00
Marcono1234 481ac9b82c
Use non-`null` `FormattingStyle`; configure space after separator (#2345)
* Use non-`null` `FormattingStyle`; configure space after separator

* Improve Javadoc and tests

* Rename to plural separator*s*

* Add explicit tests for default formatting styles

---------

Co-authored-by: Éamonn McManus <emcmanus@google.com>
2023-05-30 16:32:22 -07:00
dependabot[bot] a8a928ee51
Bump guava-testlib from 31.1-jre to 32.0.0-jre (#2400)
Bumps [guava-testlib](https://github.com/google/guava) from 31.1-jre to 32.0.0-jre.
- [Release notes](https://github.com/google/guava/releases)
- [Commits](https://github.com/google/guava/commits)

---
updated-dependencies:
- dependency-name: com.google.guava:guava-testlib
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-30 15:42:06 -07:00
Marcono1234 43396e45fd
Add ProGuard / R8 integration tests & add default ProGuard rules (#2397)
* Add code shrinking tools integration test

* Keep no-args constructor of classes usable with JsonAdapter

* Add library ProGuard rules for Gson

They are automatically applied for all users of Gson, see
https://developer.android.com/build/shrink-code#configuration-files

* Skip japicmp-maven-plugin for shrinker-test

* Add more tests for JsonAdapter, add tests for generic classes

* Extend default constructor test

* Add Troubleshooting Guide entry for TypeToken
2023-05-28 12:24:05 -07:00
dependabot[bot] eae63f92fb
Bump error_prone_annotations from 2.19.0 to 2.19.1 (#2389)
Bumps [error_prone_annotations](https://github.com/google/error-prone) from 2.19.0 to 2.19.1.
- [Release notes](https://github.com/google/error-prone/releases)
- [Commits](https://github.com/google/error-prone/compare/v2.19.0...v2.19.1)

---
updated-dependencies:
- dependency-name: com.google.errorprone:error_prone_annotations
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-11 09:43:22 -07:00
Éamonn McManus 49dbc6f072
Update Error Prone, bypass a bug in it, fix some problems it flags (#2387) 2023-05-09 10:28:39 -07:00
dependabot[bot] b330ad9790
Bump error_prone_annotations from 2.18.0 to 2.19.0 (#2386)
Bumps [error_prone_annotations](https://github.com/google/error-prone) from 2.18.0 to 2.19.0.
- [Release notes](https://github.com/google/error-prone/releases)
- [Commits](https://github.com/google/error-prone/compare/v2.18.0...v2.19.0)

---
updated-dependencies:
- dependency-name: com.google.errorprone:error_prone_annotations
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-09 06:44:34 -07:00
dependabot[bot] 1339b50629
Bump maven-surefire-plugin from 3.0.0 to 3.1.0 (#2383)
Bumps [maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.0.0...surefire-3.1.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-surefire-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Éamonn McManus <emcmanus@google.com>
2023-05-08 12:17:29 -07:00
dependabot[bot] 8333ccac62
Bump moditect-maven-plugin from 1.0.0.RC3 to 1.0.0.Final (#2381)
Bumps [moditect-maven-plugin](https://github.com/moditect/moditect) from 1.0.0.RC3 to 1.0.0.Final.
- [Release notes](https://github.com/moditect/moditect/releases)
- [Commits](https://github.com/moditect/moditect/compare/1.0.0.RC3...1.0.0.Final)

---
updated-dependencies:
- dependency-name: org.moditect:moditect-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-04 06:23:28 -07:00
Marcono1234 cbad1aa79f
Link to troubleshooting guide from exception messages (#2357)
* Link to troubleshooting guide from exception messages

* Add examples to troubleshooting guide

* Use proper anchor names for troubleshooting guide
2023-04-15 13:36:26 -07:00
Éamonn McManus 37ed0fcbd7
Address review comments from @Marcono1234. (#2372) 2023-04-10 13:33:47 -07:00
Éamonn McManus c1da2d7070
Add `@CanIgnoreReturnValue` as appropriate to Gson methods. (#2369)
This annotation indicates that return value of the annotated method does
not need to be used. If it is _not_ present on a non-void method, and if
Error Prone's `CheckReturnValue` is active, then calling the method
without using the result is an error. However, we are not enabling
`CheckReturnValue` by default here.

Also update some code that does ignore return values, so that the
returned value is used, if only by assigning it to an unused variable.
2023-04-10 10:50:25 -07:00
dependabot[bot] b43ccee889
Bump maven-surefire-plugin from 3.0.0-M9 to 3.0.0 (#2342)
Bumps [maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.0.0-M9 to 3.0.0.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.0.0-M9...surefire-3.0.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-surefire-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-08 10:05:20 -07:00
Maicol 051cb43fd9
Fixes outdated URL (`ISO8601Utils.java`) (#2363)
* Fixes comments

Fixes the javadoc and the link to Jackson databind ISO8601Utils.java

* Updates outdated URL in UtcDateTypeAdapter
2023-04-01 13:59:51 -07:00
dependabot[bot] 1d9d9774be
Bump maven-resources-plugin from 3.3.0 to 3.3.1 (#2360)
Bumps [maven-resources-plugin](https://github.com/apache/maven-resources-plugin) from 3.3.0 to 3.3.1.
- [Release notes](https://github.com/apache/maven-resources-plugin/releases)
- [Commits](https://github.com/apache/maven-resources-plugin/compare/maven-resources-plugin-3.3.0...maven-resources-plugin-3.3.1)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-resources-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-28 08:28:24 -07:00
Marcono1234 26229d33d8
FormattingStyle follow-up (#2327)
* FormattingStyle follow-up

* Add links to FormattingStyle

* Use Truth for FormattingStyleTest

* Reduce pull request scope to Javadoc and minor code changes
2023-03-19 09:15:35 -07:00
Marcono1234 6eddbf3031
Make dependency on Error Prone Annotations non-optional (#2346) 2023-03-19 08:54:31 -07:00
dependabot[bot] 1da826dc6c
Bump moditect-maven-plugin from 1.0.0.RC2 to 1.0.0.RC3 (#2340)
Bumps [moditect-maven-plugin](https://github.com/moditect/moditect) from 1.0.0.RC2 to 1.0.0.RC3.
- [Release notes](https://github.com/moditect/moditect/releases)
- [Commits](https://github.com/moditect/moditect/compare/1.0.0.CR2...1.0.0.RC3)

---
updated-dependencies:
- dependency-name: org.moditect:moditect-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-08 06:45:07 -08:00
Maicol 85ebaf7c35
Fix #2334 (#2337)
* Fix #2334

This commit replaces the `NumberFormatException` with `MalformedJsonException` in the `JsonReader#readEscapeCharacter()` and also fixes the tests.

* Removes white-space
2023-03-06 08:24:09 -08:00
Marcono1234 0adcdc80d5
Fail Maven build on warnings (#2335)
* Fail Maven build on warnings

* Fix configuration parameter name

For the Javadoc plugin it is "warnings" (plural) instead of "warning"
2023-03-06 07:33:50 -08:00
Maicol dc20b7561a
Fix error prone warns (#2320)
* Adds `@SuppressWarnings("NarrowingCompoundAssignment")`

* Adds `@SuppressWarnings("TypeParameterUnusedInFormals")`

* Adds `@SuppressWarnings("JavaUtilDate")`

* Adds a limit to `String.split()`

* Add `error_prone_annotations` to the `pom.xml`

* Adds `@InlineMe(...)` to deprecated methods

* Adds `@SuppressWarnings("ImmutableEnumChecker")`

* Adds `@SuppressWarnings("ModifiedButNotUsed")`

* Adds `@SuppressWarnings("MixedMutabilityReturnType")`

* Removes an unused import

* Adds `requires` to `module-info.java`

* Adds ErrorProne `link` into `pom.xml`

* Remove unused imports

Removed from:
- ParseBenchmark

* Adds `@SuppressWarnings("EqualsGetClass")`

* Excludes from `proto` just the generated code.

Replaces `.*proto.*` with `.*/generated-test-sources/protobuf/.*` in such way will be excluded just the generated code and not the whole `proto` directory

* Removes an unused variable

Removes the `descriptor` variable because is unused.

* Fixes the `BadImport` warn into `ProtosWithAnnotationsTest`

* Fixes the `BadImport` warns into `ProtosWithAnnotationsTest`

* Enables ErrorProne in `gson/src/test.*`

Removes the `gson/src/test.*` path from the `-XepExcludedPaths` parameter of the ErrorProne plugin

* Fixes `UnusedVariable` warns

This commit fix all `UnusedVariable` warns given by ErrorProne in the `gson/src/test.*` path.

Some field is annotated with `@Keep` that means is used by reflection.
In some other case the record is annotated with `@SuppressWarnings("unused")`

* Fixes `JavaUtilDate` warns

This commit fix all `JavaUtilDate` warns given by ErrorProne in the `gson/src/test.*` path.

Classes/Methods are annotated with `@SuppressWarnings("JavaUtilDate")` because it's not possible use differente Date API.

* Fixes `EqualsGetClass` warns

This commit fix all `EqualsGetClass` warns given by ErrorProne in the `gson/src/test.*` path.

I have rewrite the `equals()` methods to use `instanceof`

* Replaces pattern matching for instanceof with casts

* Fixes `JdkObsolete` warns

This commit fix all `JdkObsolete` warns given by ErrorProne in the `gson/src/test.*` path.

In some cases I have replaced the obsolete JDK classes with the newest alternatives.  In other cases, I have added the `@SuppressWarnings("JdkObsolete")`

* Fixes `ClassCanBeStatic` warns

This commit fix all `ClassCanBeStatic` warns given by ErrorProne in the `gson/src/test.*` path.

I have added the `static` keyword, or I have added `@SuppressWarnings("ClassCanBeStatic")`

* Fixes `UndefinedEquals` warns

This commit fix all `UndefinedEquals` warns given by ErrorProne in the `gson/src/test.*` path.

I have added `@SuppressWarnings("UndefinedEquals")` or fixed the asserts

Note: In this commit I have also renamed a test from `testRawCollectionDeserializationNotAlllowed` to `testRawCollectionDeserializationNotAllowed`

* Fixes `GetClassOnEnum` warns

This commit fix all `GetClassOnEnum` warns given by ErrorProne in the `gson/src/test.*` path.

I have replaced the `.getClass()` with `.getDeclaringClass()`

* Fixes `ImmutableEnumChecker` warns

This commit fix all `ImmutableEnumChecker` warns given by ErrorProne in the `gson/src/test.*` path.

I have added the `final` keyword, or I have added the `@SuppressWarnings("ImmutableEnumChecker")` annotation

* Fixes `StaticAssignmentOfThrowable` warns

This commit fix all `StaticAssignmentOfThrowable` warns given by ErrorProne in the `gson/src/test.*` path.

* Fixes `AssertionFailureIgnored` warns

This commit fix all `AssertionFailureIgnored` warns given by ErrorProne in the `gson/src/test.*` path.

I have added the `@SuppressWarnings("AssertionFailureIgnored")` annotation

* Fixes `ModifiedButNotUsed` warns

This commit fix all `ModifiedButNotUsed` warns given by ErrorProne in the `gson/src/test.*` path.

I have added the `@SuppressWarnings("ModifiedButNotUsed")` annotation

* Fixes `MissingSummary` warns

This commit fix all `MissingSummary` warns given by ErrorProne in the `gson/src/test.*` path.

I have remove the Javadoc `@author`

* Fixes `FloatingPointLiteralPrecision` warns

This commit fix all `FloatingPointLiteralPrecision` warns given by ErrorProne in the `gson/src/test.*` path.

I have added the `@SuppressWarnings("FloatingPointLiteralPrecision")` annotation

* Fixes `StringSplitter` warns

This commit fix all `StringSplitter` warns given by ErrorProne in the `gson/src/test.*` path.

I have replaced the `String.split(...)` with `Splitter`

* Fixes `EmptyCatch` warns

This commit fix all `EmptyCatch` warns given by ErrorProne in the `gson/src/test.*` path.

* Fixes `UnicodeEscape` warns

This commit fix all `UnicodeEscape` warns given by ErrorProne in the `gson/src/test.*` path.

* Fixes `EmptyBlockTag` warns

This commit fix all `EmptyBlockTag` warns given by ErrorProne in the `gson/src/test.*` path.

* Fixes `LongFloatConversion` warns

This commit fix all `LongFloatConversion` warns given by ErrorProne in the `gson/src/test.*` path.

* Fixes `LongDoubleConversion` warns

This commit fix all `LongDoubleConversion` warns given by ErrorProne in the `gson/src/test.*` path.

* Fixes `TruthAssertExpected` warns

This commit fix all `TruthAssertExpected` warns given by ErrorProne in the `gson/src/test.*` path.

* Fixes `UnusedMethod` warns

This commit fix all `UnusedMethod` warns given by ErrorProne in the `gson/src/test.*` path.

* Fixes `UnusedTypeParameter` warns

This commit fix all `UnusedTypeParameter` warns given by ErrorProne in the `gson/src/test.*` path.

* Fixes `CatchFail` warns

This commit fix all `CatchFail` warns given by ErrorProne in the `gson/src/test.*` path.

* Fixes `MathAbsoluteNegative` warns

This commit fix all `MathAbsoluteNegative` warns given by ErrorProne in the `gson/src/test.*` path.

* Fixes `LoopOverCharArray` warns

This commit fix all `LoopOverCharArray` warns given by ErrorProne in the `gson/src/test.*` path.

`toCharArray` allocates a new array, using `charAt` is more efficient

* Fixes `HidingField` warns

This commit fix all `HidingField` warns given by ErrorProne in the `gson/src/test.*` path.

* Implements code review feedback

* Implements code review feedback

This commit implements some other code review feedback

* Enable ErrorProne in `extra`

Thi commit removes the `.*extras/src/test.*` path from the `-XepExcludedPaths` parameter of ErrorProne.

* Fix the `JavaUtilDate` warns

This commit fix all `JavaUtilDate` warns given by ErrorProne in the `extras/src/test.*` path.

* Implements code review feedback

* Removes redundant new-line

* Implements code review feedback

* Adds `JDK11` to run test with `--release 11`

* Revert "Adds `JDK11` to run test with `--release 11`"

This reverts commit a7cca386098ae847a10a31c09c3ab9b11eee5920.
2023-03-01 14:23:27 -08:00
sembseth 105f28ffe6
BoundField.write memory optimization (#2325)
* BoundField.write memory optimization

Declare and initialize the type adapter used for writing BoundFields outside of the anonymous class to ensure that a new TypeAdapterRuntimeTypeWrapper is not constructed each time a BoundField is written. This type adapter is only initialized if the BoundField will be used for serialization.

* Avoid confusing nullness-analysis tools
2023-02-28 14:46:05 -08:00
Johannes Frohnmeyer 89ae8b48c2
Merge remote-tracking branch 'origin/master'
ci/woodpecker/push/woodpecker Pipeline was successful Details
# Conflicts:
#	extras/pom.xml
#	extras/src/main/java/com/google/gson/graph/GraphAdapterBuilder.java
#	extras/src/main/java/com/google/gson/interceptors/InterceptorFactory.java
#	extras/src/test/java/com/google/gson/typeadapters/PostConstructAdapterFactoryTest.java
#	gson/src/main/java/com/google/gson/Gson.java
#	gson/src/main/java/com/google/gson/GsonBuilder.java
#	gson/src/main/java/com/google/gson/util/ISO8601Utils.java
#	gson/src/main/java/module-info.java
#	gson/src/test/java/com/google/gson/GsonTest.java
#	gson/src/test/java/com/google/gson/functional/ArrayTest.java
#	gson/src/test/java/com/google/gson/functional/CustomTypeAdaptersTest.java
#	gson/src/test/java/com/google/gson/functional/DefaultTypeAdaptersTest.java
#	gson/src/test/java/com/google/gson/functional/EnumWithObfuscatedTest.java
#	gson/src/test/java/com/google/gson/functional/InternationalizationTest.java
#	gson/src/test/java/com/google/gson/functional/Java17RecordTest.java
#	gson/src/test/java/com/google/gson/functional/JavaUtilConcurrentAtomicTest.java
#	gson/src/test/java/com/google/gson/functional/JavaUtilTest.java
#	gson/src/test/java/com/google/gson/functional/JsonAdapterAnnotationOnClassesTest.java
#	gson/src/test/java/com/google/gson/functional/JsonAdapterAnnotationOnFieldsTest.java
#	gson/src/test/java/com/google/gson/functional/JsonParserTest.java
#	gson/src/test/java/com/google/gson/functional/MapTest.java
#	gson/src/test/java/com/google/gson/functional/PrimitiveTest.java
#	gson/src/test/java/com/google/gson/functional/ReflectionAccessTest.java
#	gson/src/test/java/com/google/gson/functional/StreamingTypeAdaptersTest.java
#	gson/src/test/java/com/google/gson/functional/TypeAdapterPrecedenceTest.java
#	gson/src/test/java/com/google/gson/internal/bind/Java17ReflectiveTypeAdapterFactoryTest.java
#	gson/src/test/java/com/google/gson/internal/bind/JsonTreeReaderTest.java
#	gson/src/test/java/com/google/gson/internal/bind/JsonTreeWriterTest.java
#	gson/src/test/java/com/google/gson/internal/reflect/Java17ReflectionHelperTest.java
#	gson/src/test/java/com/google/gson/regression/JsonAdapterNullSafeTest.java
#	gson/src/test/java/com/google/gson/stream/JsonReaderPathTest.java
#	gson/src/test/java/com/google/gson/stream/JsonReaderTest.java
#	metrics/pom.xml
#	metrics/src/main/java/com/google/gson/metrics/NonUploadingCaliperRunner.java
#	metrics/src/main/java/com/google/gson/metrics/ParseBenchmark.java
#	pom.xml
#	proto/pom.xml
2023-02-23 14:21:42 +01:00
Maicol 742fd50ff7
Fix error prone warns (#2319)
* Adds a javadoc summary to the methods in the `SerializedName` annotation

Fixes the `MissingSummary` warn given by ErrorProne

* Adds a javadoc summary to the methods of the `ExclusionStrategy` annotation

 Fixes the `MissingSummary` warn given by ErrorProne

* Adds a javadoc summary to `getDeclaringClass()` and `getName()` methods of the `FieldAttributes` class

 Fixes the `MissingSummary` warn given by ErrorProne

* Adds a javadoc summary to `getMajorJavaVersion()` and `isJava9OrLater()` methods of the `JavaVersion` class

 Fixes the `MissingSummary` warn given by ErrorProne

* Adds a comment in the empty catch block of the `AccessChecker:101` class

 Fixes the `EmptyCatch` warn given by ErrorProne

* Adds a comment in the empty catch block of the `DefaultDateTypeAdapter:158` class

 Fixes the `EmptyCatch` warn given by ErrorProne

* Adds a comment in the empty catch blocks of the `UnsafeAllocator:(67|92|113)` class

 Fixes the `EmptyCatch` warn given by ErrorProne

* Adds a comment in the empty catch block of the `DateTypeAdapter:85` class

 Fixes the `EmptyCatch` warn given by ErrorProne

* Fixes javadoc param of the `deserialize(...)` method of the `JsonDeserializer` interface

 Fixes the `InvalidParam` warn given by ErrorProne

* Adds a charset `StandardCharsets.UTF_8` in the `resourceToString()` method of the `ParseBenchmark` class

Fixes the `DefaultCharset` warn given by ErrorProne

* Fixes a typo

* Implements review feedback

* Adds blank line before @ tag.
2023-02-17 09:58:16 -08:00
Éamonn McManus 18bdb6db2a
Fix a couple of types in tests. (#2317)
These show up with recent Error Prone analyses for Truth. Because the
tests use the overload of `Gson.fromJson` that takes a `Type` argument,
rather than the one with a `TypeToken`, the type mismatches were not
detected by the compiler.
2023-02-15 05:53:29 -08:00
dependabot[bot] e8b6fa9287
Bump maven-surefire-plugin from 3.0.0-M8 to 3.0.0-M9 (#2313)
Bumps [maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.0.0-M8 to 3.0.0-M9.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.0.0-M8...surefire-3.0.0-M9)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-surefire-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-15 05:41:42 -08:00
Maicol 2658aca66a
Fix error prone warnings (#2316)
* 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()`
2023-02-15 05:18:43 -08:00
Mihai Nita 19f54ee6ed
Fixes #776: Add settings for the kind of newline to use (#2231)
* 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>
2023-02-12 08:20:02 -08:00
Maicol af21798436
Fix the `equals` method of `JsonPrimitive` to work with `BigInteger` (#2311)
* Fix the `equals` method of `JsonPrimitive` to work with BigInteger

* Improve the `equals` & `getAsBigInteger` methods in `JsonPrimitive`
2023-02-06 09:40:11 -08:00
Maicol 9f26679e7a
Adds Error Prone to the `maven-compiler-plugin` (#2308)
* 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`
2023-02-06 06:13:28 -08:00
Éamonn McManus 0d22e5d205
Add copyright notices to files that were missing them. (#2307)
In each case the copyright year is the year in which the file was first added.
2023-01-31 14:05:12 -08:00
Maicol 49b00d1a86
Port all Junit assert to Truth asserts (#2304)
* 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
2023-01-31 11:20:54 -08:00
Johannes Frohnmeyer 422c993e99
Fix access
ci/woodpecker/push/woodpecker Pipeline was successful Details
2023-01-21 14:31:36 +01:00
Johannes Frohnmeyer 51157e81e5
Move some stuff around
ci/woodpecker/push/woodpecker Pipeline failed Details
2023-01-21 14:27:59 +01:00
Johannes Frohnmeyer b6cc63919d
Merge remote-tracking branch 'origin/master'
ci/woodpecker/push/woodpecker Pipeline failed Details
# Conflicts:
#	.github/ISSUE_TEMPLATE/bug_report.md
#	.github/workflows/build.yml
#	extras/pom.xml
#	extras/src/main/java/com/google/gson/graph/GraphAdapterBuilder.java
#	extras/src/main/java/com/google/gson/typeadapters/UtcDateTypeAdapter.java
#	extras/src/test/java/com/google/gson/interceptors/InterceptorTest.java
#	extras/src/test/java/com/google/gson/typeadapters/PostConstructAdapterFactoryTest.java
#	extras/src/test/java/com/google/gson/typeadapters/RuntimeTypeAdapterFactoryTest.java
#	extras/src/test/java/com/google/gson/typeadapters/UtcDateTypeAdapterTest.java
#	gson/src/test/java/com/google/gson/CommentsTest.java
#	gson/src/test/java/com/google/gson/ToNumberPolicyTest.java
#	gson/src/test/java/com/google/gson/functional/EnumWithObfuscatedTest.java
#	gson/src/test/java/com/google/gson/functional/JsonParserTest.java
#	gson/src/test/java/com/google/gson/functional/LeniencyTest.java
#	gson/src/test/java/com/google/gson/functional/MapTest.java
#	gson/src/test/java/com/google/gson/functional/PrimitiveCharacterTest.java
#	gson/src/test/java/com/google/gson/functional/ReflectionAccessTest.java
#	gson/src/test/java/com/google/gson/functional/SecurityTest.java
#	gson/src/test/java/com/google/gson/stream/JsonReaderTest.java
#	gson/src/test/resources/testcases-proguard.conf
#	metrics/pom.xml
#	metrics/src/main/java/com/google/gson/metrics/BagOfPrimitives.java
#	proto/pom.xml
#	proto/src/test/java/com/google/gson/protobuf/functional/ProtosWithAnnotationsTest.java
#	proto/src/test/java/com/google/gson/protobuf/functional/ProtosWithComplexAndRepeatedFieldsTest.java
#	proto/src/test/java/com/google/gson/protobuf/functional/ProtosWithPrimitiveTypesTest.java
2023-01-21 14:24:25 +01:00
Maicol be87c3fd0e
Port Junit test to Truth in the package `com.google.gson` of the module `gson` (#2299)
* 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
2023-01-17 07:59:10 -08:00
dependabot[bot] 21989d7ff8
Bump maven-surefire-plugin from 3.0.0-M7 to 3.0.0-M8 (#2298)
Bumps [maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.0.0-M7 to 3.0.0-M8.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.0.0-M7...surefire-3.0.0-M8)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-surefire-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-12 10:59:29 -08:00
Éamonn McManus 3adf2ad748 [maven-release-plugin] prepare for next development iteration 2023-01-06 07:42:33 -08:00
Éamonn McManus 2ce6a6106c [maven-release-plugin] prepare release gson-parent-2.10.1 2023-01-06 07:42:31 -08:00
Maicol 1a2170b99c
Port tests from JUnit 3 to JUnit 4 (#2294)
* Port tests from JUnit 3 to JUnit 4

* Port tests from JUnit 3 to JUnit 4

* Add `@Test` above `@Ignore`
2022-12-22 06:04:16 -08:00
Maicol 6c12ded70d
Rewrite the `testParsingDatesFormattedWithSystemLocale()`, Fix #2199 (#2287)
* 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.
2022-12-16 11:18:32 -08:00
Marcono1234 f2f53fbe8e
Add troubleshooting guide (#2285) 2022-12-15 08:27:16 -08:00
Marcono1234 f63a1b85ae
Remove EOFException special casing of JsonStreamParser.next() (#2281)
* 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
2022-12-14 08:33:33 -08:00
Maicol 6c3cf22435
Unnecessary unboxing at JsonPrimitive.getAsBoolean() (#2277) 2022-12-13 09:33:57 -08:00
Maicol 0a42c31efe
Code cleanup (#2282)
* Simplify `if` condition in JsonReader.peekNumber()

* Remove `if` to simplify a `return` in Excluder.excludeClassChecks()

* Remove redundant variable in Gson.fromJson()

* equal condition replace by `Objects.equals()` in $Gson$Types.equal()

* equal condition replace by `Objects.equals()` in LinkedTreeMap.equal()

* Replace `switch` with `if` in UtcDateTypeAdapter.read()

* Remove redundant `throws` clause in GraphAdapterBuilder.read()

* Remove redundant `throws` clause in JsonTreeReader.UNREADABLE_READER

* Remove redundant `throws` clause in JsonTreeWriter.UNREADABLE_READER

* Remove unnecessary `.initCause()` call

* Remove redundant cast in TreeTypeAdapter.GsonContextImpl.deserialize

* Replace `StringBuilder` with `String`

* Fix the import and restore the `switch`

* Fix the import

* Add the `util.Objects` import

* Fix indentation

* Add a comment to clarify the condition

* Fix indentation

* Fix imports

* Fix indentation

* Fix indentation

* Fix indentation
2022-12-13 08:50:25 -08:00
Maicol 28affcbdb9
Remove the `final` keyword from `private` method (#2276) 2022-12-09 08:07:35 -08:00
dependabot[bot] dcbc164cb0
Bump bnd-maven-plugin from 6.3.1 to 6.4.0 (#2245)
Bumps [bnd-maven-plugin](https://github.com/bndtools/bnd) from 6.3.1 to 6.4.0.
- [Release notes](https://github.com/bndtools/bnd/releases)
- [Changelog](https://github.com/bndtools/bnd/blob/master/docs/ADDING_RELEASE_DOCS.md)
- [Commits](https://github.com/bndtools/bnd/compare/6.3.1...6.4.0)

---
updated-dependencies:
- dependency-name: biz.aQute.bnd:bnd-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-09 08:03:07 -08:00
Maicol 66d934ba44
Remove already covered condition in JsonNull.equals() (#2271) 2022-12-06 10:43:08 -08:00
Maicol c9c8e8f1bc
Fix the javadoc of JsonDeserializer.deserialize() (#2243) 2022-12-05 12:59:14 -08:00
Marcono1234 e4c3b653a6
Fix non-threadsafe creation of adapter for type with cyclic dependency (#1832)
* 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
2022-12-05 09:10:36 -08:00
Marcono1234 6c27553c83
Improve exception message for duplicate field names (#2251) 2022-12-04 17:27:43 -08:00
Johannes Frohnmeyer 188b2beb26
Plz
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-11-24 18:52:42 +01:00
Johannes Frohnmeyer 26ce5dd19f
Plz
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-11-24 18:48:53 +01:00
Johannes Frohnmeyer 29e5634ce8
Plz
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-11-24 18:46:44 +01:00
Johannes Frohnmeyer b357260039
Plz
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-11-24 18:45:24 +01:00
Johannes Frohnmeyer 2a87b3009d
Plz
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-11-24 18:42:46 +01:00
Johannes Frohnmeyer b48d9bacc9
Plz
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-11-24 18:40:56 +01:00
Johannes Frohnmeyer 9dc1f2d803
Plz
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-11-24 18:34:37 +01:00
Johannes Frohnmeyer ac588f8581
Plz
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-11-24 18:28:39 +01:00
Johannes Frohnmeyer bdba5f3987
Plz
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-11-24 18:26:37 +01:00
Johannes Frohnmeyer 181e4dc7b9
Plz
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-11-24 18:07:15 +01:00
Johannes Frohnmeyer 5eaa85fffa
11
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-11-24 18:06:23 +01:00
Johannes Frohnmeyer d6ad135e1d
h
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-11-24 18:05:42 +01:00
Johannes Frohnmeyer d6c262b583
Plz
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-11-24 17:49:25 +01:00
Johannes Frohnmeyer 7633b4cf85
Try to shade
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-11-24 17:44:55 +01:00
Johannes Frohnmeyer bf388059a3
Merge remote-tracking branch 'origin/master'
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-11-24 17:33:52 +01:00
Éamonn McManus 818faeeaa2
Adjust version numbers and a test to conform to the SemVer spec. (#2237)
* 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.
2022-11-13 15:36:09 -08:00
Doug Hoard ceb3b8747e
Added JsonObject method isEmpty() (#2233)
* Added isEmpty()

* Fixed Javadoc typo

* Changed test to use assertTrue() and assertFalse()
2022-11-13 12:58:30 -08:00
Johannes Frohnmeyer 9409197165
Merge remote-tracking branch 'origin/master'
# Conflicts:
#	gson/src/main/java/com/google/gson/stream/JsonReader.java
#	gson/src/test/java/com/google/gson/functional/ReflectionAccessFilterTest.java
#	gson/src/test/java/com/google/gson/functional/ReflectionAccessTest.java
#	gson/src/test/java/com/google/gson/internal/bind/DefaultDateTypeAdapterTest.java
#	pom.xml
2022-10-31 12:44:34 +01:00
Marcono1234 ff96296eea
Add 2.10 changes to CHANGELOG; minor release follow-ups (#2229)
* 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
2022-10-30 04:01:20 -07:00
Snowhite dd6635dc61
Making consistent prefixs in PerformanceTest (#1760)
* Making consistent prefixs in PerformanceTest

change some "disable_" to "disabled_"

* Update PerformanceTest.java
2022-10-29 10:15:43 +02:00
Éamonn McManus 763e69a331 [maven-release-plugin] prepare for next development iteration 2022-10-24 18:06:57 -07:00
Éamonn McManus dd92e49b27 [maven-release-plugin] prepare release gson-parent-2.10 2022-10-24 18:06:55 -07:00
Éamonn McManus 79c27dd885 [maven-release-plugin] prepare for next development iteration 2022-10-24 17:48:57 -07:00
Éamonn McManus 87e9ee5511 [maven-release-plugin] prepare release gson-parent-2.10 2022-10-24 17:48:55 -07:00
Éamonn McManus 4705518e12
Revise the version regex in `GsonVersionDiagnosticsTest`. (#2228)
Before we can release 2.10 we must support two-digit components.
Additionally, there's no reason to require a patch number (2.10.0 rather than 2.10).
2022-10-24 17:47:38 -07:00
Éamonn McManus 7bca5c4061 [maven-release-plugin] rollback the release of gson-parent-2.10 2022-10-24 17:42:45 -07:00
Éamonn McManus c7544a0e86 [maven-release-plugin] prepare for next development iteration 2022-10-24 17:33:36 -07:00
Éamonn McManus 9efdfad33c [maven-release-plugin] prepare release gson-parent-2.10 2022-10-24 17:33:34 -07:00
Marcono1234 4f948dd482
Automatically replace version references on `release:prepare` (#2212)
* Automatically replace version references on `release:prepare`

* Specify encoding and improve placeholder replacements

* Add `since $next-version$` for `JsonArray.asList` and `JsonObject.asMap`
2022-10-24 17:26:43 -07:00
Éamonn McManus 9578583eff
Small tweaks to fix Error Prone warnings. (#2227)
* Small tweaks to fix Error Prone warnings.

* Add another suppression.
2022-10-24 10:28:25 -07:00