org.dom4j.DocumentFactory.getInstance throws

Apparently a fix that is in the createSingleton(String name) class is not applied in createSingleton(). It causes the getInstance to throw "java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory" whenever there is class loader mismatch.

There is couple of bug reports filed that report similar behaviour I was experiencing:
JENKINS-15344
JENKINS-13709
JENKINS-7666
JENKINS-17488