Jaxb2Marshaller.getJaxbContext() is synchronized and is in code path of both marshal() and unmarshal(). I think this should be synchronized if and only if it's not lazily initialized.
Indeed, using a volatile field and only entering a synchronized block if that field isn't set yet (with the synchronized block performing another not-null check at its beginning) should be more appropriate here. We're using similar lazy initialization techniques in other parts of Spring already.
Serkan Kaba opened SPR-9867 and commented
Jaxb2Marshaller.getJaxbContext() is synchronized and is in code path of both marshal() and unmarshal(). I think this should be synchronized if and only if it's not lazily initialized.
No further details from SPR-9867
The text was updated successfully, but these errors were encountered: