Program: 80024
Project: 80024
Buggy source:
/** 
 * Push extra code to generate the casts within the arrays for the parameters passed as arrays.
 */
public void generateOneParameter(ExpressionClassBuilder acb,MethodBuilder mb,int parameterNumber) throws StandardException {
  int parameterMode;
  SQLToJavaValueNode sql2j=null;
  if (methodParms[parameterNumber] instanceof SQLToJavaValueNode)   sql2j=(SQLToJavaValueNode)methodParms[parameterNumber];
  if (routineInfo != null) {
    parameterMode=routineInfo.getParameterModes()[getRoutineArgIdx(parameterNumber)];
  }
 else {
    parameterMode=JDBC30Translation.PARAMETER_MODE_IN;
    if (sql2j != null) {
      if (sql2j.getSQLValueNode().requiresTypeFromContext()) {
        ParameterNode pn;
        if (sql2j.getSQLValueNode() instanceof UnaryOperatorNode)         pn=((UnaryOperatorNode)sql2j.getSQLValueNode()).getParameterOperand();
 else         pn=(ParameterNode)(sql2j.getSQLValueNode());
        int applicationParameterNumber=pn.getParameterNumber();
        String parameterType=methodParameterTypes[parameterNumber];
        if (parameterType.endsWith("String_Node_Str")) {
          MethodBuilder constructor=acb.getConstructor();
          acb.pushThisAsActivation(constructor);
          constructor.callMethod(VMOpcode.INVOKEINTERFACE,null,"String_Node_Str",ClassName.ParameterValueSet,0);
          constructor.push(applicationParameterNumber);
          constructor.push(JDBC30Translation.PARAMETER_MODE_UNKNOWN);
          constructor.callMethod(VMOpcode.INVOKEINTERFACE,null,"String_Node_Str","String_Node_Str",2);
          constructor.endStatement();
        }
      }
    }
  }
switch (parameterMode) {
case JDBC30Translation.PARAMETER_MODE_IN:
case JDBC30Translation.PARAMETER_MODE_IN_OUT:
case JDBC30Translation.PARAMETER_MODE_UNKNOWN:
    if (sql2j != null)     sql2j.returnsNullOnNullState=returnsNullOnNullState;
  super.generateOneParameter(acb,mb,parameterNumber);
break;
case JDBC30Translation.PARAMETER_MODE_OUT:
break;
}
switch (parameterMode) {
case JDBC30Translation.PARAMETER_MODE_IN:
case JDBC30Translation.PARAMETER_MODE_UNKNOWN:
break;
case JDBC30Translation.PARAMETER_MODE_IN_OUT:
case JDBC30Translation.PARAMETER_MODE_OUT:
{
String methodParameterType=methodParameterTypes[parameterNumber];
String arrayType=methodParameterType.substring(0,methodParameterType.length() - 2);
LocalField lf=acb.newFieldDeclaration(Modifier.PRIVATE,methodParameterType);
if (outParamArrays == null) outParamArrays=new LocalField[methodParms.length];
outParamArrays[parameterNumber]=lf;
mb.pushNewArray(arrayType,1);
mb.putField(lf);
if (parameterMode != JDBC30Translation.PARAMETER_MODE_OUT) {
mb.swap();
mb.setArrayElement(0);
mb.getField(lf);
}
break;
}
}
}

Fixed version (ground truth):
/** 
 * Push extra code to generate the casts within the arrays for the parameters passed as arrays.
 */
public void generateOneParameter(ExpressionClassBuilder acb,MethodBuilder mb,int parameterNumber) throws StandardException {
  int parameterMode;
  SQLToJavaValueNode sql2j=null;
  if (methodParms[parameterNumber] instanceof SQLToJavaValueNode)   sql2j=(SQLToJavaValueNode)methodParms[parameterNumber];
  if (routineInfo != null) {
    parameterMode=routineInfo.getParameterModes()[getRoutineArgIdx(parameterNumber)];
  }
 else {
    parameterMode=JDBC30Translation.PARAMETER_MODE_IN;
    if (sql2j != null) {
      if (sql2j.getSQLValueNode().requiresTypeFromContext()) {
        ParameterNode pn;
        if (sql2j.getSQLValueNode() instanceof UnaryOperatorNode)         pn=((UnaryOperatorNode)sql2j.getSQLValueNode()).getParameterOperand();
 else         pn=(ParameterNode)(sql2j.getSQLValueNode());
        int applicationParameterNumber=pn.getParameterNumber();
        String parameterType=methodParameterTypes[getRoutineArgIdx(parameterNumber)];
        if (parameterType.endsWith("String_Node_Str")) {
          MethodBuilder constructor=acb.getConstructor();
          acb.pushThisAsActivation(constructor);
          constructor.callMethod(VMOpcode.INVOKEINTERFACE,null,"String_Node_Str",ClassName.ParameterValueSet,0);
          constructor.push(applicationParameterNumber);
          constructor.push(JDBC30Translation.PARAMETER_MODE_UNKNOWN);
          constructor.callMethod(VMOpcode.INVOKEINTERFACE,null,"String_Node_Str","String_Node_Str",2);
          constructor.endStatement();
        }
      }
    }
  }
switch (parameterMode) {
case JDBC30Translation.PARAMETER_MODE_IN:
case JDBC30Translation.PARAMETER_MODE_IN_OUT:
case JDBC30Translation.PARAMETER_MODE_UNKNOWN:
    if (sql2j != null)     sql2j.returnsNullOnNullState=returnsNullOnNullState;
  super.generateOneParameter(acb,mb,parameterNumber);
break;
case JDBC30Translation.PARAMETER_MODE_OUT:
break;
}
switch (parameterMode) {
case JDBC30Translation.PARAMETER_MODE_IN:
case JDBC30Translation.PARAMETER_MODE_UNKNOWN:
break;
case JDBC30Translation.PARAMETER_MODE_IN_OUT:
case JDBC30Translation.PARAMETER_MODE_OUT:
{
String methodParameterType=methodParameterTypes[getRoutineArgIdx(parameterNumber)];
String arrayType=methodParameterType.substring(0,methodParameterType.length() - 2);
if (isVararg(parameterNumber)) {
methodParameterType=stripOneArrayLevel(methodParameterType);
arrayType=stripOneArrayLevel(arrayType);
}
LocalField lf=acb.newFieldDeclaration(Modifier.PRIVATE,methodParameterType);
if (outParamArrays == null) {
outParamArrays=new LocalField[methodParms.length];
}
outParamArrays[parameterNumber]=lf;
mb.pushNewArray(arrayType,1);
mb.putField(lf);
if (parameterMode != JDBC30Translation.PARAMETER_MODE_OUT) {
mb.swap();
mb.setArrayElement(0);
mb.getField(lf);
}
break;
}
}
}