Skip to content

Commit

Permalink
Add note about sorting
Browse files Browse the repository at this point in the history
This note is needed in order to folks debugging in the future
from going down the wrong path and having the TCK fail
  • Loading branch information
geoand committed Oct 10, 2022
1 parent c441cc6 commit 927a975
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,11 @@ public List<MessageBodyWriter<?>> findBuildTimeWriters(Class<?> entityType, Runt
}

}
return toMessageBodyWriters(findResourceWriters(writers, klass, produces, runtimeType));

var resourceWriters = findResourceWriters(writers, klass, produces, runtimeType);
// we must NOT sort here because the spec mentions that the writers closer to the requested java type are tried first
// and the list has already been built up in this way
return toMessageBodyWriters(resourceWriters);
}

protected List<ResourceWriter> findResourceWriters(QuarkusMultivaluedMap<Class<?>, ResourceWriter> writers, Class<?> klass,
Expand Down

0 comments on commit 927a975

Please sign in to comment.