Program: 15900
Project: 15900
Buggy source:
/** 
 * Parses the specified elements.
 * @param bNativeContent whether to consider the child element all nativeIt is true if a component definition with text-as is found
 */
private void parseItems(final PageDefinition pgdef,final NodeInfo parent,Collection items,AnnotationHelper annHelper,boolean bNativeContent) throws Exception {
  LanguageDefinition parentlang=getLanguageDefinition(parent);
  if (parentlang == null)   parentlang=pgdef.getLanguageDefinition();
  final boolean bZkSwitch=isZkSwitch(parent);
  ComponentInfo pi=null;
  String textAs=null;
  StringBuffer textAsBuffer=null;
  for (NodeInfo p=parent; p != null; p=p.getParent())   if (p instanceof ComponentInfo) {
    pi=(ComponentInfo)p;
    textAs=pi.getTextAs();
    if (textAs != null && pi == parent)     textAsBuffer=new StringBuffer();
    break;
  }
  final boolean isXHTML="String_Node_Str".equals(parentlang.getName());
  final boolean isAllBlankPreserved=!"String_Node_Str".equals(Library.getProperty("String_Node_Str"));
  boolean breakLine=false;
  NativeInfo preNativeInfo=null;
  for (Iterator it=items.iterator(); it.hasNext(); ) {
    final Object o=it.next();
    if (o instanceof Element)     parseItem(pgdef,parent,(Element)o,annHelper,bNativeContent,ParsingState.FIRST);
  }
  for (Iterator it=items.iterator(); it.hasNext(); ) {
    final Object o=it.next();
    if (o instanceof Element) {
      breakLine=false;
      preNativeInfo=(NativeInfo)parseItem(pgdef,parent,(Element)o,annHelper,bNativeContent,ParsingState.SECOND);
    }
 else     if (o instanceof ProcessingInstruction) {
      breakLine=false;
      parse(pgdef,(ProcessingInstruction)o);
    }
 else     if (o instanceof Comment) {
      breakLine=false;
      if (parentlang.isNative() || isXHTML) {
        String label="String_Node_Str" + ((Item)o).getText() + "String_Node_Str";
        final ComponentInfo labelInfo=parentlang.newLabelInfo(parent,label);
        labelInfo.addProperty("String_Node_Str","String_Node_Str",null);
      }
    }
 else     if ((o instanceof Text) || (o instanceof CData)) {
      String label=((Item)o).getText(), trimLabel=!isXHTML ? label.trim() : label;
      if (breakLine && (o instanceof Text) && label.trim().isEmpty()) {
        List<NodeInfo> children=parent.getChildren();
        final String labelAttr=parentlang.getLabelAttribute();
        for (        Property prop : ((ComponentInfo)children.get(children.size() - 1)).getProperties()) {
          if (prop.getName().equals(labelAttr)) {
            prop.setRawValue(prop.getRawValue() + trimLabel);
          }
        }
        continue;
      }
      if (label.length() == 0)       continue;
      if (bZkSwitch) {
        if (trimLabel.length() == 0)         continue;
        throw new UiException(message("String_Node_Str",(Item)o));
      }
      if (trimLabel.length() == 0 && ((pi != null && !pi.isBlankPreserved() && !isNativeText(pi))))       continue;
 else       if (label.trim().isEmpty() && !isAllBlankPreserved)       continue;
      if (!isXHTML && (o instanceof Text) && label.trim().isEmpty())       breakLine=true;
      if (isNativeText(pi)) {
        String newLabel=label.trim();
        if (newLabel.startsWith("String_Node_Str") && newLabel.endsWith("String_Node_Str")) {
          label=newLabel.substring(9,newLabel.length() - 3);
        }
        new TextInfo(parent,label);
      }
 else {
        if (textAs != null) {
          if (trimLabel.length() != 0)           if (textAsBuffer != null)           textAsBuffer.append(label);
 else           if (!(parent instanceof TemplateInfo))           throw new UnsupportedOperationException(message("String_Node_Str",((Item)o).getParent()));
        }
 else {
          if (parent instanceof ShadowInfo) {
            if (trimLabel.isEmpty())             continue;
          }
          if (isTrimLabel() && !parentlang.isRawLabel()) {
            if (trimLabel.length() == 0)             continue;
            label=trimLabel;
          }
          if (isXHTML && preNativeInfo != null && label.trim().length() == 0) {
            preNativeInfo.addEpilogChild(new TextInfo(null,label));
          }
 else {
            final ComponentInfo labelInfo=parentlang.newLabelInfo(parent,label);
            if (trimLabel.length() == 0)             labelInfo.setReplaceableText(label);
          }
        }
      }
    }
 else {
      breakLine=false;
    }
  }
  if (textAsBuffer != null) {
    String trimLabel=textAsBuffer.toString();
    if (pi == null || !pi.isBlankPreserved())     trimLabel=trimLabel.trim();
    if (trimLabel.length() != 0)     pi.addProperty(textAs,trimLabel,null);
  }
}

