See details of ISPN-3480
PR for jdg-6.4.x here: https://github.com/infinispan/jdg/pull/263
Integrated.