Program: 81641
Project: 81641
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> 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);
}

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 {
      maybeReport(logger,problems);
    }
    allSucceeded&=entrySucceeded & !problems.hasFatalProblems();
  }
  if (!allSucceeded) {
    throw new UnableToCompleteException();
  }
  assertNothingPending();
  List<TypeInfoComputed> ticsToCheck=new ArrayList<TypeInfoComputed>();
  ticsToCheck.addAll(typeToTypeInfoComputed.values());
  for (  TypeInfoComputed tic : ticsToCheck) {
    JArrayType type=tic.getType().isArray();
    if (type != null && tic.instantiable) {
      ProblemReport problems=new ProblemReport();
      problems.setContextType(type);
      markArrayTypes(logger,type,tic.getPath(),problems);
      maybeReport(logger,problems);
      allSucceeded&=!problems.hasFatalProblems();
    }
  }
  if (!allSucceeded) {
    throw new UnableToCompleteException();
  }
  assertNothingPending();
  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);
}