CXF-8518: Fixing jaxrs.spec.provider.standardnotnull clientJaxbProviderTest#782
CXF-8518: Fixing jaxrs.spec.provider.standardnotnull clientJaxbProviderTest#782reta merged 1 commit intoapache:masterfrom
Conversation
a3c349d to
fd1a01a
Compare
|
Build is green: https://ci-builds.apache.org/job/CXF/job/CXF-JDK8-PR-Manual/14/ |
|
@andymc12 as always, need your expertise, mind please taking a look? thanks a lot! |
andymc12
left a comment
There was a problem hiding this comment.
@reta - we didn't need to make any changes to JAXBElementProvider, so we must've fixed this test case some other way. We did add a doPriv in the unmarshallFromInputStream method - I'll plan to contribute that back shortly. In any case, I think this change looks good. Thanks!
|
I like this better than my too-brittle hack :) The one concern I'd have is that I wonder if we wrapped the input stream instead of returning null and had the wrapper count the bytes read. We could check the count on an exception and use that to determine our blocking read returned no payload. It'd be sort of a hybrid of the two approaches. Thoughts? |
|
@dblevins thanks a lot for looking, that is correct, we do trust Otherwise the assumption is that stream is not empty (and we proceed further with mark / reset of pushback stream). What do you think? |
Thought about that as well but dealing with exceptions and counting the bytes would be more complicated comparing to the simple check that stream is empty. |
|
@reta You're totally right. I read too quickly and missed that My +1 |
Per specification:
For JAXB serialization / desearialization, the empty input stream (empty response) leads to
javax.xml.bind.UnmarshalException, for example: