Program: 65140
Project: 65140
Buggy source:
protected AbstractSingleEncapsulatedExpressionHelper<FunctionExpression> buildFunctionExpressionHelper(){
  return new AbstractSingleEncapsulatedExpressionHelper<FunctionExpression>(){
    @Override public String[] arguments(    FunctionExpression expression){
      return new String[]{expression.getIdentifier()};
    }
    @Override @SuppressWarnings("String_Node_Str") protected String encapsulatedExpressionInvalidKey(    FunctionExpression expression){
switch (expression.getParameterCount()) {
case ONE:
{
          Expression children=expression.getExpression();
          int childrenCount=getChildren(children).size();
          if (childrenCount > 1) {
            return FunctionExpression_MoreThanOneExpression;
          }
        }
case ZERO:
{
        return FunctionExpression_HasExpression;
      }
default :
{
      return FunctionExpression_InvalidExpression;
    }
}
}
@Override @SuppressWarnings("String_Node_Str") protected String encapsulatedExpressionMissingKey(FunctionExpression expression){
switch (expression.getParameterCount()) {
case ONE:
{
    Expression children=expression.getExpression();
    int childrenCount=getChildren(children).size();
    if (childrenCount == 0) {
      return FunctionExpression_MissingOneExpression;
    }
  }
default :
{
  return FunctionExpression_MissingExpression;
}
}
}
@Override protected boolean isEncapsulatedExpressionMissing(FunctionExpression expression){
switch (expression.getParameterCount()) {
case ONE:
case ONE_OR_MANY:
{
return !expression.hasExpression();
}
default :
{
return false;
}
}
}
@Override protected boolean isEncapsulatedExpressionValid(FunctionExpression expression){
switch (expression.getParameterCount()) {
case ONE:
{
return isValid(expression.getExpression(),expression.encapsulatedExpressionBNF());
}
case ONE_OR_MANY:
{
return isValidWithChildCollectionBypass(expression.getExpression(),expression.encapsulatedExpressionBNF());
}
case ZERO_OR_ONE:
{
return !expression.hasExpression() || isValid(expression.getExpression(),expression.encapsulatedExpressionBNF());
}
default :
{
return true;
}
}
}
public String leftParenthesisMissingKey(FunctionExpression expression){
return FunctionExpression_MissingLeftParenthesis;
}
@Override protected int lengthBeforeEncapsulatedExpression(FunctionExpression expression){
return expression.getFunctionName().length() + (expression.hasComma() ? 1 : 0) + (expression.hasSpaceAfterComma() ? 1 : 0);
}
public String rightParenthesisMissingKey(FunctionExpression expression){
return FunctionExpression_MissingRightParenthesis;
}
}
;
}

Fixed version (ground truth):
protected AbstractSingleEncapsulatedExpressionHelper<FunctionExpression> buildFunctionExpressionHelper(){
  return new AbstractSingleEncapsulatedExpressionHelper<FunctionExpression>(){
    @Override public String[] arguments(    FunctionExpression expression){
      return new String[]{expression.getIdentifier()};
    }
    @Override @SuppressWarnings("String_Node_Str") protected String encapsulatedExpressionInvalidKey(    FunctionExpression expression){
switch (expression.getParameterCount()) {
case ONE:
{
          Expression children=expression.getExpression();
          int childrenCount=getChildren(children).size();
          if (childrenCount > 1) {
            return FunctionExpression_MoreThanOneExpression;
          }
        }
case ZERO:
{
        return FunctionExpression_HasExpression;
      }
default :
{
      return FunctionExpression_InvalidExpression;
    }
}
}
@Override @SuppressWarnings("String_Node_Str") protected String encapsulatedExpressionMissingKey(FunctionExpression expression){
switch (expression.getParameterCount()) {
case ONE:
{
    Expression children=expression.getExpression();
    int childrenCount=getChildren(children).size();
    if (childrenCount == 0) {
      return FunctionExpression_MissingOneExpression;
    }
  }
default :
{
  return FunctionExpression_MissingExpression;
}
}
}
@Override protected boolean isEncapsulatedExpressionMissing(FunctionExpression expression){
switch (expression.getParameterCount()) {
case ONE:
case ONE_OR_MANY:
return !expression.hasExpression();
default :
return false;
}
}
@Override protected boolean isEncapsulatedExpressionValid(FunctionExpression expression){
switch (expression.getParameterCount()) {
case ONE:
{
return isValid(expression.getExpression(),expression.encapsulatedExpressionBNF());
}
case ONE_OR_MANY:
{
return isValidWithChildCollectionBypass(expression.getExpression(),expression.encapsulatedExpressionBNF());
}
case ZERO_OR_ONE:
{
return !expression.hasExpression() || isValid(expression.getExpression(),expression.encapsulatedExpressionBNF());
}
default :
{
return true;
}
}
}
public String leftParenthesisMissingKey(FunctionExpression expression){
return FunctionExpression_MissingLeftParenthesis;
}
@Override protected int lengthBeforeEncapsulatedExpression(FunctionExpression expression){
return expression.getFunctionName().length() + (expression.hasComma() ? 1 : 0) + (expression.hasSpaceAfterComma() ? 1 : 0);
}
public String rightParenthesisMissingKey(FunctionExpression expression){
return FunctionExpression_MissingRightParenthesis;
}
}
;
}