Program: 124977
Project: 124977
Buggy source:
protected HDFSConnectionBean getHDFSConnectionBean(){
  INode node=(INode)elem;
  boolean isMr=false;
  HDFSConnectionBean connectionBean=new HDFSConnectionBean();
  String useExistingConnection=ElementParameterParser.getValue(elem,"String_Node_Str");
  if ("String_Node_Str".equalsIgnoreCase(useExistingConnection)) {
    String connectionName=ElementParameterParser.getValue(node,"String_Node_Str");
    List<? extends INode> nodes=node.getProcess().getGeneratingNodes();
    for (    INode iNode : nodes) {
      if (iNode.getUniqueName().equals(connectionName)) {
        node=iNode;
        break;
      }
    }
  }
 else   if (node != null && node.getComponent() != null && node.getComponent().getPaletteType() != null && node.getComponent().getPaletteType().equals("String_Node_Str")) {
    List<? extends INode> nodes=node.getProcess().getGeneratingNodes();
    for (    INode iNode : nodes) {
      IComponent component=iNode.getComponent();
      if (component != null && component.getName() != null && component.getName().equals("String_Node_Str")) {
        node=iNode;
        if (node instanceof DataNode) {
          DataNode dataNode=(DataNode)node;
          IElementParameter versionParameter=dataNode.getElementParameter(EHadoopParameter.MR_VERSION.getName());
          if (versionParameter != null) {
            connectionBean.setDfVersion((String)versionParameter.getValue());
            isMr=true;
          }
          IElementParameter nameNodeParameter=dataNode.getElementParameter(EHadoopParameter.NAMENODE.getName());
          if (nameNodeParameter != null) {
            connectionBean.setNameNodeURI((String)nameNodeParameter.getValue());
            isMr=true;
          }
        }
      }
    }
  }
  String distribution=(String)getParameterValue(node,EHadoopParameter.DISTRIBUTION.getName());
  if (!isMr) {
    String version=(String)getParameterValue(node,EHadoopParameter.VERSION.getName());
    String nameNodeUri=(String)getParameterValue(node,EHadoopParameter.NAMENODE_URI.getName());
    connectionBean.setDfVersion(version);
    connectionBean.setNameNodeURI(nameNodeUri);
  }
  String userName=(String)getParameterValue(node,EHadoopParameter.USERNAME.getName());
  Boolean useKrb=(Boolean)getParameterValue(node,EHadoopParameter.USE_KRB.getName());
  String principal=(String)getParameterValue(node,EHadoopParameter.NAMENODE_PRINCIPAL.getName());
  String group=(String)getParameterValue(node,EHadoopParameter.GROUP.getName());
  connectionBean.setDistribution(distribution);
  connectionBean.setUserName(userName);
  connectionBean.setEnableKerberos(useKrb != null ? useKrb : false);
  connectionBean.setPrincipal(principal);
  connectionBean.setGroup(group);
  return connectionBean;
}

Fixed version (ground truth):
protected HDFSConnectionBean getHDFSConnectionBean(){
  INode node=(INode)elem;
  boolean isMr=false;
  HDFSConnectionBean connectionBean=new HDFSConnectionBean();
  String useExistingConnection=ElementParameterParser.getValue(elem,"String_Node_Str");
  if ("String_Node_Str".equalsIgnoreCase(useExistingConnection)) {
    String connectionName=ElementParameterParser.getValue(node,"String_Node_Str");
    List<? extends INode> nodes=node.getProcess().getGeneratingNodes();
    for (    INode iNode : nodes) {
      if (iNode.getUniqueName().equals(connectionName)) {
        node=iNode;
        break;
      }
    }
  }
 else   if (node != null && node.getComponent() != null && node.getComponent().getPaletteType() != null && node.getComponent().getPaletteType().equals("String_Node_Str")) {
    List<? extends INode> nodes=node.getProcess().getGeneratingNodes();
    for (    INode iNode : nodes) {
      IComponent component=iNode.getComponent();
      if (component != null && component.getName() != null && component.getName().equals("String_Node_Str")) {
        node=iNode;
        if (node instanceof DataNode) {
          DataNode dataNode=(DataNode)node;
          IElementParameter versionParameter=dataNode.getElementParameter(EHadoopParameter.MR_VERSION.getName());
          if (versionParameter != null) {
            connectionBean.setDfVersion((String)versionParameter.getValue());
            isMr=true;
          }
          IElementParameter nameNodeParameter=dataNode.getElementParameter(EHadoopParameter.NAMENODE.getName());
          if (nameNodeParameter != null) {
            connectionBean.setNameNodeURI((String)nameNodeParameter.getValue());
            isMr=true;
          }
        }
      }
    }
  }
  String distribution=(String)getParameterValue(node,EHadoopParameter.DISTRIBUTION.getName());
  if (!isMr) {
    String version=(String)getParameterValue(node,EHadoopParameter.VERSION.getName());
    String nameNodeUri=(String)getParameterValue(node,EHadoopParameter.NAMENODE_URI.getName());
    connectionBean.setDfVersion(version);
    connectionBean.setNameNodeURI(nameNodeUri);
  }
  EHadoopVersion4Drivers version4Drivers=EHadoopVersion4Drivers.indexOfByVersion(connectionBean.getDfVersion());
  if (HadoopServerUtil.isSupportGroup(version4Drivers)) {
    String group=(String)getParameterValue(node,EHadoopParameter.GROUP.getName());
    connectionBean.setGroup(group);
  }
  String userName=(String)getParameterValue(node,EHadoopParameter.USERNAME.getName());
  Boolean useKrb=(Boolean)getParameterValue(node,EHadoopParameter.USE_KRB.getName());
  String principal=(String)getParameterValue(node,EHadoopParameter.NAMENODE_PRINCIPAL.getName());
  connectionBean.setDistribution(distribution);
  connectionBean.setUserName(userName);
  connectionBean.setEnableKerberos(useKrb != null ? useKrb : false);
  connectionBean.setPrincipal(principal);
  return connectionBean;
}