Commit Graph

2043 Commits

Author SHA1 Message Date
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 be62121f65
Bye 2
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-11-24 18:00:33 +01:00
Johannes Frohnmeyer 237f6a7153
Bye
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-11-24 18:00:06 +01:00
Johannes Frohnmeyer 79ae63f02a
Plz 2
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-11-24 17:54:26 +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
dependabot[bot] bc04dd20b9
Bump jackson-databind from 2.14.0 to 2.14.1 (#2241)
Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.14.0 to 2.14.1.
- [Release notes](https://github.com/FasterXML/jackson/releases)
- [Commits](https://github.com/FasterXML/jackson/commits)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-databind
  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>
2022-11-23 08:33:01 -08:00
dependabot[bot] 3f1e62d1e1
Bump japicmp-maven-plugin from 0.16.0 to 0.17.1 (#2238)
Bumps [japicmp-maven-plugin](https://github.com/siom79/japicmp) from 0.16.0 to 0.17.1.
- [Release notes](https://github.com/siom79/japicmp/releases)
- [Changelog](https://github.com/siom79/japicmp/blob/master/release.py)
- [Commits](https://github.com/siom79/japicmp/compare/japicmp-base-0.16.0...japicmp-base-0.17.1)

---
updated-dependencies:
- dependency-name: com.github.siom79.japicmp:japicmp-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-11-17 06:39:01 -08: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
Marcono1234 92b7ae0ca0
Mention in CHANGELOG that GitHub Releases are used in the future (#2230) 2022-11-13 09:08:06 -08:00
dependabot[bot] 94b5310da4
Bump maven-release-plugin from 3.0.0-M6 to 3.0.0-M7 (#2232)
Bumps [maven-release-plugin](https://github.com/apache/maven-release) from 3.0.0-M6 to 3.0.0-M7.
- [Release notes](https://github.com/apache/maven-release/releases)
- [Commits](https://github.com/apache/maven-release/compare/maven-release-3.0.0-M6...maven-release-3.0.0-M7)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-release-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>
2022-11-13 09:07:33 -08:00
dependabot[bot] c995c12b5a
Bump jackson-databind from 2.13.4.2 to 2.14.0 (#2234)
Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.13.4.2 to 2.14.0.
- [Release notes](https://github.com/FasterXML/jackson/releases)
- [Commits](https://github.com/FasterXML/jackson/commits)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-databind
  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-11-13 09:07:11 -08:00
dependabot[bot] b504d0e9ff
Bump os-maven-plugin from 1.7.0 to 1.7.1 (#2235)
Bumps [os-maven-plugin](https://github.com/trustin/os-maven-plugin) from 1.7.0 to 1.7.1.
- [Release notes](https://github.com/trustin/os-maven-plugin/releases)
- [Commits](https://github.com/trustin/os-maven-plugin/compare/os-maven-plugin-1.7.0...os-maven-plugin-1.7.1)

---
updated-dependencies:
- dependency-name: kr.motd.maven:os-maven-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>
2022-11-13 09:06:54 -08:00
Johannes Frohnmeyer 40c97cdb6c
Remove github stuff
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-11-03 15:21:36 +01:00
Johannes Frohnmeyer 97aa219236
Set up self-hosted
ci/woodpecker/manual/woodpecker Pipeline was successful Details
2022-11-03 15:20:24 +01:00
Johannes Frohnmeyer c2eb4aad9a
Update CI 2022-10-31 13:28:11 +01: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 7ca36c5e67 Add a `<developers>` section to the main `pom.xml`. 2022-10-24 18:06:21 -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
Marcono1234 66d9621ce8
Adjust Record adapter and extend test coverage (#2224)
* 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
2022-10-22 09:01:56 -07:00
Marcono1234 954d526af4
Add `JsonArray.asList` and `JsonObject.asMap` view methods (#2225)
* Add `JsonArray.asList` and `JsonObject.asMap` view methods

* Address review comments
2022-10-16 12:30:49 -07:00
dependabot[bot] c2458bf876
Bump jackson-databind from 2.13.4.1 to 2.13.4.2 (#2223)
Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.13.4.1 to 2.13.4.2.
- [Release notes](https://github.com/FasterXML/jackson/releases)
- [Commits](https://github.com/FasterXML/jackson/commits)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-databind
  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>
2022-10-14 13:28:29 -07:00
dependabot[bot] 243f5e1126
Bump jackson-databind from 2.13.4 to 2.13.4.1 (#2222)
Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.13.4 to 2.13.4.1.
- [Release notes](https://github.com/FasterXML/jackson/releases)
- [Commits](https://github.com/FasterXML/jackson/commits)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-databind
  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>
2022-10-13 16:19:08 -07:00
Éamonn McManus 86c35bba30
Small adjustments to the new record code. (#2219)
* Small adjustments to the new record code.

* Replace wildcard imports with single imports.
* Enable `Java17RecordTest` and fix its many previously-hidden problems.
* Use a `Map` to get primitive zero values rather than a potentially-expensive reflective trick.
* Apply some automated code fixes.

* Address review comments.
2022-10-12 14:24:36 -07:00
Ståle Undheim a0dc7bfddd
Support Java Records when present in JVM. (#2201)
* Support Java Records when present in JVM.

Fixes google/gson#1794

Added support in the ReflectionHelper to detect if a class is a record
on the JVM (via reflection), and if so, we will create a special
RecordAdapter to deserialize records, using the canoncial constructor.

The ReflectionTypeAdapterFactory had to be refactored a bit to support
this. The Adapter class inside the factory is now abstract, with
concrete implementations for normal field reflection and for Records.
The common code is in the Adapter, with each implementation
deserializing values into an intermediary object.

For the FieldReflectionAdapter, the intermediary is actually the final
result, and field access is used to write to fields as before. For the
RecordAdapter the intermediary is the Object[] to pass to the Record
constructor.

* Fixed comments from @Marcono1234

Also updated so that we now use the record accessor method to read out
values from a record, so that direct field access is not necessary.

Also added some tests, that should only execute on Java versions with
record support, and be ignored for other JVMs

* Fixed additional comments from @Marcono1234

* Made Adapter in ReflectiveTypeAdapterFactory public

Fix comment from @eamonnmcmanus
2022-10-11 09:13:49 -07:00
Marcono1234 8451c1fa63
Fix TypeAdapterRuntimeTypeWrapper not detecting reflective TreeTypeAdapter and FutureTypeAdapter (#1787)
* Fix TypeAdapterRuntimeTypeWrapper not detecting reflective TreeTypeAdapter

Previously on serialization TypeAdapterRuntimeTypeWrapper preferred a
TreeTypeAdapter without `serializer` which falls back to the reflective
adapter. This behavior was incorrect because it caused the reflective
adapter for a Base class to be used for serialization (indirectly as
TreeTypeAdapter delegate) instead of using the reflective adapter for
a Subclass extending Base.

* Address review feedback

* Convert TypeAdapterRuntimeTypeWrapperTest to JUnit 4 test

* Prefer wrapped reflective adapter for serialization of subclass

* Detect reflective adapter used as delegate for Gson.FutureTypeAdapter

* Tiny style tweak.

Co-authored-by: Éamonn McManus <emcmanus@google.com>
2022-10-10 16:10:48 -07:00
Marcono1234 5269701679
Improve `JsonReader.skipValue()` (#2062)
* Fix JsonReader.skipValue() not behaving properly at end of document

JsonReader implementation erroneously reset `peeked` to PEEKED_NONE;
JsonTreeReader threw ArrayIndexOutOfBoundsException.

* Fix JsonReader.skipValue() not behaving properly at end of array and object

For JsonReader this caused an IllegalStateException (in the past it caused
JsonReader to get stuck in an infinite loop); for JsonTreeReader it only
popped the empty iterator but not the JsonArray or JsonObject, which caused
peek() to again report END_ARRAY or END_OBJECT.

* Only have JsonReader.skipValue() overwrite path name when name was skipped

This improves the JSON path when the value for a property was skipped and
before the subsequent property (or the end of the object) getPath() is called.

* Address feedback; improve test coverage

Co-authored-by: Éamonn McManus <emcmanus@google.com>
2022-10-10 07:51:36 -07:00
Marcono1234 e614e71ee4
Clarify in documentation that Gson might cache strategy results (#2215)
* Clarify in documentation that Gson might cache strategy results

* Improve wording; mention that adapter factory results are cached as well
2022-10-04 09:01:55 -07:00
Marcono1234 3e3266cf48
Perform numeric conversion for primitive numeric type adapters (#2158)
* Perform numeric conversion for primitive numeric type adapters

This should probably not be visible to the user unless they use the
non-typesafe `Gson.toJson(Object, Type)` where unrelated number types can
be used, or when malformed generic containers are used. For example a
`List<Byte>` containing a Float.

This change also has the advantage of avoiding `JsonWriter.value(Number)`
for primitive type adapters. That method has some overhead because it needs
to make sure that the value is a valid JSON number. However, for primitive
numbers this check is redundant.

* Don't call `JsonWriter.value(float)` for backward compatibility

* Fix typo in comments
2022-10-04 07:22:26 -07:00
Marcono1234 796193d032
Improve versioning support documentation and validate version (#2214) 2022-10-02 16:38:43 -07:00
Marcono1234 28609089fa
Add Javadoc since tags for previously added elements (#2211) 2022-10-01 15:58:26 -07:00
BillyGalbreath 47668fad57
Fix typo in GsonBuilder Javadoc (#2213) 2022-10-01 15:57:16 -07:00
Marcono1234 ea7ab7cd52
Mention in User Guide alternative for Gson versions without fromJson(..., TypeToken) (#2209) 2022-09-30 07:57:02 -07:00
kb1000 9c9cafcf9d
Only create one UnsafeAllocator instance (#2196)
* Only create one UnsafeAllocator instance

* Move checkInstantiable to ConstructorConstructor
2022-09-29 15:59:47 -07:00
Marcono1234 b777ae5216
Disable Maven transfer progress for GitHub workflows (#2206)
Disables the download transfer progress which is shown when Maven downloads
(or uploads) artifacts which are not available in the local repository.
This download progress can be quite verbose and is normally not that relevant.
2022-09-27 23:05:49 -07:00