Program: 64554
Project: 64554
Buggy source:
/** 
 * INTERNAL: Figure out the access type for this entity. It works as follows: 1 - check for an explicit access type specification 2 - check our inheritance parents (ignoring explicit specifications) 3 - check our mapped superclasses (ignoring explicit specifications) for  the location of annotations 4 - check the entity itself for the location of annotations 5 - check for an xml default from a persistence-unit-metadata-defaults or  entity-mappings setting.     6 - we have exhausted our search, default to FIELD.
 */
@Override public void processAccessType(){
  String explicitAccessType=getAccess();
  String defaultAccessType=null;
  if (getDescriptor().isInheritanceSubclass()) {
    MetadataDescriptor parent=getDescriptor().getInheritanceParentDescriptor();
    while (parent != null) {
      if (!parent.getClassAccessor().hasAccess()) {
        defaultAccessType=parent.getDefaultAccess();
        break;
      }
      parent=parent.getInheritanceParentDescriptor();
    }
  }
  if (defaultAccessType == null) {
    for (    MappedSuperclassAccessor mappedSuperclass : getMappedSuperclasses()) {
      if (!mappedSuperclass.hasAccess()) {
        if (mappedSuperclass.hasObjectRelationalFieldMappingAnnotationsDefined()) {
          defaultAccessType=JPA_ACCESS_FIELD;
        }
 else         if (mappedSuperclass.hasObjectRelationalMethodMappingAnnotationsDefined()) {
          defaultAccessType=JPA_ACCESS_PROPERTY;
        }
        break;
      }
    }
    if (defaultAccessType == null) {
      if (hasObjectRelationalFieldMappingAnnotationsDefined()) {
        defaultAccessType=JPA_ACCESS_FIELD;
      }
 else       if (hasObjectRelationalMethodMappingAnnotationsDefined()) {
        defaultAccessType=JPA_ACCESS_PROPERTY;
      }
 else {
        if (getDescriptor().getDefaultAccess() != null) {
          defaultAccessType=getDescriptor().getDefaultAccess();
        }
 else {
          defaultAccessType=JPA_ACCESS_FIELD;
        }
      }
    }
  }
  getDescriptor().setDefaultAccess(defaultAccessType);
  if (explicitAccessType == null) {
    getLogger().logConfigMessage(MetadataLogger.ACCESS_TYPE,defaultAccessType,getJavaClass());
  }
  getDescriptor().setAccessTypeOnClassDescriptor(this.getAccessType());
}

Fixed version (ground truth):
/** 
 * INTERNAL: Figure out the access type for this entity. It works as follows: 1 - check for an explicit access type specification 2 - check our inheritance parents (ignoring explicit specifications) 3 - check our mapped superclasses (ignoring explicit specifications) for  the location of annotations 4 - check the entity itself for the location of annotations 5 - check for an xml default from a persistence-unit-metadata-defaults or  entity-mappings setting.     6 - we have exhausted our search, default to FIELD.
 */
@Override public void processAccessType(){
  String explicitAccessType=getAccess();
  String defaultAccessType=null;
  if (getDescriptor().isInheritanceSubclass()) {
    MetadataDescriptor parent=getDescriptor().getInheritanceParentDescriptor();
    while (parent != null) {
      if (!parent.getClassAccessor().hasAccess()) {
        defaultAccessType=parent.getDefaultAccess();
        break;
      }
      parent=parent.getInheritanceParentDescriptor();
    }
  }
  if (defaultAccessType == null) {
    for (    MappedSuperclassAccessor mappedSuperclass : getMappedSuperclasses()) {
      if (!mappedSuperclass.hasAccess()) {
        if (mappedSuperclass.hasObjectRelationalFieldMappingAnnotationsDefined()) {
          defaultAccessType=JPA_ACCESS_FIELD;
        }
 else         if (mappedSuperclass.hasObjectRelationalMethodMappingAnnotationsDefined()) {
          defaultAccessType=JPA_ACCESS_PROPERTY;
        }
        break;
      }
    }
    if (defaultAccessType == null) {
      if (hasObjectRelationalFieldMappingAnnotationsDefined()) {
        defaultAccessType=JPA_ACCESS_FIELD;
      }
 else       if (hasObjectRelationalMethodMappingAnnotationsDefined()) {
        defaultAccessType=JPA_ACCESS_PROPERTY;
      }
 else {
        if (getDescriptor().getDefaultAccess() != null) {
          defaultAccessType=getDescriptor().getDefaultAccess();
        }
 else {
          defaultAccessType=JPA_ACCESS_FIELD;
        }
      }
    }
  }
  getDescriptor().setDefaultAccess(defaultAccessType);
  if (explicitAccessType == null) {
    getLogger().logConfigMessage(MetadataLogger.ACCESS_TYPE,defaultAccessType,getJavaClass());
  }
  getDescriptor().setAccessTypeOnClassDescriptor(getAccessType());
}