nus-yam/ex-repair huggingface dataset:
Program: 27953
Project: 27953
Buggy source:
@Override protected CompilerPass getProcessor(Compiler compiler){
  if (withClosurePass) {
    return new ClosurePassAndRenameVars(compiler);
  }
 else {
    return renameVars=new RenameVars(compiler,prefix,localRenamingOnly,preserveFunctionExpressionNames,generatePseudoNames,shouldShadow,previouslyUsedMap,null,null);
  }
}

Fixed version (ground truth):
@Override protected CompilerPass getProcessor(Compiler compiler){
  CompilerPass pass;
  if (withClosurePass) {
    pass=new ClosurePassAndRenameVars(compiler);
  }
 else {
    pass=renameVars=new RenameVars(compiler,prefix,localRenamingOnly,preserveFunctionExpressionNames,generatePseudoNames,shouldShadow,previouslyUsedMap,null,null);
  }
  if (withNormalize) {
    pass=new NormalizePassWrapper(compiler,pass);
  }
  return pass;
}
Program: 27954
Project: 27954
Buggy source:
/** 
 * Check whether there's any property conflict for for a particular super interface
 * @param t The node traversal object that supplies context
 * @param n The node being visited
 * @param functionName The function name being checked
 * @param properties The property names in the super interfaces that havebeen visited
 * @param currentProperties The property names in the super interfacethat have been visited
 * @param interfaceType The super interface that is being visited
 */
private void checkInterfaceConflictProperties(NodeTraversal t,Node n,String functionName,HashMap<String,ObjectType> properties,HashMap<String,ObjectType> currentProperties,ObjectType interfaceType){
  Set<String> currentPropertyNames=interfaceType.getImplicitPrototype().getOwnPropertyNames();
  for (  String name : currentPropertyNames) {
    ObjectType oType=properties.get(name);
    if (oType != null) {
      if (!interfaceType.getPropertyType(name).isEquivalentTo(oType.getPropertyType(name))) {
        compiler.report(t.makeError(n,INCOMPATIBLE_EXTENDED_PROPERTY_TYPE,functionName,name,oType.toString(),interfaceType.toString()));
      }
    }
    currentProperties.put(name,interfaceType);
  }
  for (  ObjectType iType : interfaceType.getCtorExtendedInterfaces()) {
    checkInterfaceConflictProperties(t,n,functionName,properties,currentProperties,iType);
  }
}

Fixed version (ground truth):
/** 
 * Check whether there's any property conflict for for a particular super interface
 * @param t The node traversal object that supplies context
 * @param n The node being visited
 * @param functionName The function name being checked
 * @param properties The property names in the super interfaces that havebeen visited
 * @param currentProperties The property names in the super interfacethat have been visited
 * @param interfaceType The super interface that is being visited
 */
private void checkInterfaceConflictProperties(NodeTraversal t,Node n,String functionName,HashMap<String,ObjectType> properties,HashMap<String,ObjectType> currentProperties,ObjectType interfaceType){
  ObjectType implicitProto=interfaceType.getImplicitPrototype();
  Set<String> currentPropertyNames;
  if (implicitProto == null) {
    currentPropertyNames=ImmutableSet.of();
  }
 else {
    currentPropertyNames=implicitProto.getOwnPropertyNames();
  }
  for (  String name : currentPropertyNames) {
    ObjectType oType=properties.get(name);
    if (oType != null) {
      if (!interfaceType.getPropertyType(name).isEquivalentTo(oType.getPropertyType(name))) {
        compiler.report(t.makeError(n,INCOMPATIBLE_EXTENDED_PROPERTY_TYPE,functionName,name,oType.toString(),interfaceType.toString()));
      }
    }
    currentProperties.put(name,interfaceType);
  }
  for (  ObjectType iType : interfaceType.getCtorExtendedInterfaces()) {
    checkInterfaceConflictProperties(t,n,functionName,properties,currentProperties,iType);
  }
}
Program: 27955
Project: 27955
Buggy source:
boolean isParameterizeSubtypeOf(JSType thatType){
  if (thatType.isParameterizedType()) {
    JSType thisParameter=this.parameterType;
    JSType thatParameter=thatType.toMaybeParameterizedType().parameterType;
    return this.wrapsSameRawType(thatType) && (thisParameter.isSubtype(thatParameter) || thatParameter.isSubtype(thisParameter));
  }
 else {
    return this.getReferencedTypeInternal().isSubtype(thatType);
  }
}

Fixed version (ground truth):
boolean isParameterizeSubtypeOf(JSType thatType){
  if (thatType.isParameterizedType()) {
    JSType thisParameter=this.parameterType;
    JSType thatParameter=thatType.toMaybeParameterizedType().parameterType;
    if (this.wrapsSameRawType(thatType)) {
      return (thisParameter.isSubtype(thatParameter) || thatParameter.isSubtype(thisParameter));
    }
  }
  return this.getReferencedTypeInternal().isSubtype(thatType);
}
Program: 27956
Project: 27956
Buggy source:
/** 
 * TypeExpression := BasicTypeExpression | '?' BasicTypeExpression | '!' BasicTypeExpression | BasicTypeExpression '?' | BasicTypeExpression '!' | '?'
 */
private Node parseTypeExpression(JsDocToken token){
  if (token == JsDocToken.QMARK) {
    token=next();
    if (token == JsDocToken.COMMA || token == JsDocToken.EQUALS || token == JsDocToken.RB || token == JsDocToken.RC || token == JsDocToken.RP || token == JsDocToken.PIPE) {
      restoreLookAhead(token);
      return newNode(Token.QMARK);
    }
    return wrapNode(Token.QMARK,parseBasicTypeExpression(token));
  }
 else   if (token == JsDocToken.BANG) {
    return wrapNode(Token.BANG,parseBasicTypeExpression(next()));
  }
 else {
    Node basicTypeExpr=parseBasicTypeExpression(token);
    if (basicTypeExpr != null) {
      if (match(JsDocToken.QMARK)) {
        next();
        return wrapNode(Token.QMARK,basicTypeExpr);
      }
 else       if (match(JsDocToken.BANG)) {
        next();
        return wrapNode(Token.BANG,basicTypeExpr);
      }
    }
    return basicTypeExpr;
  }
}

Fixed version (ground truth):
/** 
 * TypeExpression := BasicTypeExpression | '?' BasicTypeExpression | '!' BasicTypeExpression | BasicTypeExpression '?' | BasicTypeExpression '!' | '?'
 */
private Node parseTypeExpression(JsDocToken token){
  if (token == JsDocToken.QMARK) {
    token=next();
    if (token == JsDocToken.COMMA || token == JsDocToken.EQUALS || token == JsDocToken.RB || token == JsDocToken.RC || token == JsDocToken.RP || token == JsDocToken.PIPE || token == JsDocToken.GT) {
      restoreLookAhead(token);
      return newNode(Token.QMARK);
    }
    return wrapNode(Token.QMARK,parseBasicTypeExpression(token));
  }
 else   if (token == JsDocToken.BANG) {
    return wrapNode(Token.BANG,parseBasicTypeExpression(next()));
  }
 else {
    Node basicTypeExpr=parseBasicTypeExpression(token);
    if (basicTypeExpr != null) {
      if (match(JsDocToken.QMARK)) {
        next();
        return wrapNode(Token.QMARK,basicTypeExpr);
      }
 else       if (match(JsDocToken.BANG)) {
        next();
        return wrapNode(Token.BANG,basicTypeExpr);
      }
    }
    return basicTypeExpr;
  }
}
Program: 27957
Project: 27957
Buggy source:
/** 
 * TypeName := NameExpression | NameExpression TypeApplication TypeApplication := '.<' TypeExpressionList '>' TypeExpressionList := TypeExpression // a white lie
 */
private Node parseTypeName(JsDocToken token){
  if (token != JsDocToken.STRING) {
    return reportGenericTypeSyntaxWarning();
  }
  String typeName=stream.getString();
  int lineno=stream.getLineno();
  int charno=stream.getCharno();
  while (match(JsDocToken.EOL) && typeName.charAt(typeName.length() - 1) == '.') {
    skipEOLs();
    if (match(JsDocToken.STRING)) {
      next();
      typeName+=stream.getString();
    }
  }
  Node typeNameNode=newStringNode(typeName,lineno,charno);
  if (match(JsDocToken.LT)) {
    next();
    skipEOLs();
    Node memberType=parseTypeExpressionList(next());
    if (memberType != null) {
      typeNameNode.addChildToFront(memberType);
      skipEOLs();
      if (!match(JsDocToken.GT)) {
        return reportTypeSyntaxWarning("String_Node_Str");
      }
      next();
    }
  }
  return typeNameNode;
}

Fixed version (ground truth):
/** 
 * TypeName := NameExpression | NameExpression TypeApplication TypeApplication := '.<' TypeExpressionList '>'
 */
private Node parseTypeName(JsDocToken token){
  if (token != JsDocToken.STRING) {
    return reportGenericTypeSyntaxWarning();
  }
  String typeName=stream.getString();
  int lineno=stream.getLineno();
  int charno=stream.getCharno();
  while (match(JsDocToken.EOL) && typeName.charAt(typeName.length() - 1) == '.') {
    skipEOLs();
    if (match(JsDocToken.STRING)) {
      next();
      typeName+=stream.getString();
    }
  }
  Node typeNameNode=newStringNode(typeName,lineno,charno);
  if (match(JsDocToken.LT)) {
    next();
    skipEOLs();
    Node memberType=parseTypeExpressionList(next());
    if (memberType != null) {
      typeNameNode.addChildToFront(memberType);
      skipEOLs();
      if (!match(JsDocToken.GT)) {
        return reportTypeSyntaxWarning("String_Node_Str");
      }
      next();
    }
  }
  return typeNameNode;
}
Program: 27960
Project: 27960
Buggy source:
/** 
 * When computing infima, we may get a situation like inf(Type1, Type2) where both types are unresolved, so they're technically subtypes of one another. If this happens, filter them down to NoResolvedType.
 */
static JSType filterNoResolvedType(JSType type){
  if (type.isNoResolvedType()) {
    return type.getNativeType(JSTypeNative.NO_RESOLVED_TYPE);
  }
 else   if (type.isUnionType()) {
    UnionType unionType=type.toMaybeUnionType();
    boolean needsFiltering=false;
    for (    JSType alt : unionType.getAlternates()) {
      if (alt.isNoResolvedType()) {
        needsFiltering=true;
        break;
      }
    }
    if (needsFiltering) {
      UnionTypeBuilder builder=new UnionTypeBuilder(type.registry);
      for (      JSType alt : unionType.getAlternates()) {
        if (!alt.isNoResolvedType()) {
          builder.addAlternate(alt);
        }
      }
      return builder.build();
    }
  }
  return type;
}

Fixed version (ground truth):
/** 
 * When computing infima, we may get a situation like inf(Type1, Type2) where both types are unresolved, so they're technically subtypes of one another. If this happens, filter them down to NoResolvedType.
 */
static JSType filterNoResolvedType(JSType type){
  if (type.isNoResolvedType()) {
    return type.getNativeType(JSTypeNative.NO_RESOLVED_TYPE);
  }
 else   if (type.isUnionType()) {
    UnionType unionType=type.toMaybeUnionType();
    boolean needsFiltering=false;
    for (    JSType alt : unionType.getAlternates()) {
      if (alt.isNoResolvedType()) {
        needsFiltering=true;
        break;
      }
    }
    if (needsFiltering) {
      UnionTypeBuilder builder=new UnionTypeBuilder(type.registry);
      builder.addAlternate(type.getNativeType(JSTypeNative.NO_RESOLVED_TYPE));
      for (      JSType alt : unionType.getAlternates()) {
        if (!alt.isNoResolvedType()) {
          builder.addAlternate(alt);
        }
      }
      return builder.build();
    }
  }
  return type;
}
Program: 27962
Project: 27962
Buggy source:
JSType meet(JSType that){
  UnionTypeBuilder builder=new UnionTypeBuilder(registry);
  for (  JSType alternate : alternates) {
    if (alternate.isSubtype(that)) {
      builder.addAlternate(alternate);
    }
  }
  if (that.isUnionType()) {
    for (    JSType otherAlternate : that.toMaybeUnionType().alternates) {
      if (otherAlternate.isSubtype(this)) {
        builder.addAlternate(otherAlternate);
      }
    }
  }
 else   if (that.isSubtype(this)) {
    builder.addAlternate(that);
  }
  JSType result=builder.build();
  if (!result.isNoType()) {
    return result;
  }
 else   if (this.isObject() && that.isObject()) {
    return getNativeType(JSTypeNative.NO_OBJECT_TYPE);
  }
 else {
    return getNativeType(JSTypeNative.NO_TYPE);
  }
}

