Program: 67418
Project: 67418
Buggy source:
/** 
 * INTERNAL: Set the correct indirection policy on a collection mapping. Method assume that the reference class has been set on the mapping before calling this method.
 */
protected void setIndirectionPolicy(CollectionMapping mapping,String mapKey,boolean usesIndirection){
  MetadataClass rawClass=getRawClass();
  if (usesIndirection) {
    if (rawClass.equals(Map.class)) {
      if (mapping.isDirectMapMapping()) {
        ((DirectMapMapping)mapping).useTransparentMap();
      }
 else {
        mapping.useTransparentMap(mapKey);
      }
    }
 else     if (rawClass.equals(List.class)) {
      mapping.useTransparentList();
    }
 else     if (rawClass.equals(Collection.class)) {
      mapping.useTransparentCollection();
      mapping.setContainerPolicy(new CollectionContainerPolicy(ClassConstants.IndirectList_Class));
    }
 else     if (rawClass.equals(Set.class)) {
      mapping.useTransparentSet();
    }
 else {
      getLogger().logWarningMessage(MetadataLogger.WARNING_INVALID_COLLECTION_USED_ON_LAZY_RELATION,getJavaClass(),getAnnotatedElement(),rawClass);
    }
  }
 else {
    mapping.dontUseIndirection();
    if (rawClass.equals(Map.class)) {
      if (mapping.isDirectMapMapping()) {
        ((DirectMapMapping)mapping).useMapClass(java.util.Hashtable.class);
      }
 else {
        mapping.useMapClass(java.util.Hashtable.class,mapKey);
      }
    }
 else     if (rawClass.equals(Set.class)) {
      mapping.useCollectionClass(java.util.HashSet.class);
    }
 else     if (rawClass.equals(List.class)) {
      mapping.useCollectionClass(java.util.Vector.class);
    }
 else     if (rawClass.equals(Collection.class)) {
      mapping.setContainerPolicy(new CollectionContainerPolicy(java.util.Vector.class));
    }
 else {
      if (mapKey == null || mapKey.equals("String_Node_Str")) {
        mapping.useCollectionClassName(rawClass.getName());
      }
 else {
        mapping.useMapClassName(rawClass.getName(),mapKey);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Set the correct indirection policy on a collection mapping. Method assume that the reference class has been set on the mapping before calling this method.
 */
protected void setIndirectionPolicy(CollectionMapping mapping,String mapKey,boolean usesIndirection){
  MetadataClass rawClass=getRawClass();
  if (usesIndirection) {
    if (rawClass.equals(Map.class)) {
      if (mapping.isDirectMapMapping()) {
        ((DirectMapMapping)mapping).useTransparentMap();
      }
 else {
        mapping.useTransparentMap(mapKey);
      }
    }
 else     if (rawClass.equals(List.class)) {
      mapping.useTransparentList();
    }
 else     if (rawClass.equals(Collection.class)) {
      mapping.useTransparentCollection();
    }
 else     if (rawClass.equals(Set.class)) {
      mapping.useTransparentSet();
    }
 else {
      getLogger().logWarningMessage(MetadataLogger.WARNING_INVALID_COLLECTION_USED_ON_LAZY_RELATION,getJavaClass(),getAnnotatedElement(),rawClass);
    }
  }
 else {
    mapping.dontUseIndirection();
    if (rawClass.equals(Map.class)) {
      if (mapping.isDirectMapMapping()) {
        ((DirectMapMapping)mapping).useMapClass(java.util.Hashtable.class);
      }
 else {
        mapping.useMapClass(java.util.Hashtable.class,mapKey);
      }
    }
 else     if (rawClass.equals(Set.class)) {
      mapping.useCollectionClass(java.util.HashSet.class);
    }
 else     if (rawClass.equals(List.class)) {
      mapping.useCollectionClass(java.util.Vector.class);
    }
 else     if (rawClass.equals(Collection.class)) {
      mapping.setContainerPolicy(new CollectionContainerPolicy(java.util.Vector.class));
    }
 else {
      if (mapKey == null || mapKey.equals("String_Node_Str")) {
        mapping.useCollectionClassName(rawClass.getName());
      }
 else {
        mapping.useMapClassName(rawClass.getName(),mapKey);
      }
    }
  }
}