Fixed version (ground truth):
/** 
 * Parses the specified elements.
 * @param bNativeContent whether to consider the child element all nativeIt is true if a component definition with text-as is found
 */
private void parseItems(final PageDefinition pgdef,final NodeInfo parent,Collection items,AnnotationHelper annHelper,boolean bNativeContent) throws Exception {
  LanguageDefinition parentlang=getLanguageDefinition(parent);
  if (parentlang == null)   parentlang=pgdef.getLanguageDefinition();
  final boolean bZkSwitch=isZkSwitch(parent);
  ComponentInfo pi=null;
  String textAs=null;
  StringBuffer textAsBuffer=null;
  for (NodeInfo p=parent; p != null; p=p.getParent())   if (p instanceof ComponentInfo) {
    pi=(ComponentInfo)p;
    textAs=pi.getTextAs();
    if (textAs != null && pi == parent)     textAsBuffer=new StringBuffer();
    break;
  }
  final boolean isXHTML="String_Node_Str".equals(parentlang.getName());
  final boolean isAllBlankPreserved=!"String_Node_Str".equals(Library.getProperty("String_Node_Str"));
  boolean breakLine=false;
  NativeInfo preNativeInfo=null;
  for (Iterator it=items.iterator(); it.hasNext(); ) {
    final Object o=it.next();
    if (o instanceof Element)     parseItem(pgdef,parent,(Element)o,annHelper,bNativeContent,ParsingState.FIRST);
  }
  for (Iterator it=items.iterator(); it.hasNext(); ) {
    final Object o=it.next();
    if (o instanceof Element) {
      breakLine=false;
      preNativeInfo=(NativeInfo)parseItem(pgdef,parent,(Element)o,annHelper,bNativeContent,ParsingState.SECOND);
    }
 else     if (o instanceof ProcessingInstruction) {
      breakLine=false;
      parse(pgdef,(ProcessingInstruction)o);
    }
 else     if (o instanceof Comment) {
      breakLine=false;
      if (parentlang.isNative() || isXHTML) {
        String label="String_Node_Str" + ((Item)o).getText() + "String_Node_Str";
        final ComponentInfo labelInfo=parentlang.newLabelInfo(parent,label);
        labelInfo.addProperty("String_Node_Str","String_Node_Str",null);
      }
    }
 else     if ((o instanceof Text) || (o instanceof CData)) {
      String label=((Item)o).getText(), trimLabel=!isXHTML ? label.trim() : label;
      if (breakLine && (o instanceof Text) && label.trim().isEmpty()) {
        List<NodeInfo> children=parent.getChildren();
        final String labelAttr=parentlang.getLabelAttribute();
        for (        Property prop : ((ComponentInfo)children.get(children.size() - 1)).getProperties()) {
          if (prop.getName().equals(labelAttr)) {
            prop.setRawValue(prop.getRawValue() + trimLabel);
          }
        }
        continue;
      }
      if (label.length() == 0)       continue;
      if (bZkSwitch) {
        if (trimLabel.length() == 0)         continue;
        throw new UiException(message("String_Node_Str",(Item)o));
      }
      if (trimLabel.length() == 0 && ((pi != null && !pi.isBlankPreserved() && !isNativeText(pi))))       continue;
 else       if (label.trim().isEmpty() && !isAllBlankPreserved)       continue;
      if (!isXHTML && (o instanceof Text) && label.trim().isEmpty())       breakLine=true;
      if (isNativeText(pi)) {
        String newLabel=label.trim();
        if (newLabel.startsWith("String_Node_Str") && newLabel.endsWith("String_Node_Str")) {
          label=newLabel.substring(9,newLabel.length() - 3);
        }
        if (!(parent instanceof ShadowInfo)) {
          new TextInfo(parent,label);
        }
      }
 else {
        if (textAs != null) {
          if (trimLabel.length() != 0)           if (textAsBuffer != null)           textAsBuffer.append(label);
 else           if (!(parent instanceof TemplateInfo))           throw new UnsupportedOperationException(message("String_Node_Str",((Item)o).getParent()));
        }
 else {
          if (parent instanceof ShadowInfo) {
            if (trimLabel.isEmpty())             continue;
          }
          if (isTrimLabel() && !parentlang.isRawLabel()) {
            if (trimLabel.length() == 0)             continue;
            label=trimLabel;
          }
          if (isXHTML && preNativeInfo != null && label.trim().length() == 0) {
            preNativeInfo.addEpilogChild(new TextInfo(null,label));
          }
 else {
            final ComponentInfo labelInfo=parentlang.newLabelInfo(parent,label);
            if (trimLabel.length() == 0)             labelInfo.setReplaceableText(label);
          }
        }
      }
    }
 else {
      breakLine=false;
    }
  }
  if (textAsBuffer != null) {
    String trimLabel=textAsBuffer.toString();
    if (pi == null || !pi.isBlankPreserved())     trimLabel=trimLabel.trim();
    if (trimLabel.length() != 0)     pi.addProperty(textAs,trimLabel,null);
  }
}