Remove @Synchronized annotation from Rfc3339DateJsonAdapter. (#1842)

* Remove synchronized modifier from Rfc3339DateJsonAdapter

* Added a small note to avoid regression in the future.
This commit is contained in:
Sangho
2024-05-28 09:47:45 -07:00
committed by GitHub
parent e80149c919
commit 892a4d9ca5

View File

@@ -34,7 +34,8 @@ import java.util.Date
* ``` * ```
*/ */
public class Rfc3339DateJsonAdapter : JsonAdapter<Date>() { public class Rfc3339DateJsonAdapter : JsonAdapter<Date>() {
@Synchronized
/** The underlying deserialization logic is thread-safe and does not require synchronization. **/
@Throws(IOException::class) @Throws(IOException::class)
override fun fromJson(reader: JsonReader): Date? { override fun fromJson(reader: JsonReader): Date? {
if (reader.peek() == NULL) { if (reader.peek() == NULL) {
@@ -44,7 +45,7 @@ public class Rfc3339DateJsonAdapter : JsonAdapter<Date>() {
return string.parseIsoDate() return string.parseIsoDate()
} }
@Synchronized /*** The underlying serialization logic is thread-safe and does not require synchronization. **/
@Throws(IOException::class) @Throws(IOException::class)
override fun toJson(writer: JsonWriter, value: Date?) { override fun toJson(writer: JsonWriter, value: Date?) {
if (value == null) { if (value == null) {