Program: 29671
Project: 29671
Buggy source:
public Model definition(ObjectNode node,String location,ParseResult result){
  if (result == null) {
    result=new ParseResult();
  }
  if (node == null) {
    result.missing(location,"String_Node_Str");
    return null;
  }
  if (node.get("String_Node_Str") != null) {
    return refModel(node,location,result);
  }
  if (node.get("String_Node_Str") != null) {
    return allOfModel(node,location,result);
  }
  Model model=null;
  String value=null;
  String type=getString("String_Node_Str",node,false,location,result);
  Model m=new ModelImpl();
  if ("String_Node_Str".equals(type)) {
    ArrayModel am=new ArrayModel();
    ObjectNode propertyNode=getObject("String_Node_Str",node,false,location,result);
    Map<String,Property> properties=properties(propertyNode,location,result);
    am.setProperties(properties);
    ObjectNode itemsNode=getObject("String_Node_Str",node,false,location,result);
    Property items=property(itemsNode,location,result);
    if (items != null) {
      am.items(items);
    }
    Set<String> keys=getKeys(node);
    for (    String key : keys) {
      if (key.startsWith("String_Node_Str")) {
        am.setVendorExtension(key,extension(node.get(key)));
      }
    }
    model=am;
  }
 else {
    ModelImpl impl=new ModelImpl();
    impl.setType(type);
    JsonNode ap=node.get("String_Node_Str");
    if (ap != null && ap.getNodeType().equals(JsonNodeType.OBJECT)) {
      impl.setAdditionalProperties(Json.mapper().convertValue(ap,Property.class));
    }
    value=getString("String_Node_Str",node,false,location,result);
    impl.setDefaultValue(value);
    value=getString("String_Node_Str",node,false,location,result);
    impl.setFormat(value);
    value=getString("String_Node_Str",node,false,location,result);
    impl.setDiscriminator(value);
    Boolean bp=getBoolean("String_Node_Str",node,false,location,result);
    if (bp != null) {
      impl.setUniqueItems(bp);
    }
    ap=node.get("String_Node_Str");
    if (ap != null) {
      ArrayNode arrayNode=getArray("String_Node_Str",node,false,location,result);
      if (arrayNode != null) {
        for (        JsonNode n : arrayNode) {
          if (n.isValueNode()) {
            impl._enum(n.asText());
          }
 else {
            result.invalidType(location,"String_Node_Str","String_Node_Str",n);
          }
        }
      }
    }
    JsonNode xml=node.get("String_Node_Str");
    if (xml != null) {
      impl.setXml(Json.mapper().convertValue(xml,Xml.class));
    }
    ObjectNode externalDocs=getObject("String_Node_Str",node,false,location,result);
    ExternalDocs docs=externalDocs(externalDocs,location,result);
    impl.setExternalDocs(docs);
    ObjectNode properties=getObject("String_Node_Str",node,false,location,result);
    if (properties != null) {
      Set<String> propertyNames=getKeys(properties);
      for (      String propertyName : propertyNames) {
        JsonNode propertyNode=properties.get(propertyName);
        if (propertyNode.getNodeType().equals(JsonNodeType.OBJECT)) {
          ObjectNode on=(ObjectNode)propertyNode;
          Property property=property(on,location,result);
          impl.property(propertyName,property);
        }
 else {
          result.invalidType(location,"String_Node_Str","String_Node_Str",propertyNode);
        }
      }
    }
    ArrayNode required=getArray("String_Node_Str",node,false,location,result);
    if (required != null) {
      List<String> requiredProperties=new ArrayList<String>();
      for (      JsonNode n : required) {
        if (n.getNodeType().equals(JsonNodeType.STRING)) {
          requiredProperties.add(((TextNode)n).textValue());
        }
 else {
          result.invalidType(location,"String_Node_Str","String_Node_Str",n);
        }
      }
      if (requiredProperties.size() > 0) {
        impl.setRequired(requiredProperties);
      }
    }
    Set<String> keys=getKeys(node);
    for (    String key : keys) {
      if (key.startsWith("String_Node_Str")) {
        impl.setVendorExtension(key,extension(node.get(key)));
      }
 else       if (!SCHEMA_KEYS.contains(key)) {
        result.extra(location,key,node.get(key));
      }
    }
    if ("String_Node_Str".equals(Json.pretty(impl)))     return null;
    model=impl;
  }
  JsonNode exampleNode=node.get("String_Node_Str");
  if (exampleNode != null) {
    if (exampleNode.getNodeType().equals(JsonNodeType.OBJECT)) {
      ObjectNode on=getObject("String_Node_Str",node,false,location,result);
      if (on != null) {
        model.setExample(on);
      }
    }
 else {
      model.setExample(exampleNode.toString());
    }
  }
  if (model != null) {
    value=getString("String_Node_Str",node,false,location,result);
    model.setDescription(value);
    value=getString("String_Node_Str",node,false,location,result);
    model.setTitle(value);
  }
  return model;
}

Fixed version (ground truth):
public Model definition(ObjectNode node,String location,ParseResult result){
  if (result == null) {
    result=new ParseResult();
  }
  if (node == null) {
    result.missing(location,"String_Node_Str");
    return null;
  }
  if (node.get("String_Node_Str") != null) {
    return refModel(node,location,result);
  }
  if (node.get("String_Node_Str") != null) {
    return allOfModel(node,location,result);
  }
  Model model=null;
  String value=null;
  String type=getString("String_Node_Str",node,false,location,result);
  Model m=new ModelImpl();
  if ("String_Node_Str".equals(type)) {
    ArrayModel am=new ArrayModel();
    ObjectNode propertyNode=getObject("String_Node_Str",node,false,location,result);
    Map<String,Property> properties=properties(propertyNode,location,result);
    am.setProperties(properties);
    ObjectNode itemsNode=getObject("String_Node_Str",node,false,location,result);
    Property items=property(itemsNode,location,result);
    if (items != null) {
      am.items(items);
    }
    Set<String> keys=getKeys(node);
    for (    String key : keys) {
      if (key.startsWith("String_Node_Str")) {
        am.setVendorExtension(key,extension(node.get(key)));
      }
    }
    model=am;
  }
 else {
    ModelImpl impl=new ModelImpl();
    impl.setType(type);
    JsonNode ap=node.get("String_Node_Str");
    if (ap != null && ap.getNodeType().equals(JsonNodeType.OBJECT)) {
      impl.setAdditionalProperties(Json.mapper().convertValue(ap,Property.class));
    }
    value=getString("String_Node_Str",node,false,location,result);
    impl.setDefaultValue(value);
    value=getString("String_Node_Str",node,false,location,result);
    impl.setFormat(value);
    value=getString("String_Node_Str",node,false,location,result);
    impl.setDiscriminator(value);
    Boolean bp=getBoolean("String_Node_Str",node,false,location,result);
    if (bp != null) {
      impl.setUniqueItems(bp);
    }
    ap=node.get("String_Node_Str");
    if (ap != null) {
      ArrayNode arrayNode=getArray("String_Node_Str",node,false,location,result);
      if (arrayNode != null) {
        for (        JsonNode n : arrayNode) {
          if (n.isValueNode()) {
            impl._enum(n.asText());
          }
 else {
            result.invalidType(location,"String_Node_Str","String_Node_Str",n);
          }
        }
      }
    }
    JsonNode xml=node.get("String_Node_Str");
    if (xml != null) {
      impl.setXml(Json.mapper().convertValue(xml,Xml.class));
    }
    ObjectNode externalDocs=getObject("String_Node_Str",node,false,location,result);
    ExternalDocs docs=externalDocs(externalDocs,location,result);
    impl.setExternalDocs(docs);
    ObjectNode properties=getObject("String_Node_Str",node,false,location,result);
    if (properties != null) {
      Set<String> propertyNames=getKeys(properties);
      for (      String propertyName : propertyNames) {
        JsonNode propertyNode=properties.get(propertyName);
        if (propertyNode.getNodeType().equals(JsonNodeType.OBJECT)) {
          ObjectNode on=(ObjectNode)propertyNode;
          Property property=property(on,location,result);
          impl.property(propertyName,property);
        }
 else {
          result.invalidType(location,"String_Node_Str","String_Node_Str",propertyNode);
        }
      }
    }
    ArrayNode required=getArray("String_Node_Str",node,false,location,result);
    if (required != null) {
      List<String> requiredProperties=new ArrayList<String>();
      for (      JsonNode n : required) {
        if (n.getNodeType().equals(JsonNodeType.STRING)) {
          requiredProperties.add(((TextNode)n).textValue());
        }
 else {
          result.invalidType(location,"String_Node_Str","String_Node_Str",n);
        }
      }
      if (requiredProperties.size() > 0) {
        impl.setRequired(requiredProperties);
      }
    }
    Set<String> keys=getKeys(node);
    for (    String key : keys) {
      if (key.startsWith("String_Node_Str")) {
        impl.setVendorExtension(key,extension(node.get(key)));
      }
 else       if (!SCHEMA_KEYS.contains(key)) {
        result.extra(location,key,node.get(key));
      }
    }
    model=impl;
  }
  JsonNode exampleNode=node.get("String_Node_Str");
  if (exampleNode != null) {
    if (exampleNode.getNodeType().equals(JsonNodeType.OBJECT)) {
      ObjectNode on=getObject("String_Node_Str",node,false,location,result);
      if (on != null) {
        model.setExample(on);
      }
    }
 else {
      model.setExample(exampleNode.toString());
    }
  }
  if (model != null) {
    value=getString("String_Node_Str",node,false,location,result);
    model.setDescription(value);
    value=getString("String_Node_Str",node,false,location,result);
    model.setTitle(value);
  }
  return model;
}