Fixed version (ground truth):
JSType meet(JSType that){
  UnionTypeBuilder builder=new UnionTypeBuilder(registry);
  for (  JSType alternate : alternates) {
    if (alternate.isSubtype(that)) {
      builder.addAlternate(alternate);
    }
  }
  if (that.isUnionType()) {
    for (    JSType otherAlternate : that.toMaybeUnionType().alternates) {
      if (otherAlternate.isSubtype(this)) {
        builder.addAlternate(otherAlternate);
      }
    }
  }
 else   if (that.isSubtype(this)) {
    builder.addAlternate(that);
  }
  JSType result=builder.build();
  if (!result.isNoType()) {
    return result;
  }
 else   if (this.isObject() && (that.isObject() && !that.isNoType())) {
    return getNativeType(JSTypeNative.NO_OBJECT_TYPE);
  }
 else {
    return getNativeType(JSTypeNative.NO_TYPE);
  }
}
Program: 27963
Project: 27963
Buggy source:
/** 
 * Returns a more restricted union type than   {@code this} one, in which allsubtypes of  {@code type} have been removed.<p>Examples: <ul> <li> {@code (number,string)} restricted by {@code number} is{@code string}</li> <li>  {@code (null, EvalError, URIError)} restricted by{@code Error} is {@code null}</li> </ul>
 * @param type the supertype of the types to remove from this union type
 */
public JSType getRestrictedUnion(JSType type){
  UnionTypeBuilder restricted=new UnionTypeBuilder(registry);
  for (  JSType t : alternates) {
    if (t.isUnknownType() || !t.isSubtype(type)) {
      restricted.addAlternate(t);
    }
  }
  return restricted.build();
}

Fixed version (ground truth):
/** 
 * Returns a more restricted union type than   {@code this} one, in which allsubtypes of  {@code type} have been removed.<p>Examples: <ul> <li> {@code (number,string)} restricted by {@code number} is{@code string}</li> <li>  {@code (null, EvalError, URIError)} restricted by{@code Error} is {@code null}</li> </ul>
 * @param type the supertype of the types to remove from this union type
 */
public JSType getRestrictedUnion(JSType type){
  UnionTypeBuilder restricted=new UnionTypeBuilder(registry);
  for (  JSType t : alternates) {
    if (t.isUnknownType() || t.isNoResolvedType() || !t.isSubtype(type)) {
      restricted.addAlternate(t);
    }
  }
  return restricted.build();
}
Program: 27964
Project: 27964
Buggy source:
public void testNamedSubtypeChain() throws Exception {
  List<JSType> typeChain=Lists.newArrayList(registry.getNativeType(JSTypeNative.ALL_TYPE),registry.getNativeType(JSTypeNative.OBJECT_PROTOTYPE),registry.getNativeType(JSTypeNative.OBJECT_TYPE),googBar.getPrototype(),googBar.getInstanceType(),googSubBar.getPrototype(),googSubBar.getInstanceType(),googSubSubBar.getPrototype(),googSubSubBar.getInstanceType(),registry.getNativeType(JSTypeNative.NO_OBJECT_TYPE),registry.getNativeType(JSTypeNative.NO_RESOLVED_TYPE),registry.getNativeType(JSTypeNative.NO_TYPE));
  verifySubtypeChain(typeChain);
}

Fixed version (ground truth):
public void testNamedSubtypeChain() throws Exception {
  List<JSType> typeChain=Lists.newArrayList(registry.getNativeType(JSTypeNative.ALL_TYPE),registry.getNativeType(JSTypeNative.OBJECT_PROTOTYPE),registry.getNativeType(JSTypeNative.OBJECT_TYPE),googBar.getPrototype(),googBar.getInstanceType(),googSubBar.getPrototype(),googSubBar.getInstanceType(),googSubSubBar.getPrototype(),googSubSubBar.getInstanceType(),registry.getNativeType(JSTypeNative.NO_OBJECT_TYPE),registry.getNativeType(JSTypeNative.NO_TYPE));
  verifySubtypeChain(typeChain);
}
Program: 27967
Project: 27967
Buggy source:
/** 
 * Resolve the referenced type within the enclosing scope.
 */
@Override JSType resolveInternal(ErrorReporter t,StaticScope<JSType> enclosing){
  boolean resolved=resolveViaRegistry(t,enclosing);
  if (detectImplicitPrototypeCycle()) {
    handleTypeCycle(t);
  }
  if (resolved) {
    super.resolveInternal(t,enclosing);
    finishPropertyContinuations();
    return registry.isLastGeneration() ? getReferencedType() : this;
  }
  resolveViaProperties(t,enclosing);
  if (detectImplicitPrototypeCycle()) {
    handleTypeCycle(t);
  }
  super.resolveInternal(t,enclosing);
  if (isResolved()) {
    finishPropertyContinuations();
  }
  return registry.isLastGeneration() ? getReferencedType() : this;
}

Fixed version (ground truth):
/** 
 * Resolve the referenced type within the enclosing scope.
 */
@Override JSType resolveInternal(ErrorReporter t,StaticScope<JSType> enclosing){
  boolean resolved=resolveViaRegistry(t,enclosing);
  if (detectInheritanceCycle()) {
    handleTypeCycle(t);
  }
  if (resolved) {
    super.resolveInternal(t,enclosing);
    finishPropertyContinuations();
    return registry.isLastGeneration() ? getReferencedType() : this;
  }
  resolveViaProperties(t,enclosing);
  if (detectInheritanceCycle()) {
    handleTypeCycle(t);
  }
  super.resolveInternal(t,enclosing);
  if (isResolved()) {
    finishPropertyContinuations();
  }
  return registry.isLastGeneration() ? getReferencedType() : this;
}
Program: 27968
Project: 27968
Buggy source:
/** 
 * Detects a cycle in the implicit prototype chain. This method accesses the   {@link #getImplicitPrototype()} method and must therefore beinvoked only after the object is sufficiently initialized to respond to calls to this method.<p> The method is not thread safe.<p>
 * @return True iff an implicit prototype cycle was detected.
 */
