There are a couple problems with the implementation of the hashcode() and equals() methods in EntityManagerFactoryImpl. First, neither checks whether _factory is null, which can and does cause NullPointException(s). Second, it's not usually good form to use instanceof in the equals() method in a class that is not "final" as it can easily violate the symmetry requirement of equivalence.
No testcase is provided in this case as it can be easily reproduced in while debugging in Eclipse, interrogating an instance of EntityManagerFactoryImpl prior to the instantiation of _factory, which will invoke the toString() method, which will invoke the hashcode() method, which will cause a NullPointerException.
A cursory check has turned up some other classes with similar implementation problems that I'll correct with separate patches as I do not feel comfortable doing it all in a single mass update.