Program: 21673
Project: 21673
Buggy source:
/** 
 * This element comes with extra information.  The name of  the element identifies it as a resource in the parentType The resource in the parent type has type information.  So if the element is "&lt;myText>hi this is my text&lt;/myText>" and myText is defined as a "string" in the parentType then this element will be turned into a string.
 * @param parentType
 * @param child
 * @return
 */
public Object handleChildResource(String childName,Object childObj) throws HandleElementException {
  Properties elementProps;
  ResourceDefinition resourceDef=getResourceDefinition(childName);
  if (resourceDef == null) {
    System.err.println("String_Node_Str" + childName + "String_Node_Str"+ getObjectName());
    return null;
  }
  elementProps=getResourceProperties(resourceDef);
  String resPrimitiveType=resourceDef.getType();
  String resourceType=resPrimitiveType;
  if (resPrimitiveType.equals("String_Node_Str")) {
    if (!(childObj instanceof Element)) {
      System.err.println("String_Node_Str");
      return null;
    }
    Element child=(Element)childObj;
    String childRefId=child.getAttributeValue("String_Node_Str");
    if (childRefId == null) {
      List children=child.getChildren();
      if (children.size() != 1) {
        System.err.println("String_Node_Str" + TypeService.elementPath(child));
        return null;
      }
      childObj=children.get(0);
      resourceType=((Element)childObj).getName();
    }
  }
  ResourceTypeHandler resHandler=typeService.getElementHandler(resourceType);
  if (resHandler == null) {
    System.err.println("String_Node_Str" + resourceType);
    return null;
  }
  if (childObj instanceof String) {
    if (resHandler instanceof PrimitiveResourceTypeHandler) {
      return ((PrimitiveResourceTypeHandler)resHandler).handleElement((String)childObj,elementProps);
    }
 else {
      throw new HandleElementException("String_Node_Str");
    }
  }
 else {
    return resHandler.handleElement((Element)childObj,elementProps);
  }
}

Fixed version (ground truth):
/** 
 * This element comes with extra information.  The name of  the element identifies it as a resource in the parentType The resource in the parent type has type information.  So if the element is "&lt;myText>hi this is my text&lt;/myText>" and myText is defined as a "string" in the parentType then this element will be turned into a string.
 * @param parentType
 * @param child
 * @return
 */
public Object handleChildResource(String childName,Object childObj) throws HandleElementException {
  Properties elementProps;
  ResourceDefinition resourceDef=getResourceDefinition(childName);
  if (resourceDef == null) {
    System.err.println("String_Node_Str" + childName + "String_Node_Str"+ getObjectName());
    return null;
  }
  elementProps=getResourceProperties(resourceDef);
  String resPrimitiveType=resourceDef.getType();
  String resourceType=resPrimitiveType;
  if (resPrimitiveType.equals("String_Node_Str")) {
    if (!(childObj instanceof Element)) {
      System.err.println("String_Node_Str");
      return null;
    }
    Element child=(Element)childObj;
    String childRefId=child.getAttributeValue("String_Node_Str");
    if (childRefId == null) {
      List children=child.getChildren();
      if (children.size() != 1) {
        return null;
      }
      childObj=children.get(0);
      resourceType=((Element)childObj).getName();
    }
  }
  ResourceTypeHandler resHandler=typeService.getElementHandler(resourceType);
  if (resHandler == null) {
    System.err.println("String_Node_Str" + resourceType);
    return null;
  }
  if (childObj instanceof String) {
    if (resHandler instanceof PrimitiveResourceTypeHandler) {
      return ((PrimitiveResourceTypeHandler)resHandler).handleElement((String)childObj,elementProps);
    }
 else {
      throw new HandleElementException("String_Node_Str");
    }
  }
 else {
    return resHandler.handleElement((Element)childObj,elementProps);
  }
}