* Used to print all the objects in the identity map of the passed in class.
* The output of this method will be logged to this session's SessionLog at SEVERE level.
*/
public void printIdentityMap(Class businessClass) {
String cr = Helper.cr();
ClassDescriptor descriptor = getSession().getDescriptor(businessClass);
int cacheCounter = 0;
StringWriter writer = new StringWriter();
if (descriptor.isAggregateDescriptor()) {
return;//do nothing if descriptor is aggregate
}
IdentityMap map = getIdentityMap(descriptor);
writer.write(LoggingLocalization.buildMessage("identitymap_for", new Object[] { cr, Helper.getShortClassName(map.getClass()), Helper.getShortClassName(businessClass) }));
if (descriptor.hasInheritance()) {
if (descriptor.getInheritancePolicy().isRootParentDescriptor()) {
writer.write(LoggingLocalization.buildMessage("includes"));
Vector childDescriptors;
childDescriptors = descriptor.getInheritancePolicy().getChildDescriptors();
if ((childDescriptors != null) && (childDescriptors.size() != 0)) {//Bug#2675242
Enumeration enum2 = childDescriptors.elements();
writer.write(Helper.getShortClassName((Class)((ClassDescriptor)enum2.nextElement()).getJavaClass()));
while (enum2.hasMoreElements()) {
writer.write(", " + Helper.getShortClassName((Class)((ClassDescriptor)enum2.nextElement()).getJavaClass()));