Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix a crash when combining generics and records #1442

Merged
merged 1 commit into from Dec 4, 2021

Conversation

swankjesse
Copy link
Member

Without the fix the test fails like so:

No JsonAdapter for T (with no annotations)
for T
for java.util.List<T>
for com.squareup.moshi.records.RecordsTest$IndirectGenerics<java.lang.Long>
for class com.squareup.moshi.records.RecordsTest$HasIndirectGenerics
java.lang.IllegalArgumentException: No JsonAdapter for T (with no annotations)
for T
for java.util.List<T>
for com.squareup.moshi.records.RecordsTest$IndirectGenerics<java.lang.Long>
for class com.squareup.moshi.records.RecordsTest$HasIndirectGenerics
  at com.squareup.moshi.Moshi$LookupChain.exceptionWithLookupStack(Moshi.java:389)
  at com.squareup.moshi.Moshi.adapter(Moshi.java:158)
  at com.squareup.moshi.Moshi.adapter(Moshi.java:106)
  at com.squareup.moshi.Moshi.adapter(Moshi.java:75)

Copy link
Collaborator

@ZacSweers ZacSweers left a comment

Choose a reason for hiding this comment

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

Nice catch. Just needs a spotlessApply fix

@swankjesse swankjesse force-pushed the jwilson.1204.indirect_generics branch from e45655b to b5aa002 Compare December 4, 2021 18:34
Without the fix the test fails like so:

    No JsonAdapter for T (with no annotations)
    for T
    for java.util.List<T>
    for com.squareup.moshi.records.RecordsTest$IndirectGenerics<java.lang.Long>
    for class com.squareup.moshi.records.RecordsTest$HasIndirectGenerics
    java.lang.IllegalArgumentException: No JsonAdapter for T (with no annotations)
    for T
    for java.util.List<T>
    for com.squareup.moshi.records.RecordsTest$IndirectGenerics<java.lang.Long>
    for class com.squareup.moshi.records.RecordsTest$HasIndirectGenerics
      at com.squareup.moshi.Moshi$LookupChain.exceptionWithLookupStack(Moshi.java:389)
      at com.squareup.moshi.Moshi.adapter(Moshi.java:158)
      at com.squareup.moshi.Moshi.adapter(Moshi.java:106)
      at com.squareup.moshi.Moshi.adapter(Moshi.java:75)
@swankjesse swankjesse force-pushed the jwilson.1204.indirect_generics branch from b5aa002 to 1cb15e3 Compare December 4, 2021 21:19
@swankjesse swankjesse merged commit cdcf0da into master Dec 4, 2021
@swankjesse swankjesse deleted the jwilson.1204.indirect_generics branch December 4, 2021 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants