Skip to content

Commit aa10789

Browse files
committed
Merge pull request google#694 from Dorvaryn/delegate_type_adapter_is_order_dependent
getDelegateAdapter is order dependant and skips more than one typeAdapterFactory.
2 parents b973887 + 618343f commit aa10789

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

gson/src/main/java/com/google/gson/Gson.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,10 @@ public <T> TypeAdapter<T> getAdapter(TypeToken<T> type) {
410410
* System.out.println("Num JSON reads" + stats.numReads);
411411
* System.out.println("Num JSON writes" + stats.numWrites);
412412
* }</pre>
413+
* Note that this call will skip all factories registered before {@code skipPast}. In case of
414+
* multiple TypeAdapterFactories registered it is up to the caller of this function to insure
415+
* that the order of registration does not prevent this method from reaching a factory they
416+
* would expect to reply from this call.
413417
* Note that since you can not override type adapter factories for String and Java primitive
414418
* types, our stats factory will not count the number of String or primitives that will be
415419
* read or written.

0 commit comments

Comments
 (0)