Program: 47745
Project: 47745
Buggy source:
public boolean processRow(StepMetaInterface smi,StepDataInterface sdi) throws KettleException {
  Object[] currentInputRow=getRow();
  if (first) {
    first=false;
    m_data=(AvroInputData)sdi;
    m_meta=(AvroInputMeta)smi;
    if (Const.isEmpty(m_meta.getFilename()) && !m_meta.getAvroInField()) {
      throw new KettleException(BaseMessages.getString(AvroInputMeta.PKG,"String_Node_Str"));
    }
    String readerSchema=m_meta.getSchemaFilename();
    readerSchema=environmentSubstitute(readerSchema);
    String avroFieldName=m_meta.getAvroFieldName();
    avroFieldName=environmentSubstitute(avroFieldName);
    RowMetaInterface outRowMeta=null;
    outRowMeta=getInputRowMeta();
    if (outRowMeta != null) {
      outRowMeta=outRowMeta.clone();
    }
 else {
      outRowMeta=new RowMeta();
    }
    int newFieldOffset=outRowMeta.size();
    m_data.setOutputRowMeta(outRowMeta);
    m_meta.getFields(m_data.getOutputRowMeta(),getStepname(),null,null,this);
    if (m_meta.getLookupFields() != null && m_meta.getLookupFields().size() > 0) {
      for (      AvroInputMeta.LookupField f : m_meta.getLookupFields()) {
        f.init(getInputRowMeta(),this);
      }
    }
    if (m_meta.getAvroInField()) {
      if (m_meta.getLookupFields() != null && m_meta.getLookupFields().size() > 0) {
      }
      m_data.initializeFromFieldDecoding(avroFieldName,readerSchema,m_meta.getAvroFields(),m_meta.getAvroIsJsonEncoded(),newFieldOffset);
      if (m_meta.getLookupFields() != null && m_meta.getLookupFields().size() > 0) {
      }
    }
 else {
      FileObject fileObject=KettleVFS.getFileObject(m_meta.getFilename(),getTransMeta());
      m_data.establishFileType(fileObject,readerSchema,m_meta.getAvroFields(),m_meta.getAvroIsJsonEncoded(),newFieldOffset);
    }
  }
  if (!m_meta.getAvroInField()) {
    currentInputRow=null;
  }
 else {
    if (currentInputRow != null) {
      if (m_meta.getLookupFields() != null && m_meta.getLookupFields().size() > 0) {
        for (        AvroInputMeta.LookupField f : m_meta.getLookupFields()) {
          f.setVariable(this,currentInputRow);
        }
      }
    }
  }
  Object[][] outputRow=null;
  try {
    outputRow=m_data.avroObjectToKettle(currentInputRow,this);
  }
 catch (  Exception ex) {
    if (getStepMeta().isDoingErrorHandling()) {
      String errorDescriptions="String_Node_Str" + ex.getMessage();
      String errorFields="String_Node_Str";
      RowMetaInterface rowMeta=null;
      Object[] currentRow=new Object[0];
      if (m_meta.getAvroInField()) {
        errorFields+=m_meta.getAvroFieldName();
        rowMeta=getInputRowMeta();
        currentRow=currentInputRow;
      }
 else {
        errorFields="String_Node_Str";
        rowMeta=m_data.getOutputRowMeta();
      }
      putError(rowMeta,currentRow,1,errorDescriptions,errorFields,"String_Node_Str");
    }
 else {
      throw new KettleException(ex.getMessage(),ex);
    }
  }
  if (outputRow != null) {
    for (int i=0; i < outputRow.length; i++) {
      putRow(m_data.getOutputRowMeta(),outputRow[i]);
      if (log.isRowLevel()) {
        log.logRowlevel(toString(),"String_Node_Str" + getProcessed() + "String_Node_Str"+ outputRow);
      }
    }
  }
 else {
    if (!m_meta.getAvroInField()) {
      try {
        logBasic(BaseMessages.getString(AvroInputMeta.PKG,"String_Node_Str"));
        m_data.close();
      }
 catch (      IOException ex) {
        throw new KettleException(ex.getMessage(),ex);
      }
    }
    setOutputDone();
    return false;
  }
  if (checkFeedback(getProcessed())) {
    logBasic(BaseMessages.getString(AvroInputMeta.PKG,"String_Node_Str",getProcessed()));
  }
  return true;
}

Fixed version (ground truth):
public boolean processRow(StepMetaInterface smi,StepDataInterface sdi) throws KettleException {
  Object[] currentInputRow=getRow();
  if (first) {
    first=false;
    m_data=(AvroInputData)sdi;
    m_meta=(AvroInputMeta)smi;
    if (Const.isEmpty(m_meta.getFilename()) && !m_meta.getAvroInField()) {
      throw new KettleException(BaseMessages.getString(AvroInputMeta.PKG,"String_Node_Str"));
    }
    String readerSchema=m_meta.getSchemaFilename();
    readerSchema=environmentSubstitute(readerSchema);
    String avroFieldName=m_meta.getAvroFieldName();
    avroFieldName=environmentSubstitute(avroFieldName);
    RowMetaInterface outRowMeta=null;
    outRowMeta=getInputRowMeta();
    if (outRowMeta != null) {
      outRowMeta=outRowMeta.clone();
    }
 else {
      outRowMeta=new RowMeta();
    }
    int newFieldOffset=outRowMeta.size();
    m_data.setOutputRowMeta(outRowMeta);
    m_meta.getFields(m_data.getOutputRowMeta(),getStepname(),null,null,this);
    if (m_meta.getLookupFields() != null && m_meta.getLookupFields().size() > 0) {
      for (      AvroInputMeta.LookupField f : m_meta.getLookupFields()) {
        f.init(getInputRowMeta(),this);
      }
    }
    if (m_meta.getAvroInField()) {
      if (m_meta.getLookupFields() != null && m_meta.getLookupFields().size() > 0) {
      }
      m_data.initializeFromFieldDecoding(avroFieldName,readerSchema,m_meta.getAvroFields(),m_meta.getAvroIsJsonEncoded(),newFieldOffset);
      if (m_meta.getLookupFields() != null && m_meta.getLookupFields().size() > 0) {
      }
    }
 else {
      FileObject fileObject=KettleVFS.getFileObject(m_meta.getFilename(),getTransMeta());
      m_data.establishFileType(fileObject,readerSchema,m_meta.getAvroFields(),m_meta.getAvroIsJsonEncoded(),newFieldOffset);
    }
  }
  if (!m_meta.getAvroInField()) {
    currentInputRow=null;
  }
 else {
    if (currentInputRow != null) {
      if (m_meta.getLookupFields() != null && m_meta.getLookupFields().size() > 0) {
        for (        AvroInputMeta.LookupField f : m_meta.getLookupFields()) {
          f.setVariable(this,currentInputRow);
        }
      }
    }
  }
  Object[][] outputRow=null;
  try {
    outputRow=m_data.avroObjectToKettle(currentInputRow,this);
  }
 catch (  Exception ex) {
    if (getStepMeta().isDoingErrorHandling()) {
      String errorDescriptions="String_Node_Str" + ex.getMessage();
      String errorFields="String_Node_Str";
      RowMetaInterface rowMeta=null;
      Object[] currentRow=new Object[0];
      if (m_meta.getAvroInField()) {
        errorFields+=m_meta.getAvroFieldName();
        rowMeta=getInputRowMeta();
        currentRow=currentInputRow;
      }
 else {
        errorFields="String_Node_Str";
        rowMeta=m_data.getOutputRowMeta();
      }
      putError(rowMeta,currentRow,1,errorDescriptions,errorFields,"String_Node_Str");
      if (checkFeedback(getProcessed())) {
        logBasic(BaseMessages.getString(AvroInputMeta.PKG,"String_Node_Str",getProcessed()));
      }
      return true;
    }
 else {
      throw new KettleException(ex.getMessage(),ex);
    }
  }
  if (outputRow != null) {
    for (int i=0; i < outputRow.length; i++) {
      putRow(m_data.getOutputRowMeta(),outputRow[i]);
      if (log.isRowLevel()) {
        log.logRowlevel(toString(),"String_Node_Str" + getProcessed() + "String_Node_Str"+ outputRow);
      }
    }
  }
 else {
    if (!m_meta.getAvroInField()) {
      try {
        logBasic(BaseMessages.getString(AvroInputMeta.PKG,"String_Node_Str"));
        m_data.close();
      }
 catch (      IOException ex) {
        throw new KettleException(ex.getMessage(),ex);
      }
    }
    setOutputDone();
    return false;
  }
  if (checkFeedback(getProcessed())) {
    logBasic(BaseMessages.getString(AvroInputMeta.PKG,"String_Node_Str",getProcessed()));
  }
  return true;
}