Program: 64251
Project: 64251
Buggy source:
/** 
 * Initialisation routine called after handler creation with the element name and attributes. This configures the element with its attributes and sets it up with its parent container (if any). Nested elements are then added later as the parser encounters them.
 * @param tag Name of the element which caused this handlerto be created. Must not be <code>null</code>.
 * @param attrs Attributes of the element which caused thishandler to be created. Must not be <code>null</code>.
 * @exception org.xml.sax.SAXParseException in case of error (not thrown inthis implementation)
 */
public void onStartElement(String uri,String tag,String qname,Attributes attrs,AntXmlContext context) throws SAXParseException {
  RuntimeConfigurable parentWrapper=context.currentWrapper();
  RuntimeConfigurable wrapper=null;
  UnknownElement task=new UnknownElement(qname);
  task.setProject(context.getProject());
  task.setTaskName(qname);
  Location location=new Location(context.locator.getSystemId(),context.locator.getLineNumber(),context.locator.getColumnNumber());
  task.setLocation(location);
  task.setOwningTarget(context.currentTarget);
  context.configureId(task,attrs);
  Object parent=null;
  if (parentWrapper != null) {
    parent=parentWrapper.getProxy();
  }
  if (parent != null) {
    ((UnknownElement)parent).addChild(task);
  }
 else {
    context.currentTarget.addTask(task);
  }
  wrapper=new RuntimeConfigurable(task,task.getTaskName());
  wrapper.setAttributes2(attrs);
  if (parentWrapper != null) {
    parentWrapper.addChild(wrapper);
  }
  context.pushWrapper(wrapper);
}

Fixed version (ground truth):
/** 
 * Initialisation routine called after handler creation with the element name and attributes. This configures the element with its attributes and sets it up with its parent container (if any). Nested elements are then added later as the parser encounters them.
 * @param tag Name of the element which caused this handlerto be created. Must not be <code>null</code>.
 * @param attrs Attributes of the element which caused thishandler to be created. Must not be <code>null</code>.
 * @exception org.xml.sax.SAXParseException in case of error (not thrown inthis implementation)
 */
public void onStartElement(String uri,String tag,String qname,Attributes attrs,AntXmlContext context) throws SAXParseException {
  RuntimeConfigurable parentWrapper=context.currentWrapper();
  RuntimeConfigurable wrapper=null;
  Object parent=null;
  if (parentWrapper != null) {
    parent=parentWrapper.getProxy();
  }
  if (parent != null) {
    qname=qname.toLowerCase(Locale.US);
  }
  UnknownElement task=new UnknownElement(qname);
  task.setProject(context.getProject());
  task.setTaskName(qname);
  Location location=new Location(context.locator.getSystemId(),context.locator.getLineNumber(),context.locator.getColumnNumber());
  task.setLocation(location);
  task.setOwningTarget(context.currentTarget);
  context.configureId(task,attrs);
  if (parent != null) {
    ((UnknownElement)parent).addChild(task);
  }
 else {
    context.currentTarget.addTask(task);
  }
  wrapper=new RuntimeConfigurable(task,task.getTaskName());
  wrapper.setAttributes2(attrs);
  if (parentWrapper != null) {
    parentWrapper.addChild(wrapper);
  }
  context.pushWrapper(wrapper);
}