Program: 74426
Project: 74426
Buggy source:
/** 
 * Make modifications to the specified container, which is defined in a MoML element with the specified name.
 * @param container The object created by this element.
 * @param elementName The element name.
 * @param currentCharData The character data, which appearsonly in the doc and configure elements
 * @exception Exception if there is a problem substitutingin the new value.
 */
public void filterEndElement(NamedObj container,String elementName,StringBuffer currentCharData) throws Exception {
  if (!_currentlyProcessingAnnotation) {
    return;
  }
  if (elementName.equals("String_Node_Str")) {
    Attribute currentAttribute=(Attribute)container;
    NamedObj parentContainer=currentAttribute.getContainer();
    if (currentAttribute.getName().equals("String_Node_Str")) {
      return;
    }
    if (!(parentContainer instanceof Attribute)) {
      return;
    }
    if (_textAttribute == null) {
      NamedObj grandparentContainer=currentAttribute.getContainer().getContainer();
      _textAttribute=new TextAttribute(grandparentContainer,grandparentContainer.uniqueName("String_Node_Str"));
    }
    String charData=currentCharData.toString().trim();
    if (charData.startsWith("String_Node_Str")) {
      charData=charData.substring(5).trim();
    }
    if (charData.endsWith("String_Node_Str")) {
      charData=charData.substring(0,charData.length() - 6).trim();
    }
    if (charData.endsWith("String_Node_Str")) {
      charData=charData.substring(0,charData.length() - 7).trim();
    }
    if (charData.contains("String_Node_Str")) {
      if (charData.contains("String_Node_Str")) {
        _textAttribute.textColor.setExpression("String_Node_Str");
      }
      if (charData.contains("String_Node_Str") || charData.contains("String_Node_Str")) {
        _textAttribute.textColor.setExpression("String_Node_Str");
      }
      if (charData.contains("String_Node_Str")) {
        _textAttribute.textColor.setExpression("String_Node_Str");
      }
      if (charData.contains("String_Node_Str")) {
        _textAttribute.textColor.setExpression("String_Node_Str");
      }
    }
    if (charData.contains("String_Node_Str")) {
      if (charData.contains("String_Node_Str")) {
        _textAttribute.textSize.setExpression("String_Node_Str");
      }
      if (charData.contains("String_Node_Str")) {
        _textAttribute.textSize.setExpression("String_Node_Str");
      }
      if (charData.contains("String_Node_Str")) {
        _textAttribute.textSize.setExpression("String_Node_Str");
      }
    }
    charData=charData.replaceAll("String_Node_Str","String_Node_Str");
    _textAttribute.text.setExpression(charData);
  }
  if (container instanceof Location) {
    Attribute currentAttribute=(Attribute)container;
    if (_textAttribute == null) {
      NamedObj parentContainer=currentAttribute.getContainer();
      NamedObj grandparentContainer=currentAttribute.getContainer().getContainer();
      _textAttribute=new TextAttribute(grandparentContainer,grandparentContainer.uniqueName("String_Node_Str"));
    }
    Location location=new Location(_textAttribute,"String_Node_Str");
    Location oldLocation=(Location)container;
    oldLocation.validate();
    double[] xyLocation=oldLocation.getLocation();
    xyLocation[0]+=15.0;
    location.setLocation(xyLocation);
    location.validate();
  }
  if ((container != null) && container.getFullName().equals(_currentAnnotationFullName)) {
    NamedObj top=_textAttribute.toplevel();
    Attribute currentAttribute=(Attribute)container;
    String name=currentAttribute.getName();
    currentAttribute.setContainer(null);
    MoMLParser.setModified(true);
    _reset();
  }
}

Fixed version (ground truth):
/** 
 * Make modifications to the specified container, which is defined in a MoML element with the specified name.
 * @param container The object created by this element.
 * @param elementName The element name.
 * @param currentCharData The character data, which appearsonly in the doc and configure elements
 * @exception Exception if there is a problem substitutingin the new value.
 */
public void filterEndElement(NamedObj container,String elementName,StringBuffer currentCharData) throws Exception {
  if (!_currentlyProcessingAnnotation) {
    return;
  }
  if (elementName.equals("String_Node_Str")) {
    Attribute currentAttribute=(Attribute)container;
    NamedObj parentContainer=currentAttribute.getContainer();
    if (currentAttribute.getName().equals("String_Node_Str")) {
      return;
    }
    if (!(parentContainer instanceof Attribute)) {
      return;
    }
    if (_textAttribute == null) {
      NamedObj grandparentContainer=currentAttribute.getContainer().getContainer();
      _textAttribute=new TextAttribute(grandparentContainer,grandparentContainer.uniqueName("String_Node_Str"));
    }
    String charData=currentCharData.toString().trim();
    if (charData.startsWith("String_Node_Str")) {
      charData=charData.substring(5).trim();
    }
    if (charData.endsWith("String_Node_Str")) {
      charData=charData.substring(0,charData.length() - 6).trim();
    }
    if (charData.endsWith("String_Node_Str")) {
      charData=charData.substring(0,charData.length() - 7).trim();
    }
    if (charData.contains("String_Node_Str")) {
      if (charData.contains("String_Node_Str")) {
        _textAttribute.textColor.setExpression("String_Node_Str");
      }
      if (charData.contains("String_Node_Str") || charData.contains("String_Node_Str")) {
        _textAttribute.textColor.setExpression("String_Node_Str");
      }
      if (charData.contains("String_Node_Str")) {
        _textAttribute.textColor.setExpression("String_Node_Str");
      }
      if (charData.contains("String_Node_Str")) {
        _textAttribute.textColor.setExpression("String_Node_Str");
      }
    }
    if (charData.contains("String_Node_Str")) {
      if (charData.contains("String_Node_Str")) {
        _textAttribute.textSize.setExpression("String_Node_Str");
      }
      if (charData.contains("String_Node_Str")) {
        _textAttribute.textSize.setExpression("String_Node_Str");
      }
      if (charData.contains("String_Node_Str")) {
        _textAttribute.textSize.setExpression("String_Node_Str");
      }
    }
    charData=charData.replaceAll("String_Node_Str","String_Node_Str");
    _textAttribute.text.setExpression(charData);
  }
  if (container instanceof Location) {
    Attribute currentAttribute=(Attribute)container;
    if (_textAttribute == null) {
      NamedObj parentContainer=currentAttribute.getContainer();
      NamedObj grandparentContainer=currentAttribute.getContainer().getContainer();
      _textAttribute=new TextAttribute(grandparentContainer,grandparentContainer.uniqueName("String_Node_Str"));
    }
    Location location=new Location(_textAttribute,"String_Node_Str");
    Location oldLocation=(Location)container;
    oldLocation.validate();
    double[] xyLocation=oldLocation.getLocation();
    xyLocation[0]+=15.0;
    location.setLocation(xyLocation);
    location.validate();
  }
  if ((container != null) && container.getFullName().equals(_currentAnnotationFullName) && _textAttribute != null) {
    NamedObj top=_textAttribute.toplevel();
    Attribute currentAttribute=(Attribute)container;
    String name=currentAttribute.getName();
    currentAttribute.setContainer(null);
    MoMLParser.setModified(true);
    _reset();
  }
}