final boolean detectImplicitPrototypeCycle(){
  this.visited=true;
  ObjectType p=getImplicitPrototype();
  while (p != null) {
    if (p.visited) {
      return true;
    }
 else {
      p.visited=true;
    }
    p=p.getImplicitPrototype();
  }
  p=this;
  do {
    p.visited=false;
    p=p.getImplicitPrototype();
  }
 while (p != null);
  return false;
}

Fixed version (ground truth):
/** 
 * Detects a cycle in the implicit prototype chain. This method accesses the   {@link #getImplicitPrototype()} method and must therefore beinvoked only after the object is sufficiently initialized to respond to calls to this method.<p>
 * @return True iff an implicit prototype cycle was detected.
 */
final boolean detectImplicitPrototypeCycle(){
  this.visited=true;
  ObjectType p=getImplicitPrototype();
  while (p != null) {
    if (p.visited) {
      return true;
    }
 else {
      p.visited=true;
    }
    p=p.getImplicitPrototype();
  }
  p=this;
  do {
    p.visited=false;
    p=p.getImplicitPrototype();
  }
 while (p != null);
  return false;
}
Program: 27969
Project: 27969
Buggy source:
/** 
 * Remove useless switches and cases.
 */
private Node tryOptimizeSwitch(Node n){
  Preconditions.checkState(n.isSwitch());
  Node defaultCase=tryOptimizeDefaultCase(n);
  if (defaultCase == null) {
    Node next=null;
    Node prev=null;
    for (Node c=n.getFirstChild().getNext(); c != null; c=next) {
      next=c.getNext();
      if (!mayHaveSideEffects(c.getFirstChild()) && isUselessCase(c,prev)) {
        removeCase(n,c);
      }
 else {
        prev=c;
      }
    }
  }
  if (n.hasOneChild()) {
    Node condition=n.removeFirstChild();
    Node parent=n.getParent();
    Node replacement=IR.exprResult(condition).srcref(n);
    parent.replaceChild(n,replacement);
    reportCodeChange();
    return replacement;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Remove useless switches and cases.
 */
private Node tryOptimizeSwitch(Node n){
  Preconditions.checkState(n.isSwitch());
  Node defaultCase=tryOptimizeDefaultCase(n);
  if (defaultCase == null) {
    Node cond=n.getFirstChild(), prev=null, next=null, cur;
    for (cur=cond.getNext(); cur != null; cur=next) {
      next=cur.getNext();
      if (!mayHaveSideEffects(cur.getFirstChild()) && isUselessCase(cur,prev)) {
        removeCase(n,cur);
      }
 else {
        prev=cur;
      }
    }
    if (NodeUtil.isLiteralValue(cond,false)) {
      Node caseLabel;
      TernaryValue caseMatches=TernaryValue.TRUE;
      for (cur=cond.getNext(); cur != null; cur=next) {
        next=cur.getNext();
        caseLabel=cur.getFirstChild();
        caseMatches=PeepholeFoldConstants.evaluateComparison(Token.SHEQ,cond,caseLabel);
        if (caseMatches == TernaryValue.TRUE) {
          break;
        }
 else         if (caseMatches == TernaryValue.UNKNOWN) {
          break;
        }
 else {
          n.removeChild(cur);
          reportCodeChange();
        }
      }
      if (caseMatches != TernaryValue.UNKNOWN) {
        Node block, lastStm;
        while (cur != null) {
          block=cur.getLastChild();
          lastStm=block.getLastChild();
          cur=cur.getNext();
          if (lastStm.isBreak()) {
            block.removeChild(lastStm);
            reportCodeChange();
            break;
          }
        }
        for (; cur != null; cur=next) {
          next=cur.getNext();
          n.removeChild(cur);
          reportCodeChange();
        }
        cur=cond.getNext();
        if (cur != null && cur.getNext() == null) {
          block=cur.getLastChild();
          if (!(NodeUtil.containsType(block,Token.BREAK,NodeUtil.MATCH_NOT_FUNCTION))) {
            cur.removeChild(block);
            n.getParent().replaceChild(n,block);
            reportCodeChange();
            return block;
          }
        }
      }
    }
  }
  if (n.hasOneChild()) {
    Node condition=n.removeFirstChild();
    Node replacement=IR.exprResult(condition).srcref(n);
    n.getParent().replaceChild(n,replacement);
    reportCodeChange();
    return replacement;
  }
  return null;
}
Program: 27973
Project: 27973
Buggy source:
/** 
 * Expect that the first type can be assigned to a symbol of the second type.
 * @param t The node traversal.
 * @param n The node to issue warnings on.
 * @param rightType The type on the RHS of the assign.
 * @param leftType The type of the symbol on the LHS of the assign.
 * @param msg An extra message for the mismatch warning, if necessary.
 * @return True if the types matched, false otherwise.
 */
boolean expectCanAssignTo(NodeTraversal t,Node n,JSType rightType,JSType leftType,String msg){
  if (!rightType.canAssignTo(leftType)) {
    if (bothIntrinsics(rightType,leftType)) {
      registerMismatch(rightType,leftType,null);
    }
 else {
      mismatch(t,n,msg,rightType,leftType);
    }
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Expect that the first type can be assigned to a symbol of the second type.
 * @param t The node traversal.
 * @param n The node to issue warnings on.
 * @param rightType The type on the RHS of the assign.
 * @param leftType The type of the symbol on the LHS of the assign.
 * @param msg An extra message for the mismatch warning, if necessary.
 * @return True if the types matched, false otherwise.
 */
boolean expectCanAssignTo(NodeTraversal t,Node n,JSType rightType,JSType leftType,String msg){
  if (!rightType.canAssignTo(leftType)) {
    mismatch(t,n,msg,rightType,leftType);
    return false;
  }
  return true;
}
Program: 27974
Project: 27974
Buggy source:
/** 
 * Expect that the first type can be assigned to a symbol of the second type.
 * @param t The node traversal.
 * @param n The node to issue warnings on.
 * @param rightType The type on the RHS of the assign.
 * @param leftType The type of the symbol on the LHS of the assign.
 * @param owner The owner of the property being assigned to.
 * @param propName The name of the property being assigned to.
 * @return True if the types matched, false otherwise.
 */
boolean expectCanAssignToPropertyOf(NodeTraversal t,Node n,JSType rightType,JSType leftType,Node owner,String propName){
  if (!leftType.isNoType() && !rightType.canAssignTo(leftType)) {
    if (bothIntrinsics(rightType,leftType)) {
      registerMismatch(rightType,leftType,null);
    }
 else {
      JSType ownerType=getJSType(owner);
      if (ownerType.isFunctionPrototypeType()) {
        FunctionType ownerFn=ownerType.toObjectType().getOwnerFunction();
        if (ownerFn.isInterface() && rightType.isFunctionType() && leftType.isFunctionType()) {
          return true;
        }
      }
      mismatch(t,n,"String_Node_Str" + propName + "String_Node_Str"+ getReadableJSTypeName(owner,true),rightType,leftType);
    }
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Expect that the first type can be assigned to a symbol of the second type.
 * @param t The node traversal.
 * @param n The node to issue warnings on.
 * @param rightType The type on the RHS of the assign.
 * @param leftType The type of the symbol on the LHS of the assign.
 * @param owner The owner of the property being assigned to.
 * @param propName The name of the property being assigned to.
 * @return True if the types matched, false otherwise.
 */
boolean expectCanAssignToPropertyOf(NodeTraversal t,Node n,JSType rightType,JSType leftType,Node owner,String propName){
  if (!leftType.isNoType() && !rightType.canAssignTo(leftType)) {
    JSType ownerType=getJSType(owner);
    if (ownerType.isFunctionPrototypeType()) {
      FunctionType ownerFn=ownerType.toObjectType().getOwnerFunction();
      if (ownerFn.isInterface() && rightType.isFunctionType() && leftType.isFunctionType()) {
        return true;
      }
    }
    mismatch(t,n,"String_Node_Str" + propName + "String_Node_Str"+ getReadableJSTypeName(owner,true),rightType,leftType);
    return false;
  }
  return true;
}
Program: 27975
Project: 27975
Buggy source:
/** 
 * A function is a subtype of another if their call methods are related via subtyping and   {@code this} is a subtype of {@code that} with regard tothe prototype chain.
 */
@Override public boolean isSubtype(JSType that){
  if (JSType.isSubtypeHelper(this,that)) {
    return true;
  }
  if (that.isFunctionType()) {
    FunctionType other=that.toMaybeFunctionType();
    if (other.isInterface()) {
      return true;
    }
    if (isInterface()) {
      return false;
    }
    boolean treatThisTypesAsCovariant=isConstructor() || other.isConstructor() || (other.typeOfThis.toObjectType() != null && other.typeOfThis.toObjectType().getConstructor() != null && other.typeOfThis.toObjectType().getConstructor().isInterface())|| other.typeOfThis.isSubtype(this.typeOfThis)|| this.typeOfThis.isSubtype(other.typeOfThis);
    return treatThisTypesAsCovariant && this.call.isSubtype(other.call);
  }
  return getNativeType(JSTypeNative.FUNCTION_PROTOTYPE).isSubtype(that);
}

Fixed version (ground truth):
/** 
 * A function is a subtype of another if their call methods are related via subtyping and   {@code this} is a subtype of {@code that} with regard tothe prototype chain.
 */
@Override public boolean isSubtype(JSType that){
  if (JSType.isSubtypeHelper(this,that)) {
    return true;
  }
  if (that.isFunctionType()) {
    FunctionType other=that.toMaybeFunctionType();
    if (other.isInterface()) {
      return true;
    }
    if (isInterface()) {
      return false;
    }
    boolean treatThisTypesAsCovariant=(other.typeOfThis.toObjectType() != null && other.typeOfThis.toObjectType().getConstructor() != null && other.typeOfThis.toObjectType().getConstructor().isInterface()) || other.typeOfThis.isSubtype(this.typeOfThis) || this.typeOfThis.isSubtype(other.typeOfThis);
    return treatThisTypesAsCovariant && this.call.isSubtype(other.call);
  }
  return getNativeType(JSTypeNative.FUNCTION_PROTOTYPE).isSubtype(that);
}
Program: 27976
Project: 27976
Buggy source:
public void testTypeRedefinition() throws Exception {
  testTypes("String_Node_Str" + "String_Node_Str","String_Node_Str" + "String_Node_Str");
}

Fixed version (ground truth):
public void testTypeRedefinition() throws Exception {
  testClosureTypesMultipleWarnings("String_Node_Str" + "String_Node_Str",Lists.newArrayList("String_Node_Str" + "String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"));
}
Program: 27977
Project: 27977
Buggy source:
private void testClosureTypesMultipleWarnings(String js,List<String> descriptions) throws Exception {
  Node n=compiler.parseTestCode(js);
  Node externs=new Node(Token.BLOCK);
  Node externAndJsRoot=new Node(Token.BLOCK,externs,n);
  externAndJsRoot.setIsSyntheticBlock(true);
  assertEquals("String_Node_Str" + Joiner.on("String_Node_Str").join(compiler.getErrors()),0,compiler.getErrorCount());
  new ProcessClosurePrimitives(compiler,null,CheckLevel.ERROR).process(null,n);
  CodingConvention convention=compiler.getCodingConvention();
  new TypeCheck(compiler,new ClosureReverseAbstractInterpreter(convention,registry).append(new SemanticReverseAbstractInterpreter(convention,registry)).getFirst(),registry).processForTesting(null,n);
  assertEquals(0,compiler.getErrorCount());
  if (descriptions == null) {
    assertEquals("String_Node_Str" + Joiner.on("String_Node_Str").join(compiler.getWarnings()),0,compiler.getWarningCount());
  }
 else {
    assertEquals(descriptions.size(),compiler.getWarningCount());
    for (int i=0; i < descriptions.size(); i++) {
      assertEquals(descriptions.get(i),compiler.getWarnings()[i].description);
    }
  }
}

Fixed version (ground truth):
private void testClosureTypesMultipleWarnings(String js,List<String> descriptions) throws Exception {
  Node n=compiler.parseTestCode(js);
  Node externs=new Node(Token.BLOCK);
  Node externAndJsRoot=new Node(Token.BLOCK,externs,n);
  externAndJsRoot.setIsSyntheticBlock(true);
  assertEquals("String_Node_Str" + Joiner.on("String_Node_Str").join(compiler.getErrors()),0,compiler.getErrorCount());
  new ProcessClosurePrimitives(compiler,null,CheckLevel.ERROR).process(null,n);
  CodingConvention convention=compiler.getCodingConvention();
  new TypeCheck(compiler,new ClosureReverseAbstractInterpreter(convention,registry).append(new SemanticReverseAbstractInterpreter(convention,registry)).getFirst(),registry).processForTesting(null,n);
  assertEquals(0,compiler.getErrorCount());
  if (descriptions == null) {
    assertEquals("String_Node_Str" + Joiner.on("String_Node_Str").join(compiler.getWarnings()),0,compiler.getWarningCount());
  }
 else {
    assertEquals(descriptions.size(),compiler.getWarningCount());
    Set<String> actualWarningDescriptions=Sets.newHashSet();
    for (int i=0; i < descriptions.size(); i++) {
      actualWarningDescriptions.add(compiler.getWarnings()[i].description);
    }
    assertEquals(Sets.newHashSet(descriptions),actualWarningDescriptions);
  }
}
Program: 27978
Project: 27978
Buggy source:
public void testTypeRedefinition() throws Exception {
  testTypes("String_Node_Str" + "String_Node_Str","String_Node_Str" + "String_Node_Str");
}

Fixed version (ground truth):
public void testTypeRedefinition() throws Exception {
  testClosureTypesMultipleWarnings("String_Node_Str" + "String_Node_Str",Lists.newArrayList("String_Node_Str" + "String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"));
}
Program: 27979
Project: 27979
Buggy source:
private void testClosureTypesMultipleWarnings(String js,List<String> descriptions) throws Exception {
  Node n=compiler.parseTestCode(js);
  Node externs=new Node(Token.BLOCK);
  Node externAndJsRoot=new Node(Token.BLOCK,externs,n);
  externAndJsRoot.setIsSyntheticBlock(true);
  assertEquals("String_Node_Str" + Joiner.on("String_Node_Str").join(compiler.getErrors()),0,compiler.getErrorCount());
  new ProcessClosurePrimitives(compiler,null,CheckLevel.ERROR).process(null,n);
  CodingConvention convention=compiler.getCodingConvention();
  new TypeCheck(compiler,new ClosureReverseAbstractInterpreter(convention,registry).append(new SemanticReverseAbstractInterpreter(convention,registry)).getFirst(),registry).processForTesting(null,n);
  assertEquals("String_Node_Str" + Joiner.on("String_Node_Str").join(compiler.getErrors()),0,compiler.getErrorCount());
  if (descriptions == null) {
    assertEquals("String_Node_Str" + Joiner.on("String_Node_Str").join(compiler.getWarnings()),0,compiler.getWarningCount());
  }
 else {
    assertEquals("String_Node_Str" + Joiner.on("String_Node_Str").join(compiler.getWarnings()),descriptions.size(),compiler.getWarningCount());
    for (int i=0; i < descriptions.size(); i++) {
      assertEquals(descriptions.get(i),compiler.getWarnings()[i].description);
    }
  }
}

Fixed version (ground truth):
private void testClosureTypesMultipleWarnings(String js,List<String> descriptions) throws Exception {
  Node n=compiler.parseTestCode(js);
  Node externs=new Node(Token.BLOCK);
  Node externAndJsRoot=new Node(Token.BLOCK,externs,n);
  externAndJsRoot.setIsSyntheticBlock(true);
  assertEquals("String_Node_Str" + Joiner.on("String_Node_Str").join(compiler.getErrors()),0,compiler.getErrorCount());
  new ProcessClosurePrimitives(compiler,null,CheckLevel.ERROR).process(null,n);
  CodingConvention convention=compiler.getCodingConvention();
  new TypeCheck(compiler,new ClosureReverseAbstractInterpreter(convention,registry).append(new SemanticReverseAbstractInterpreter(convention,registry)).getFirst(),registry).processForTesting(null,n);
  assertEquals("String_Node_Str" + Joiner.on("String_Node_Str").join(compiler.getErrors()),0,compiler.getErrorCount());
  if (descriptions == null) {
    assertEquals("String_Node_Str" + Joiner.on("String_Node_Str").join(compiler.getWarnings()),0,compiler.getWarningCount());
  }
 else {
    assertEquals("String_Node_Str" + Joiner.on("String_Node_Str").join(compiler.getWarnings()),descriptions.size(),compiler.getWarningCount());
    Set<String> actualWarningDescriptions=Sets.newHashSet();
    for (int i=0; i < descriptions.size(); i++) {
      actualWarningDescriptions.add(compiler.getWarnings()[i].description);
    }
    assertEquals(Sets.newHashSet(descriptions),actualWarningDescriptions);
  }
}
Program: 27980
Project: 27980
Buggy source:
/** 
 * @return True if our parameter spec is equal to {@code that}'s parameter spec.
 */
boolean hasEqualParameters(ArrowType that,EquivalenceMethod eqMethod){
  Node thisParam=parameters.getFirstChild();
  Node otherParam=that.parameters.getFirstChild();
  while (thisParam != null && otherParam != null) {
    JSType thisParamType=thisParam.getJSType();
    JSType otherParamType=otherParam.getJSType();
    if (thisParamType != null) {
      if (otherParamType != null && !thisParamType.checkEquivalenceHelper(otherParamType,eqMethod)) {
        return false;
      }
    }
 else {
      if (otherParamType != null) {
        return false;
      }
    }
    thisParam=thisParam.getNext();
    otherParam=otherParam.getNext();
  }
  return thisParam == otherParam;
}

Fixed version (ground truth):
/** 
 * @return True if our parameter spec is equal to {@code that}'s parameter spec.
 */
boolean hasEqualParameters(ArrowType that,EquivalenceMethod eqMethod){
  Node thisParam=parameters.getFirstChild();
  Node otherParam=that.parameters.getFirstChild();
  while (thisParam != null && otherParam != null) {
    JSType thisParamType=thisParam.getJSType();
    JSType otherParamType=otherParam.getJSType();
    if (thisParamType != null) {
      if (otherParamType != null && !thisParamType.checkEquivalenceHelper(otherParamType,eqMethod)) {
        return false;
      }
    }
 else {
      if (otherParamType != null) {
        return false;
      }
    }
    if (thisParam.isOptionalArg() != otherParam.isOptionalArg()) {
      return false;
    }
    if (thisParam.isVarArgs() != otherParam.isVarArgs()) {
      return false;
    }
    thisParam=thisParam.getNext();
    otherParam=otherParam.getNext();
  }
  return thisParam == otherParam;
}
Program: 27982
Project: 27982
Buggy source:
public void testGetElem(){
  testSame("String_Node_Str" + "String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",null);
  assertType("String_Node_Str",getType("String_Node_Str"));
  assertType("String_Node_Str",getType("String_Node_Str"));
  assertType("String_Node_Str",getType("String_Node_Str"));
  testSame("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  assertType("String_Node_Str",getType("String_Node_Str"));
}

Fixed version (ground truth):
public void testGetElem(){
  testSame("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",null);
  assertType("String_Node_Str",getType("String_Node_Str"));
  assertType("String_Node_Str",getType("String_Node_Str"));
  assertType("String_Node_Str",getType("String_Node_Str"));
  testSame("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  assertType("String_Node_Str",getType("String_Node_Str"));
}
Program: 27983
Project: 27983
Buggy source:
public void testParseOptionalModifier() throws Exception {
  JSDocInfo info=parse("String_Node_Str");
  assertTypeEquals(registry.createFunctionType(UNKNOWN_TYPE,createUnionType(VOID_TYPE,NUMBER_TYPE)),info.getType());
}

Fixed version (ground truth):
public void testParseOptionalModifier() throws Exception {
  JSDocInfo info=parse("String_Node_Str");
  assertTypeEquals(registry.createFunctionType(UNKNOWN_TYPE,registry.createOptionalParameters(NUMBER_TYPE)),info.getType());
}
Program: 27984
Project: 27984
Buggy source:
/** 
 * Computes the subset of   {@code this} and {@code that} types if equalityis observed. If a value  {@code v1} of type {@code null} is equal to a value{@code v2} of type {@code (undefined,number)}, we can infer that the type of   {@code v1} is {@code null} and the type of {@code v2} is{@code undefined}.
 * @return a pair containing the restricted type of {@code this} as the firstcomponent and the restricted type of  {@code that} as the secondelement. The returned pair is never  {@code null} even though itscomponents may be  {@code null}
 */
public TypePair getTypesUnderEquality(JSType that){
  if (that.isUnionType()) {
    TypePair p=that.toMaybeUnionType().getTypesUnderEquality(this);
    return new TypePair(p.typeB,p.typeA);
  }
switch (this.testForEquality(that)) {
case FALSE:
    return new TypePair(null,null);
case TRUE:
case UNKNOWN:
  return new TypePair(this,that);
}
throw new IllegalStateException();
}

Fixed version (ground truth):
/** 
 * Computes the subset of   {@code this} and {@code that} types if equalityis observed. If a value  {@code v1} of type {@code null} is equal to a value{@code v2} of type {@code (undefined,number)}, we can infer that the type of   {@code v1} is {@code null} and the type of {@code v2} is{@code undefined}.
 * @return a pair containing the restricted type of {@code this} as the firstcomponent and the restricted type of  {@code that} as the secondelement. The returned pair is never  {@code null} even though itscomponents may be  {@code null}
 */
public TypePair getTypesUnderEquality(JSType that){
  if (that.isUnionType()) {
    TypePair p=that.toMaybeUnionType().getTypesUnderEquality(this);
    return new TypePair(p.typeB,p.typeA);
  }
switch (testForEquality(that)) {
case FALSE:
    return new TypePair(null,null);
case TRUE:
case UNKNOWN:
  return new TypePair(this,that);
}
throw new IllegalStateException();
}
Program: 27985
Project: 27985
Buggy source:
/** 
 * A hash code function for diagnosing complicated issues around type-identity.
 */
public String toDebugHashCodeString(){
  return "String_Node_Str" + this.hashCode() + "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * A hash code function for diagnosing complicated issues around type-identity.
 */
public String toDebugHashCodeString(){
  return "String_Node_Str" + hashCode() + "String_Node_Str";
}
Program: 27986
Project: 27986
Buggy source:
/** 
 * Tests whether   {@code this} and {@code that} are meaningfullycomparable. By meaningfully, we mean compatible types that do not lead to step 22 of the definition of the Abstract Equality Comparison Algorithm (11.9.3, page 55&ndash;56) of the ECMA-262 specification.<p>
 */
public final boolean canTestForEqualityWith(JSType that){
  return this.testForEquality(that).equals(UNKNOWN);
}

Fixed version (ground truth):
/** 
 * Tests whether   {@code this} and {@code that} are meaningfullycomparable. By meaningfully, we mean compatible types that do not lead to step 22 of the definition of the Abstract Equality Comparison Algorithm (11.9.3, page 55&ndash;56) of the ECMA-262 specification.<p>
 */
public final boolean canTestForEqualityWith(JSType that){
  return testForEquality(that).equals(UNKNOWN);
}
Program: 27987
Project: 27987
Buggy source:
/** 
 * Tests whether the type is a number (value or Object).
 * @return {@code this &lt;: (Number, number)}
 */
public final boolean isNumber(){
  return this.isSubtype(getNativeType(JSTypeNative.NUMBER_VALUE_OR_OBJECT_TYPE));
}

Fixed version (ground truth):
/** 
 * Tests whether the type is a number (value or Object).
 * @return {@code this &lt;: (Number, number)}
 */
public final boolean isNumber(){
  return isSubtype(getNativeType(JSTypeNative.NUMBER_VALUE_OR_OBJECT_TYPE));
}
Program: 27988
Project: 27988
Buggy source:
/** 
 * Returns true iff   {@code this} can be a {@code struct}. UnionType overrides the method, assume   {@code this} is not a union here.
 */
public boolean isStruct(){
  if (isObject()) {
    ObjectType objType=toObjectType();
    FunctionType ctor=objType.getConstructor();
    if (ctor == null) {
      JSDocInfo info=objType.getJSDocInfo();
      return info != null && info.makesStructs();
    }
 else {
      return ctor.makesStructs();
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Returns true iff   {@code this} can be a {@code struct}. UnionType overrides the method, assume   {@code this} is not a union here.
 */
public boolean isStruct(){
  if (isObject()) {
    ObjectType objType=toObjectType();
    ObjectType iproto=objType.getImplicitPrototype();
    if (iproto != null && iproto.isStruct()) {
      return true;
    }
    FunctionType ctor=objType.getConstructor();
    if (ctor == null) {
      JSDocInfo info=objType.getJSDocInfo();
      return info != null && info.makesStructs();
    }
 else {
      return ctor.makesStructs();
    }
  }
  return false;
}
Program: 27989
Project: 27989
Buggy source:
/** 
 * Computes the subset of   {@code this} and {@code that} types if inequalityis observed. If a value  {@code v1} of type {@code number} is not equal to avalue  {@code v2} of type {@code (undefined,number)}, we can infer that the type of   {@code v1} is {@code number} and the type of {@code v2} is{@code number} as well.
 * @return a pair containing the restricted type of {@code this} as the firstcomponent and the restricted type of  {@code that} as the secondelement. The returned pair is never  {@code null} even though itscomponents may be  {@code null}
 */
public TypePair getTypesUnderInequality(JSType that){
  if (that.isUnionType()) {
    TypePair p=that.toMaybeUnionType().getTypesUnderInequality(this);
    return new TypePair(p.typeB,p.typeA);
  }
switch (this.testForEquality(that)) {
case TRUE:
    JSType noType=getNativeType(JSTypeNative.NO_TYPE);
  return new TypePair(noType,noType);
case FALSE:
case UNKNOWN:
return new TypePair(this,that);
}
throw new IllegalStateException();
}

Fixed version (ground truth):
/** 
 * Computes the subset of   {@code this} and {@code that} types if inequalityis observed. If a value  {@code v1} of type {@code number} is not equal to avalue  {@code v2} of type {@code (undefined,number)}, we can infer that the type of   {@code v1} is {@code number} and the type of {@code v2} is{@code number} as well.
 * @return a pair containing the restricted type of {@code this} as the firstcomponent and the restricted type of  {@code that} as the secondelement. The returned pair is never  {@code null} even though itscomponents may be  {@code null}
 */
public TypePair getTypesUnderInequality(JSType that){
  if (that.isUnionType()) {
    TypePair p=that.toMaybeUnionType().getTypesUnderInequality(this);
    return new TypePair(p.typeB,p.typeA);
  }
switch (testForEquality(that)) {
case TRUE:
    JSType noType=getNativeType(JSTypeNative.NO_TYPE);
  return new TypePair(noType,noType);
case FALSE:
case UNKNOWN:
return new TypePair(this,that);
}
throw new IllegalStateException();
}
Program: 27990
Project: 27990
Buggy source:
/** 
 * Returns true iff   {@code this} can be a {@code dict}. UnionType overrides the method, assume   {@code this} is not a union here.
 */
public boolean isDict(){
  if (isObject()) {
    FunctionType ctor=toObjectType().getConstructor();
    return ctor != null && ctor.makesDicts();
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Returns true iff   {@code this} can be a {@code dict}. UnionType overrides the method, assume   {@code this} is not a union here.
 */
public boolean isDict(){
  if (isObject()) {
    ObjectType objType=toObjectType();
    ObjectType iproto=objType.getImplicitPrototype();
    if (iproto != null && iproto.isDict()) {
      return true;
    }
    FunctionType ctor=objType.getConstructor();
    return ctor != null && ctor.makesDicts();
  }
  return false;
}
Program: 27991
Project: 27991
Buggy source:
/** 
 * Tests whether this type is nullable.
 */
public boolean isNullable(){
  return this.isSubtype(getNativeType(JSTypeNative.NULL_TYPE));
}

Fixed version (ground truth):
/** 
 * Tests whether this type is nullable.
 */
public boolean isNullable(){
  return isSubtype(getNativeType(JSTypeNative.NULL_TYPE));
}
Program: 27992
Project: 27992
Buggy source:
/** 
 * Tests whether values of   {@code this} type can be safely assignedto values of  {@code that} type.<p>The default implementation verifies that  {@code this} is a subtypeof  {@code that}.<p>
 */
public boolean canAssignTo(JSType that){
  if (this.isSubtype(that)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Tests whether values of   {@code this} type can be safely assignedto values of  {@code that} type.<p>The default implementation verifies that  {@code this} is a subtypeof  {@code that}.<p>
 */
public boolean canAssignTo(JSType that){
  return isSubtype(that);
}
Program: 27993
Project: 27993
Buggy source:
/** 
 * Computes the subset of   {@code this} and {@code that} types undershallow inequality.
 * @return A pair containing the restricted type of {@code this} as the firstcomponent and the restricted type of  {@code that} as the secondelement. The returned pair is never  {@code null} even though itscomponents may be  {@code null}
 */
public TypePair getTypesUnderShallowInequality(JSType that){
  if (that.isUnionType()) {
    TypePair p=that.toMaybeUnionType().getTypesUnderShallowInequality(this);
    return new TypePair(p.typeB,p.typeA);
  }
  if (this.isNullType() && that.isNullType() || this.isVoidType() && that.isVoidType()) {
    return new TypePair(null,null);
  }
 else {
    return new TypePair(this,that);
  }
}

Fixed version (ground truth):
/** 
 * Computes the subset of   {@code this} and {@code that} types undershallow inequality.
 * @return A pair containing the restricted type of {@code this} as the firstcomponent and the restricted type of  {@code that} as the secondelement. The returned pair is never  {@code null} even though itscomponents may be  {@code null}
 */
public TypePair getTypesUnderShallowInequality(JSType that){
  if (that.isUnionType()) {
    TypePair p=that.toMaybeUnionType().getTypesUnderShallowInequality(this);
    return new TypePair(p.typeB,p.typeA);
  }
  if (isNullType() && that.isNullType() || isVoidType() && that.isVoidType()) {
    return new TypePair(null,null);
  }
 else {
    return new TypePair(this,that);
  }
}
Program: 27995
Project: 27995
Buggy source:
/** 
 * Tests whether the type is a string (value or Object).
 * @return {@code this &lt;: (String, string)}
 */
public final boolean isString(){
  return this.isSubtype(getNativeType(JSTypeNative.STRING_VALUE_OR_OBJECT_TYPE));
}

Fixed version (ground truth):
/** 
 * Tests whether the type is a string (value or Object).
 * @return {@code this &lt;: (String, string)}
 */
public final boolean isString(){
  return isSubtype(getNativeType(JSTypeNative.STRING_VALUE_OR_OBJECT_TYPE));
}