Program: 67339
Project: 67339
Buggy source:
/** 
 * PUBLIC: Function Convert values returned by the query to values given in the caseItems hashtable.  The equivalent of the Oracle CASE function <p>Example: <blockquote><pre> Map caseTable = new HashMap(); caseTable.put("Robert", "Bob"); caseTable.put("Susan", "Sue"); TopLink: employee.get("name").caseStatement(caseTable, "No-Nickname") Java: NA SQL: CASE name WHEN "Robert" THEN "Bob" WHEN "Susan" THEN "Sue" ELSE "No-Nickname" </blockquote></pre>
 * @param caseItems java.util.MapA Map containing the items to be processed. Keys represent the items to match coming from the query. Values represent what a key will be changed to.
 * @param defaultItem java.lang.String  the default value that will be used if none of the keys in thehashtable match
 */
public Expression caseStatement(Map caseItems,String defaultItem){
  ExpressionOperator anOperator=new ExpressionOperator();
  anOperator.setSelector(ExpressionOperator.Case);
  anOperator.setNodeClass(FunctionExpression.class);
  anOperator.setType(ExpressionOperator.FunctionOperator);
  anOperator.bePrefix();
  Vector v=org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(caseItems.size() + 1);
  v.addElement("String_Node_Str");
  FunctionExpression expression=new FunctionExpression();
  expression.setBaseExpression(this);
  expression.addChild(this);
  Iterator iterator=caseItems.keySet().iterator();
  while (iterator.hasNext()) {
    Object key=iterator.next();
    expression.addChild(Expression.from(key,this));
    expression.addChild(Expression.from(caseItems.get(key),this));
    v.addElement("String_Node_Str");
    v.addElement("String_Node_Str");
  }
  v.addElement("String_Node_Str");
  expression.addChild(Expression.from(defaultItem,this));
  v.addElement("String_Node_Str");
  anOperator.printsAs(v);
  expression.setOperator(anOperator);
  return expression;
}

Fixed version (ground truth):
/** 
 * PUBLIC: Function Convert values returned by the query to values given in the caseItems Map.  The equivalent of the Oracle CASE function <p>Example: <blockquote><pre> Map caseTable = new HashMap(); caseTable.put("Robert", "Bob"); caseTable.put("Susan", "Sue"); TopLink: employee.get("name").caseStatement(caseTable, "No-Nickname") Java: NA SQL: CASE name WHEN "Robert" THEN "Bob" WHEN "Susan" THEN "Sue" ELSE "No-Nickname" </blockquote></pre>
 * @param caseItems java.util.MapA Map containing the items to be processed. Keys represent the items to match coming from the query. Values represent what a key will be changed to.
 * @param defaultItem java.lang.String  the default value that will be used if none of the keys in thehashtable match
 */
public Expression caseStatement(Map caseItems,Object defaultItem){
  ExpressionOperator anOperator=new ExpressionOperator();
  anOperator.setSelector(ExpressionOperator.Case);
  anOperator.setNodeClass(FunctionExpression.class);
  anOperator.setType(ExpressionOperator.FunctionOperator);
  anOperator.bePrefix();
  Vector v=org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(caseItems.size() * 2 + 3);
  v.addElement("String_Node_Str");
  FunctionExpression expression=new FunctionExpression();
  expression.setBaseExpression(this);
  expression.addChild(this);
  Iterator iterator=caseItems.keySet().iterator();
  while (iterator.hasNext()) {
    Object key=iterator.next();
    expression.addChild(Expression.from(key,this));
    expression.addChild(Expression.from(caseItems.get(key),this));
    v.addElement("String_Node_Str");
    v.addElement("String_Node_Str");
  }
  v.addElement("String_Node_Str");
  expression.addChild(Expression.from(defaultItem,this));
  v.addElement("String_Node_Str");
  anOperator.printsAs(v);
  expression.setOperator(anOperator);
  return expression;
}