Program: 47756
Project: 47756
Buggy source:
private void checkKeyInformation(boolean quiet,boolean readFieldsFromMapping){
  if ((!Const.isEmpty(m_coreConfigText.getText()) || !Const.isEmpty(m_zookeeperQuorumText.getText())) && !Const.isEmpty(m_mappedTableNamesCombo.getText()) && !Const.isEmpty(m_mappingNamesCombo.getText())) {
    try {
      m_indexedLookup=new HashMap<String,String>();
      MappingAdmin admin=new MappingAdmin();
      Mapping current=null;
      Map<String,HBaseValueMeta> mappedColumns=null;
      String keyName=null;
      String keyType=null;
      boolean filterAliasesDone=false;
      try {
        Configuration connection=getHBaseConnection();
        admin.setConnection(connection);
        current=admin.getMapping(transMeta.environmentSubstitute(m_mappedTableNamesCombo.getText()),transMeta.environmentSubstitute(m_mappingNamesCombo.getText()));
        keyName=current.getKeyName();
        keyType=current.getKeyType().toString();
        m_keyInfo.setText("String_Node_Str" + keyName + "String_Node_Str"+ keyType+ "String_Node_Str");
        mappedColumns=current.getMappedColumns();
        m_mappedColumns=mappedColumns;
        List<String> filterAliasNames=new ArrayList<String>();
        for (        String alias : mappedColumns.keySet()) {
          HBaseValueMeta column=mappedColumns.get(alias);
          String aliasS=column.getAlias();
          if (column.isNumeric() || column.isDate() || column.isString()|| column.isBoolean()) {
            filterAliasNames.add(aliasS);
          }
        }
        String[] filterAliasNamesA=filterAliasNames.toArray(new String[1]);
        m_filterAliasCI.setComboValues(filterAliasNamesA);
        filterAliasesDone=true;
      }
 catch (      Exception ex) {
        if (!quiet) {
          new ErrorDialog(shell,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str") + "String_Node_Str" + transMeta.environmentSubstitute(m_mappedTableNamesCombo.getText() + "String_Node_Str" + transMeta.environmentSubstitute(m_mappingNamesCombo.getText())+ "String_Node_Str"),ex);
          ex.printStackTrace();
        }
        m_keyInfo.setText(Messages.getString("String_Node_Str"));
      }
      m_fieldsView.clearAll(false);
      if (current != null && (readFieldsFromMapping || m_currentMeta.getOutputFields() == null || m_currentMeta.getOutputFields().size() == 0)) {
        TableItem item=new TableItem(m_fieldsView.table,SWT.NONE);
        item.setText(1,keyName);
        item.setText(2,"String_Node_Str");
        item.setText(7,"String_Node_Str");
        if (current.getKeyType() == Mapping.KeyType.DATE || current.getKeyType() == Mapping.KeyType.UNSIGNED_DATE) {
          item.setText(5,ValueMeta.getTypeDesc(ValueMetaInterface.TYPE_DATE));
        }
 else         if (current.getKeyType() == Mapping.KeyType.STRING) {
          item.setText(5,ValueMeta.getTypeDesc(ValueMetaInterface.TYPE_STRING));
        }
 else {
          item.setText(5,ValueMeta.getTypeDesc(ValueMetaInterface.TYPE_INTEGER));
        }
      }
      if (!readFieldsFromMapping && m_currentMeta.getOutputFields() != null && m_currentMeta.getOutputFields().size() > 0) {
        List<String> filterAliasNames=new ArrayList<String>();
        for (        HBaseValueMeta column : m_currentMeta.getOutputFields()) {
          TableItem item=new TableItem(m_fieldsView.table,SWT.NONE);
          String aliasS=column.getAlias();
          String type=column.getTypeDesc();
          item.setText(1,aliasS);
          item.setText(5,type);
          if (column.isKey()) {
            item.setText(2,"String_Node_Str");
            item.setText(7,"String_Node_Str");
            continue;
          }
          item.setText(2,"String_Node_Str");
          if (column.isNumeric() || column.isDate() || column.isString()) {
            if (!filterAliasesDone) {
              filterAliasNames.add(aliasS);
            }
          }
          String family=column.getColumnFamily();
          String name=column.getColumnName();
          String format=column.getConversionMask();
          if (column.getStorageType() == ValueMetaInterface.STORAGE_TYPE_INDEXED) {
            String valuesString=HBaseValueMeta.objectIndexValuesToString(column.getIndex());
            m_indexedLookup.put(aliasS,valuesString);
            item.setText(7,"String_Node_Str");
          }
 else {
            item.setText(7,"String_Node_Str");
          }
          item.setText(3,family);
          item.setText(4,name);
          if (!Const.isEmpty(format)) {
            item.setText(6,format);
          }
        }
        if (!filterAliasesDone) {
          String[] filterAliasNamesA=filterAliasNames.toArray(new String[1]);
          m_filterAliasCI.setComboValues(filterAliasNamesA);
          filterAliasesDone=true;
        }
      }
 else       if (current != null) {
        for (        String alias : mappedColumns.keySet()) {
          HBaseValueMeta column=mappedColumns.get(alias);
          String aliasS=column.getAlias();
          String family=column.getColumnFamily();
          String name=column.getColumnName();
          String type=column.getTypeDesc();
          String format=column.getConversionMask();
          TableItem item=new TableItem(m_fieldsView.table,SWT.NONE);
          if (column.getStorageType() == ValueMetaInterface.STORAGE_TYPE_INDEXED) {
            String valuesString=HBaseValueMeta.objectIndexValuesToString(column.getIndex());
            m_indexedLookup.put(aliasS,valuesString);
            item.setText(7,"String_Node_Str");
          }
 else {
            item.setText(7,"String_Node_Str");
          }
          item.setText(1,aliasS);
          item.setText(2,"String_Node_Str");
          item.setText(3,family);
          item.setText(4,name);
          item.setText(5,type);
          if (!Const.isEmpty(format)) {
            item.setText(6,format);
          }
        }
      }
      m_fieldsView.removeEmptyRows();
      m_fieldsView.setRowNums();
      m_fieldsView.optWidth(true);
    }
 catch (    Exception ex) {
      if (!quiet) {
        new ErrorDialog(shell,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str") + "String_Node_Str" + transMeta.environmentSubstitute(m_mappedTableNamesCombo.getText() + "String_Node_Str" + transMeta.environmentSubstitute(m_mappingNamesCombo.getText())+ "String_Node_Str"),ex);
      }
      m_keyInfo.setText(Messages.getString("String_Node_Str"));
      ex.printStackTrace();
    }
  }
 else {
    m_keyInfo.setText("String_Node_Str");
  }
}

Fixed version (ground truth):
private void checkKeyInformation(boolean quiet,boolean readFieldsFromMapping){
  if ((!Const.isEmpty(m_coreConfigText.getText()) || !Const.isEmpty(m_zookeeperQuorumText.getText())) && !Const.isEmpty(m_mappedTableNamesCombo.getText()) && !Const.isEmpty(m_mappingNamesCombo.getText())) {
    try {
      m_indexedLookup=new HashMap<String,String>();
      MappingAdmin admin=new MappingAdmin();
      Mapping current=null;
      Map<String,HBaseValueMeta> mappedColumns=null;
      String keyName=null;
      String keyType=null;
      boolean filterAliasesDone=false;
      try {
        Configuration connection=getHBaseConnection();
        admin.setConnection(connection);
        current=admin.getMapping(transMeta.environmentSubstitute(m_mappedTableNamesCombo.getText()),transMeta.environmentSubstitute(m_mappingNamesCombo.getText()));
        keyName=current.getKeyName();
        keyType=current.getKeyType().toString();
        m_keyInfo.setText("String_Node_Str" + keyName + "String_Node_Str"+ keyType+ "String_Node_Str");
        mappedColumns=current.getMappedColumns();
        m_mappedColumns=mappedColumns;
        List<String> filterAliasNames=new ArrayList<String>();
        for (        String alias : mappedColumns.keySet()) {
          HBaseValueMeta column=mappedColumns.get(alias);
          String aliasS=column.getAlias();
          if (column.isNumeric() || column.isDate() || column.isString()|| column.isBoolean()) {
            filterAliasNames.add(aliasS);
          }
        }
        String[] filterAliasNamesA=filterAliasNames.toArray(new String[1]);
        m_filterAliasCI.setComboValues(filterAliasNamesA);
        filterAliasesDone=true;
      }
 catch (      Exception ex) {
        if (!quiet) {
          new ErrorDialog(shell,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str") + "String_Node_Str" + transMeta.environmentSubstitute(m_mappedTableNamesCombo.getText() + "String_Node_Str" + transMeta.environmentSubstitute(m_mappingNamesCombo.getText())+ "String_Node_Str"),ex);
          ex.printStackTrace();
        }
        m_keyInfo.setText(Messages.getString("String_Node_Str"));
      }
      m_fieldsView.clearAll(false);
      if (current != null && (readFieldsFromMapping || m_currentMeta.getOutputFields() == null || m_currentMeta.getOutputFields().size() == 0)) {
        TableItem item=new TableItem(m_fieldsView.table,SWT.NONE);
        item.setText(1,keyName);
        item.setText(2,"String_Node_Str");
        item.setText(7,"String_Node_Str");
        if (current.getKeyType() == Mapping.KeyType.DATE || current.getKeyType() == Mapping.KeyType.UNSIGNED_DATE) {
          item.setText(5,ValueMeta.getTypeDesc(ValueMetaInterface.TYPE_DATE));
        }
 else         if (current.getKeyType() == Mapping.KeyType.STRING) {
          item.setText(5,ValueMeta.getTypeDesc(ValueMetaInterface.TYPE_STRING));
        }
 else {
          item.setText(5,ValueMeta.getTypeDesc(ValueMetaInterface.TYPE_INTEGER));
        }
      }
      if (!readFieldsFromMapping && m_currentMeta.getOutputFields() != null && m_currentMeta.getOutputFields().size() > 0) {
        List<String> filterAliasNames=new ArrayList<String>();
        for (        HBaseValueMeta column : m_currentMeta.getOutputFields()) {
          TableItem item=new TableItem(m_fieldsView.table,SWT.NONE);
          String aliasS=column.getAlias();
          String type=column.getTypeDesc();
          item.setText(1,aliasS);
          item.setText(5,type);
          if (column.isKey()) {
            item.setText(2,"String_Node_Str");
            item.setText(7,"String_Node_Str");
            if (!Const.isEmpty(column.getConversionMask())) {
              item.setText(6,column.getConversionMask());
            }
            continue;
          }
          item.setText(2,"String_Node_Str");
          if (column.isNumeric() || column.isDate() || column.isString()) {
            if (!filterAliasesDone) {
              filterAliasNames.add(aliasS);
            }
          }
          String family=column.getColumnFamily();
          String name=column.getColumnName();
          String format=column.getConversionMask();
          if (column.getStorageType() == ValueMetaInterface.STORAGE_TYPE_INDEXED) {
            String valuesString=HBaseValueMeta.objectIndexValuesToString(column.getIndex());
            m_indexedLookup.put(aliasS,valuesString);
            item.setText(7,"String_Node_Str");
          }
 else {
            item.setText(7,"String_Node_Str");
          }
          item.setText(3,family);
          item.setText(4,name);
          if (!Const.isEmpty(format)) {
            item.setText(6,format);
          }
        }
        if (!filterAliasesDone) {
          String[] filterAliasNamesA=filterAliasNames.toArray(new String[1]);
          m_filterAliasCI.setComboValues(filterAliasNamesA);
          filterAliasesDone=true;
        }
      }
 else       if (current != null) {
        for (        String alias : mappedColumns.keySet()) {
          HBaseValueMeta column=mappedColumns.get(alias);
          String aliasS=column.getAlias();
          String family=column.getColumnFamily();
          String name=column.getColumnName();
          String type=column.getTypeDesc();
          String format=column.getConversionMask();
          TableItem item=new TableItem(m_fieldsView.table,SWT.NONE);
          if (column.getStorageType() == ValueMetaInterface.STORAGE_TYPE_INDEXED) {
            String valuesString=HBaseValueMeta.objectIndexValuesToString(column.getIndex());
            m_indexedLookup.put(aliasS,valuesString);
            item.setText(7,"String_Node_Str");
          }
 else {
            item.setText(7,"String_Node_Str");
          }
          item.setText(1,aliasS);
          item.setText(2,"String_Node_Str");
          item.setText(3,family);
          item.setText(4,name);
          item.setText(5,type);
          if (!Const.isEmpty(format)) {
            item.setText(6,format);
          }
        }
      }
      m_fieldsView.removeEmptyRows();
      m_fieldsView.setRowNums();
      m_fieldsView.optWidth(true);
    }
 catch (    Exception ex) {
      if (!quiet) {
        new ErrorDialog(shell,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str") + "String_Node_Str" + transMeta.environmentSubstitute(m_mappedTableNamesCombo.getText() + "String_Node_Str" + transMeta.environmentSubstitute(m_mappingNamesCombo.getText())+ "String_Node_Str"),ex);
      }
      m_keyInfo.setText(Messages.getString("String_Node_Str"));
      ex.printStackTrace();
    }
  }
 else {
    m_keyInfo.setText("String_Node_Str");
  }
}