Program: 12291
Project: 12291
Buggy source:
/** 
 * Given the id, attribute, and value already read, this routine parses zero or more   {@code <preference-specifier>'s }.  It builds and returns an action list for these RHS make's.  It returns null if any error occurred. <pre>  {@code <value_make> ::= <rhs_value> <preferences> <preferences> ::= [,] | <preference_specifier>+    <preference-specifier> ::= <naturally-unary-preference> [,] | <forced-unary-preference> | <binary-preference> <rhs_value> [,]}</pre> <p>parser.cpp::parse_preferences
 * @param id
 * @param attr
 * @param value
 * @return an action list
 * @throws IOException
 * @throws ParserException
 */
Action parse_preferences(SymbolImpl id,RhsValue attr,RhsValue value) throws IOException, ParserException {
  boolean saw_plus_sign=(currentType() == LexemeType.PLUS);
  PreferenceType preference_type=parse_preference_specifier_without_referent();
  if ((preference_type == PreferenceType.ACCEPTABLE) && (!saw_plus_sign)) {
    consumeComma();
  }
  Action prev_a=null;
  while (true) {
    final RhsValue referent;
    if (preference_type.isBinary()) {
      referent=parse_rhs_value();
      consumeComma();
    }
 else {
      referent=null;
    }
    final MakeAction a=new MakeAction();
    a.preference_type=preference_type;
    a.next=prev_a;
    prev_a=a;
    a.id=new RhsSymbolValue(id);
    a.attr=attr.copy();
    a.value=value.copy();
    if (preference_type.isBinary()) {
      a.referent=referent;
    }
    saw_plus_sign=(currentType() == LexemeType.PLUS);
    preference_type=parse_preference_specifier_without_referent();
    if ((preference_type == PreferenceType.ACCEPTABLE) && (!saw_plus_sign)) {
      return prev_a;
    }
  }
}

Fixed version (ground truth):
/** 
 * Given the id, attribute, and value already read, this routine parses zero or more   {@code <preference-specifier>'s }.  It builds and returns an action list for these RHS make's.  It returns null if any error occurred. <pre>  {@code <value_make> ::= <rhs_value> <preferences> <preferences> ::= [,] | <preference_specifier>+    <preference-specifier> ::= <naturally-unary-preference> [,] | <forced-unary-preference> | <binary-preference> <rhs_value> [,]}</pre> <p>parser.cpp::parse_preferences
 * @param id
 * @param attr
 * @param value
 * @return an action list
 * @throws IOException
 * @throws ParserException
 */
Action parse_preferences(SymbolImpl id,RhsValue attr,RhsValue value) throws IOException, ParserException {
  boolean saw_plus_sign=(currentType() == LexemeType.PLUS);
  PreferenceType preference_type=parse_preference_specifier_without_referent();
  if ((preference_type == PreferenceType.ACCEPTABLE) && (!saw_plus_sign)) {
    consumeComma();
  }
  Action prev_a=null;
  while (true) {
    final RhsValue referent;
    if (preference_type.isBinary()) {
      referent=parse_rhs_value();
      consumeComma();
    }
 else {
      referent=null;
    }
    final MakeAction a=new MakeAction();
    a.preference_type=preference_type;
    a.next=prev_a;
    prev_a=a;
    a.id=id.toRhsValue();
    a.attr=attr.copy();
    a.value=value.copy();
    if (preference_type.isBinary()) {
      a.referent=referent;
    }
    saw_plus_sign=(currentType() == LexemeType.PLUS);
    preference_type=parse_preference_specifier_without_referent();
    if ((preference_type == PreferenceType.ACCEPTABLE) && (!saw_plus_sign)) {
      return prev_a;
    }
  }
}