Program: 19373
Project: 19373
Buggy source:
ObjectType specialize(ObjectType other){
  Preconditions.checkState(areRelatedNominalTypes(this.nominalType,other.nominalType));
  if (isTopObject() && other.objectKind.isUnrestricted()) {
    return other;
  }
  if (this.ns != null) {
    return specializeNamespace(other);
  }
  NominalType resultNomType;
  if (this.nominalType.isBuiltinObject() && other.nominalType.isStructuralInterface()) {
    resultNomType=this.nominalType;
  }
 else {
    resultNomType=NominalType.pickSubclass(this.nominalType,other.nominalType);
  }
  if (resultNomType.isClassy()) {
    Preconditions.checkState(this.fn == null && other.fn == null);
    PersistentMap<String,Property> newProps=meetPropsHelper(this.commonTypes,true,resultNomType,this.props,other.props);
    if (newProps == this.commonTypes.BOTTOM_PROPERTY_MAP) {
      return this.commonTypes.getBottomObject();
    }
    return new ObjectType(this.commonTypes,resultNomType,newProps,null,this.ns,false,this.objectKind);
  }
  FunctionType thisFn=this.fn;
  boolean isLoose=this.isLoose;
  if (resultNomType.isFunction() && this.fn == null) {
    thisFn=other.fn;
    isLoose=other.fn.isLoose();
  }
  PersistentMap<String,Property> newProps=meetPropsHelper(this.commonTypes,true,resultNomType,this.props,other.props);
  if (newProps == this.commonTypes.BOTTOM_PROPERTY_MAP) {
    return this.commonTypes.getBottomObject();
  }
  FunctionType newFn=thisFn == null ? null : thisFn.specialize(other.fn);
  if (!FunctionType.isInhabitable(newFn)) {
    return this.commonTypes.getBottomObject();
  }
  return new ObjectType(this.commonTypes,resultNomType,newProps,newFn,this.ns,isLoose,this.objectKind);
}

Fixed version (ground truth):
ObjectType specialize(ObjectType other){
  Preconditions.checkState(areRelatedNominalTypes(this.nominalType,other.nominalType));
  if (isTopObject() && other.objectKind.isUnrestricted()) {
    return other;
  }
  if (this.ns != null) {
    return specializeNamespace(other);
  }
  NominalType resultNomType;
  if (this.nominalType.isBuiltinObject() && other.nominalType.isStructuralInterface()) {
    resultNomType=this.nominalType;
  }
 else {
    resultNomType=NominalType.pickSubclass(this.nominalType,other.nominalType);
  }
  if (resultNomType.isClassy()) {
    Preconditions.checkState(this.fn == null && other.fn == null);
    PersistentMap<String,Property> newProps=meetPropsHelper(this.commonTypes,true,resultNomType,this.props,other.props);
    if (newProps == this.commonTypes.BOTTOM_PROPERTY_MAP) {
      return this.commonTypes.getBottomObject();
    }
    return new ObjectType(this.commonTypes,resultNomType,newProps,null,this.ns,false,this.objectKind);
  }
  FunctionType thisFn=this.fn;
  boolean isLoose=this.isLoose;
  if (resultNomType.isFunction() && this.fn == null) {
    thisFn=other.fn;
    isLoose=other.fn.isLoose();
  }
  if (isLoose && resultNomType.isLiteralObject()) {
    resultNomType=this.commonTypes.getObjectType();
  }
  PersistentMap<String,Property> newProps=meetPropsHelper(this.commonTypes,true,resultNomType,this.props,other.props);
  if (newProps == this.commonTypes.BOTTOM_PROPERTY_MAP) {
    return this.commonTypes.getBottomObject();
  }
  FunctionType newFn=thisFn == null ? null : thisFn.specialize(other.fn);
  if (!FunctionType.isInhabitable(newFn)) {
    return this.commonTypes.getBottomObject();
  }
  return new ObjectType(this.commonTypes,resultNomType,newProps,newFn,this.ns,isLoose,this.objectKind);
}