Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add explicit support for floats in JsonTreeWriter. #2132

Merged
merged 1 commit into from
Jun 21, 2022

Conversation

Capstan
Copy link
Contributor

@Capstan Capstan commented Jun 10, 2022

Follow-up to comments on #2130, which introduced a new override which was not overridden by JsonTreeWriter. Also tweaks the doccomments for the float, double, and Number variants of JsonWriter.value.

Supplement to the fix for #1127.

Follow-up to comments on google#2130, which introduced a new override which was not overridden by `JsonTreeWriter`. Also tweaks the doccomments for `float`, `double` and `Number` variants of `JsonWriter.value`.

Supplement to the fix for google#1127.
@Capstan
Copy link
Contributor Author

Capstan commented Jun 11, 2022

/cc @eamonnmcmanus

@eamonnmcmanus
Copy link
Member

I'll give @Marcono1234 a chance to comment this time before merging. :-)
It seems like a mistake for JsonTreeWriter to extend JsonWriter, but probably not one we can fix. I'm somewhat tempted to add a test that will fail if you add a value overload to JsonWriter and don't override it in JsonTreeWriter, but it's kind of like locking the stable door after the horse has bolted.

Copy link
Collaborator

@Marcono1234 Marcono1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll give @Marcono1234 a chance to comment this time before merging. :-)

Looks good to me. It is also great that this adjusts the tests to cover the newly added method!

@Capstan
Copy link
Contributor Author

Capstan commented Jun 21, 2022

Does this need further review?

@eamonnmcmanus eamonnmcmanus merged commit d2aee65 into google:master Jun 21, 2022
sgammon referenced this pull request in elide-dev/elide Jan 15, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.code.gson:gson-parent](https://github.com/google/gson) |
`2.9.0` -> `2.10.1` |
[![age](https://badges.renovateapi.com/packages/maven/com.google.code.gson:gson-parent/2.10.1/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/maven/com.google.code.gson:gson-parent/2.10.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/maven/com.google.code.gson:gson-parent/2.10.1/compatibility-slim/2.9.0)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/maven/com.google.code.gson:gson-parent/2.10.1/confidence-slim/2.9.0)](https://docs.renovatebot.com/merge-confidence/)
|
| [com.google.code.gson:gson](https://github.com/google/gson) |
`2.9.0` -> `2.10.1` |
[![age](https://badges.renovateapi.com/packages/maven/com.google.code.gson:gson/2.10.1/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/maven/com.google.code.gson:gson/2.10.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/maven/com.google.code.gson:gson/2.10.1/compatibility-slim/2.9.0)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/maven/com.google.code.gson:gson/2.10.1/confidence-slim/2.9.0)](https://docs.renovatebot.com/merge-confidence/)
|

---

### ⚠ Dependency Lookup Warnings ⚠

Warnings were logged while processing this repo. Please check the
Dependency Dashboard for more information.

---

### Release Notes

<details>
<summary>google/gson</summary>

###
[`v2.10`](https://github.com/google/gson/blob/HEAD/CHANGELOG.md#Version-210)

- Support for serializing and deserializing Java records, on Java ≥ 16.
([https://github.com/google/gson/pull/2201](https://github.com/google/gson/pull/2201))
- Add `JsonArray.asList` and `JsonObject.asMap` view methods
([https://github.com/google/gson/pull/2225](https://github.com/google/gson/pull/2225))
- Fix `TypeAdapterRuntimeTypeWrapper` not detecting reflective
`TreeTypeAdapter` and `FutureTypeAdapter`
([https://github.com/google/gson/pull/1787](https://github.com/google/gson/pull/1787))
- Improve `JsonReader.skipValue()`
([https://github.com/google/gson/pull/2062](https://github.com/google/gson/pull/2062))
- Perform numeric conversion for primitive numeric type adapters
([https://github.com/google/gson/pull/2158](https://github.com/google/gson/pull/2158))
- Add `Gson.fromJson(..., TypeToken)` overloads
([https://github.com/google/gson/pull/1700](https://github.com/google/gson/pull/1700))
- Fix changes to `GsonBuilder` affecting existing `Gson` instances
([https://github.com/google/gson/pull/1815](https://github.com/google/gson/pull/1815))
- Make `JsonElement` conversion methods more consistent and fix javadoc
([https://github.com/google/gson/pull/2178](https://github.com/google/gson/pull/2178))
- Throw `UnsupportedOperationException` when `JsonWriter.jsonValue` is
not supported
([https://github.com/google/gson/pull/1651](https://github.com/google/gson/pull/1651))
- Disallow `JsonObject` `Entry.setValue(null)`
([https://github.com/google/gson/pull/2167](https://github.com/google/gson/pull/2167))
- Fix `TypeAdapter.toJson` throwing AssertionError for custom
IOException
([https://github.com/google/gson/pull/2172](https://github.com/google/gson/pull/2172))
- Convert null to JsonNull for `JsonArray.set`
([https://github.com/google/gson/pull/2170](https://github.com/google/gson/pull/2170))
- Fixed nullSafe usage.
([https://github.com/google/gson/pull/1555](https://github.com/google/gson/pull/1555))
- Validate `TypeToken.getParameterized` arguments
([https://github.com/google/gson/pull/2166](https://github.com/google/gson/pull/2166))
- Fix [#&#8203;1702](https://github.com/google/gson/issues/1702):
Gson.toJson creates CharSequence which does not implement toString
([https://github.com/google/gson/pull/1703](https://github.com/google/gson/pull/1703))
- Prefer existing adapter for concurrent `Gson.getAdapter` calls
([https://github.com/google/gson/pull/2153](https://github.com/google/gson/pull/2153))
- Improve `ArrayTypeAdapter` for `Object[]`
([https://github.com/google/gson/pull/1716](https://github.com/google/gson/pull/1716))
- Improve `AppendableWriter` performance
([https://github.com/google/gson/pull/1706](https://github.com/google/gson/pull/1706))

###
[`v2.9.1`](https://github.com/google/gson/blob/HEAD/CHANGELOG.md#Version-291)

- Make `Object` and `JsonElement` deserialization iterative rather than

recursi[https://github.com/google/gson/pull/1912](https://github.com/google/gson/pull/1912)1912)
- Added parsing support for enum that has overridden toString() method
([https://github.com/google/gson/pull/1950](https://github.com/google/gson/pull/1950))
- Removed support for building Gson with Gradle
([https://github.com/google/gson/pull/2081](https://github.com/google/gson/pull/2081))
- Removed obsolete `codegen` hierarchy
([https://github.com/google/gson/pull/2099](https://github.com/google/gson/pull/2099))
- Add support for reflection access filter
([https://github.com/google/gson/pull/1905](https://github.com/google/gson/pull/1905))
- Improve `TypeToken` creation validation
([https://github.com/google/gson/pull/2072](https://github.com/google/gson/pull/2072))
- Add explicit support for `float` in `JsonWriter`
([https://github.com/google/gson/pull/2130](https://github.com/google/gson/pull/2130),
[https://github.com/google/gson/pull/2132](https://github.com/google/gson/pull/2132))
- Fail when parsing invalid local date
([https://github.com/google/gson/pull/2134](https://github.com/google/gson/pull/2134))

Also many small improvements to javadoc.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/elide-dev/v3).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xMDIuMCIsInVwZGF0ZWRJblZlciI6IjM0LjEwMi4wIn0=-->
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants