Program: 54375
Project: 54375
Buggy source:
/** 
 * Builds a   {@link SerializableTypeOracle} for a given set of root types.
 * @param logger
 * @return a {@link SerializableTypeOracle} for the specified set of roottypes
 * @throws UnableToCompleteException if there was not at least oneinstantiable type assignable to each of the specified root types
 */
public SerializableTypeOracle build(TreeLogger logger) throws UnableToCompleteException {
  alreadyCheckedObject=false;
  boolean allSucceeded=true;
  for (  Entry<JClassType,TreeLogger> entry : rootTypes.entrySet()) {
    ProblemReport problems=new ProblemReport();
    problems.setContextType(entry.getKey());
    boolean entrySucceeded=computeTypeInstantiability(entry.getValue(),entry.getKey(),TypePaths.createRootPath(entry.getKey()),problems).hasInstantiableSubtypes();
    if (!entrySucceeded) {
      problems.report(logger,TreeLogger.ERROR,TreeLogger.INFO);
    }
 else {
      if (problems.hasFatalProblems()) {
        entrySucceeded=false;
        problems.reportFatalProblems(logger,TreeLogger.ERROR);
      }
      problems.report(logger,TreeLogger.DEBUG,TreeLogger.DEBUG);
    }
    allSucceeded&=entrySucceeded;
  }
  if (!allSucceeded) {
    throw new UnableToCompleteException();
  }
  for (  TypeInfoComputed tic : typeToTypeInfoComputed.values()) {
    assert(!tic.isPendingInstantiable());
  }
  pruneUnreachableTypes();
  logReachableTypes(logger);
  Set<JClassType> possiblyEnhancedTypes=new TreeSet<JClassType>(JTYPE_COMPARATOR);
  Set<JClassType> possiblyInstantiatedTypes=new TreeSet<JClassType>(JTYPE_COMPARATOR);
  Set<JClassType> fieldSerializableTypes=new TreeSet<JClassType>(JTYPE_COMPARATOR);
  for (  TypeInfoComputed tic : typeToTypeInfoComputed.values()) {
    if (!(tic.getType() instanceof JClassType)) {
      continue;
    }
    JClassType type=(JClassType)tic.getType();
    type=type.getErasedType();
    if (tic.isInstantiable()) {
      assert(!type.isAbstract() || type.isEnum() != null);
      possiblyInstantiatedTypes.add(type);
    }
    if (tic.isFieldSerializable()) {
      assert(type.isInterface() == null);
      fieldSerializableTypes.add(type);
    }
    if ((enhancedClasses != null && enhancedClasses.contains(type.getQualifiedSourceName())) || tic.maybeEnhanced()) {
      possiblyEnhancedTypes.add(type);
    }
  }
  logSerializableTypes(logger,fieldSerializableTypes);
  return new SerializableTypeOracleImpl(fieldSerializableTypes,possiblyInstantiatedTypes,possiblyEnhancedTypes);
}

Fixed version (ground truth):
/** 
 * Builds a   {@link SerializableTypeOracle} for a given set of root types.
 * @param logger
 * @return a {@link SerializableTypeOracle} for the specified set of roottypes
 * @throws UnableToCompleteException if there was not at least oneinstantiable type assignable to each of the specified root types
 */
public SerializableTypeOracle build(TreeLogger logger) throws UnableToCompleteException {
  alreadyCheckedObject=false;
  boolean allSucceeded=true;
  for (  Entry<JClassType,TreeLogger> entry : rootTypes.entrySet()) {
    ProblemReport problems=new ProblemReport();
    problems.setContextType(entry.getKey());
    boolean entrySucceeded=computeTypeInstantiability(entry.getValue(),entry.getKey(),TypePaths.createRootPath(entry.getKey()),problems).hasInstantiableSubtypes();
    if (!entrySucceeded) {
      problems.report(logger,TreeLogger.ERROR,TreeLogger.INFO);
    }
 else {
      if (problems.hasFatalProblems()) {
        entrySucceeded=false;
        problems.reportFatalProblems(logger,TreeLogger.ERROR);
      }
      problems.report(logger,TreeLogger.DEBUG,TreeLogger.DEBUG);
    }
    allSucceeded&=entrySucceeded;
  }
  if (!allSucceeded) {
    throw new UnableToCompleteException();
  }
  for (  TypeInfoComputed tic : typeToTypeInfoComputed.values()) {
    assert(!tic.isPendingInstantiable());
  }
  pruneUnreachableTypes();
  logReachableTypes(logger);
  Set<JClassType> possiblyInstantiatedTypes=new TreeSet<JClassType>(JTYPE_COMPARATOR);
  Set<JClassType> fieldSerializableTypes=new TreeSet<JClassType>(JTYPE_COMPARATOR);
  for (  TypeInfoComputed tic : typeToTypeInfoComputed.values()) {
    if (!(tic.getType() instanceof JClassType)) {
      continue;
    }
    JClassType type=(JClassType)tic.getType();
    type=type.getErasedType();
    if (tic.isInstantiable()) {
      assert(!type.isAbstract() || type.isEnum() != null);
      possiblyInstantiatedTypes.add(type);
    }
    if (tic.isFieldSerializable()) {
      assert(type.isInterface() == null);
      fieldSerializableTypes.add(type);
    }
    if (tic.maybeEnhanced() || (enhancedClasses != null && enhancedClasses.contains(type.getQualifiedSourceName()))) {
      type.setEnhanced();
    }
  }
  logSerializableTypes(logger,fieldSerializableTypes);
  return new SerializableTypeOracleImpl(fieldSerializableTypes,possiblyInstantiatedTypes);
}