Description
getCxfBinding is not thread safe in case multiple threads hit a CXF webserive at once and it hasnt been initialized before.
Code like this
public CxfBinding getCxfBinding() { if (cxfBinding == null) { cxfBinding = new DefaultCxfBinding(); if (LOG.isDebugEnabled()) { LOG.debug("Create default CXF Binding " + cxfBinding); } } if (!cxfBindingInitialized.getAndSet(true) && cxfBinding instanceof HeaderFilterStrategyAware) { ((HeaderFilterStrategyAware)cxfBinding) .setHeaderFilterStrategy(getHeaderFilterStrategy()); } return cxfBinding; }
Is a false sense as the getAndSet will let other threads pass it with a cxfBinding that still may not have been initialized.