Program: 29327
Project: 29327
Buggy source:
private SoyValue visitLegacyObjectMapLiteralOrMapLiteralNode(AbstractParentExprNode node){
  checkState(node.getKind() == ExprNode.Kind.LEGACY_OBJECT_MAP_LITERAL_NODE || node.getKind() == ExprNode.Kind.MAP_LITERAL_NODE);
  int numItems=node.numChildren() / 2;
  boolean isStringKeyed=true;
  ExprNode firstNonstringKeyNode=null;
  List<SoyValue> keys=Lists.newArrayListWithCapacity(numItems);
  List<SoyValue> values=Lists.newArrayListWithCapacity(numItems);
  for (int i=0; i < numItems; i++) {
    SoyValue key=visit(node.getChild(2 * i));
    if (isStringKeyed && !(key instanceof StringData)) {
      isStringKeyed=false;
      firstNonstringKeyNode=node.getChild(2 * i);
    }
    keys.add(key);
    values.add(visit(node.getChild(2 * i + 1)));
  }
  if (node.getKind() == ExprNode.Kind.LEGACY_OBJECT_MAP_LITERAL_NODE) {
    if (!isStringKeyed) {
      throw RenderException.create(String.format("String_Node_Str" + "String_Node_Str",firstNonstringKeyNode.toSourceString(),node.toSourceString()));
    }
    Map<String,SoyValue> map=new LinkedHashMap<>();
    for (int i=0; i < numItems; i++) {
      map.put(keys.get(i).stringValue(),values.get(i));
    }
    return DictImpl.forProviderMap(map,RuntimeMapTypeTracker.Type.LEGACY_OBJECT_MAP_OR_RECORD);
  }
 else {
    ImmutableMap.Builder<SoyValue,SoyValue> builder=ImmutableMap.builder();
    for (int i=0; i < numItems; ++i) {
      SoyValue key=keys.get(i);
      SoyValue value=values.get(i);
      if (isNullOrUndefinedBase(key)) {
        throw RenderException.create(String.format("String_Node_Str",value));
      }
      builder.put(key,value);
    }
    return SoyMapImpl.forProviderMap(builder.build());
  }
}

Fixed version (ground truth):
private SoyValue visitLegacyObjectMapLiteralOrMapLiteralNode(AbstractParentExprNode node){
  checkState(node.getKind() == ExprNode.Kind.LEGACY_OBJECT_MAP_LITERAL_NODE || node.getKind() == ExprNode.Kind.MAP_LITERAL_NODE);
  int numItems=node.numChildren() / 2;
  boolean isStringKeyed=true;
  ExprNode firstNonstringKeyNode=null;
  List<SoyValue> keys=Lists.newArrayListWithCapacity(numItems);
  List<SoyValue> values=Lists.newArrayListWithCapacity(numItems);
  for (int i=0; i < numItems; i++) {
    SoyValue key=visit(node.getChild(2 * i));
    if (isStringKeyed && !(key instanceof StringData)) {
      isStringKeyed=false;
      firstNonstringKeyNode=node.getChild(2 * i);
    }
    keys.add(key);
    values.add(visit(node.getChild(2 * i + 1)));
  }
  if (node.getKind() == ExprNode.Kind.LEGACY_OBJECT_MAP_LITERAL_NODE) {
    if (!isStringKeyed) {
      throw RenderException.create(String.format("String_Node_Str" + "String_Node_Str",firstNonstringKeyNode.toSourceString(),node.toSourceString()));
    }
    Map<String,SoyValue> map=new LinkedHashMap<>();
    for (int i=0; i < numItems; i++) {
      map.put(keys.get(i).stringValue(),values.get(i));
    }
    return DictImpl.forProviderMap(map,RuntimeMapTypeTracker.Type.LEGACY_OBJECT_MAP_OR_RECORD);
  }
 else {
    Map<SoyValue,SoyValue> map=new LinkedHashMap<>();
    for (int i=0; i < numItems; ++i) {
      SoyValue key=keys.get(i);
      SoyValue value=values.get(i);
      if (isNullOrUndefinedBase(key)) {
        throw RenderException.create(String.format("String_Node_Str",value));
      }
      map.put(key,value);
    }
    return SoyMapImpl.forProviderMap(map);
  }
}