Skip to content

Commit

Permalink
Add back TypeAdapters.JSON_ELEMENT_FACTORY
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcono1234 committed Aug 17, 2024
1 parent effad95 commit 72d5aab
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions gson/src/main/java/com/google/gson/internal/bind/TypeAdapters.java
Original file line number Diff line number Diff line change
Expand Up @@ -807,8 +807,9 @@ public void write(JsonWriter out, Locale value) throws IOException {
public static final TypeAdapterFactory LOCALE_FACTORY = newFactory(Locale.class, LOCALE);

/*
* The following adapter and factory fields are only deprecated for now because external projects
* might be using them, despite being part of Gson's internal implementation
* The following adapter and factory fields have not been removed yet and are only deprecated
* for now because external projects might be using them, despite being part of Gson's internal
* implementation.
*/

/**
Expand All @@ -821,6 +822,16 @@ public void write(JsonWriter out, Locale value) throws IOException {
@Deprecated
public static final TypeAdapter<JsonElement> JSON_ELEMENT = JsonElementTypeAdapter.ADAPTER;

/**
* @deprecated {@code TypeAdapters} is an internal Gson class. To obtain the adapter for {@link
* JsonElement} and subclasses use instead:
* <pre>{@code
* TypeAdapter<JsonElement> adapter = gson.getAdapter(JsonElement.class);
* }</pre>
*/
@Deprecated
public static final TypeAdapterFactory JSON_ELEMENT_FACTORY = JsonElementTypeAdapter.FACTORY;

/**
* @deprecated {@code TypeAdapters} is an internal Gson class. To obtain the adapter for a
* specific enum class use instead:
Expand Down

0 comments on commit 72d5aab

Please sign in to comment.