Program: 130092
Project: 130092
Buggy source:
/** 
 * @author cantoine
 */
public Attributes getNext() throws IOException {
  int type=1;
  boolean encoded=false;
  Attributes entry=null;
  int linenr=0;
  entry=null;
  StringBuffer dn;
  StringBuffer value=dn=null;
  String line;
  String attribute;
  String sDN;
  lastDN=line=attribute=sDN=null;
  while ((line=reader.readLine()) != null) {
    int len=line.length();
    linenr++;
    if (len <= 0 || line.charAt(0) != '#') {
      if (len > 0 && line.charAt(0) == ' ') {
        if (value == null) {
          lastDN=null;
        }
        value.append(line.substring(1));
      }
 else       if (len == 0) {
        if (attribute != null && value != null) {
          if (entry == null) {
            entry=new BasicAttributes(true);
          }
          add(entry,attribute,value.toString(),type);
          attribute=null;
          value=null;
        }
        if (dn != null && lastDN == null) {
          lastDN=getDN(dn,type);
        }
        if (entry != null) {
          return entry;
        }
      }
 else {
        int pos=line.indexOf("String_Node_Str");
        if (pos == -1) {
          lastDN=null;
        }
        if (dn != null && lastDN == null) {
          lastDN=getDN(dn,type);
        }
        if (attribute != null && value != null) {
          if (entry == null) {
            entry=new BasicAttributes(true);
          }
          add(entry,attribute,value.toString(),type);
        }
        int to=pos;
        int from=pos + 1;
        if (line.charAt(from) == ':') {
          if (line.charAt(from - 1) != ':') {
            type=2;
            from++;
          }
 else {
            type=1;
            from+=2;
          }
        }
 else         if (line.charAt(from) == '<') {
          type=3;
          from++;
        }
 else {
          type=1;
        }
        if (line.charAt(from) == ' ') {
          from++;
        }
        attribute=line.substring(0,to);
        value=new StringBuffer(line.substring(from));
        if (dn == null) {
          dn=value;
          attribute=null;
        }
      }
    }
  }
  return entry;
}

Fixed version (ground truth):
/** 
 * @author cantoine
 */
public Attributes getNext() throws IOException {
  int type=1;
  boolean encoded=false;
  Attributes entry=null;
  int linenr=0;
  entry=null;
  StringBuffer dn;
  StringBuffer value=dn=null;
  String line;
  String attribute;
  String sDN;
  lastDN=line=attribute=sDN=null;
  while ((line=reader.readLine()) != null) {
    int len=line.length();
    linenr++;
    if (len <= 0 || line.charAt(0) != '#' && line.charAt(0) != '-') {
      if (len > 0 && line.charAt(0) == ' ') {
        if (value == null) {
          lastDN=null;
        }
        value.append(line.substring(1));
      }
 else       if (len == 0) {
        if (attribute != null && value != null) {
          if (entry == null) {
            entry=new BasicAttributes(true);
          }
          add(entry,attribute,value.toString(),type);
          attribute=null;
          value=null;
        }
        if (dn != null && lastDN == null) {
          lastDN=getDN(dn,type);
        }
        if (entry != null) {
          return entry;
        }
      }
 else {
        int pos=line.indexOf("String_Node_Str");
        if (pos == -1) {
          lastDN=null;
        }
        if (dn != null && lastDN == null) {
          lastDN=getDN(dn,type);
        }
        if (attribute != null && value != null) {
          if (entry == null) {
            entry=new BasicAttributes(true);
          }
          add(entry,attribute,value.toString(),type);
        }
        int to=pos;
        int from=pos + 1;
        if (line.charAt(from) == ':') {
          if (line.charAt(from - 1) != ':') {
            type=2;
            from++;
          }
 else {
            type=1;
            from+=2;
          }
        }
 else         if (line.charAt(from) == '<') {
          type=3;
          from++;
        }
 else {
          type=1;
        }
        if (line.charAt(from) == ' ') {
          from++;
        }
        attribute=line.substring(0,to);
        value=new StringBuffer(line.substring(from));
        if (dn == null) {
          dn=value;
          attribute=null;
        }
      }
    }
  }
  return entry;
}