Program: 121092
Project: 121092
Buggy source:
protected void initConnectionParameters(){
  connParameters=null;
  connParameters=new ConnectionParameters();
  String type=getValueFromRepositoryName(elem,"String_Node_Str");
  if (type.equals("String_Node_Str") || type.contains("String_Node_Str")) {
    IElementParameter ele=elem.getElementParameter("String_Node_Str");
    if (ele != null) {
      type=(String)ele.getValue();
    }
 else {
      type="String_Node_Str";
    }
  }
 else   if (EDatabaseTypeName.HIVE.getProduct().equalsIgnoreCase(type)) {
    if (EDatabaseVersion4Drivers.HIVE_EMBEDDED.getVersionValue().equals(elem.getElementParameter("String_Node_Str").getValue())) {
      setSpecialParamsForHiveEmbedded(elem);
    }
  }
  if (type.equals(EDatabaseTypeName.HSQLDB.name()) && getValueFromRepositoryName(elem,"String_Node_Str").equals("String_Node_Str")) {
    type=EDatabaseTypeName.HSQLDB_IN_PROGRESS.getDisplayName();
  }
  connParameters.setDbType(type);
  String driverName=getValueFromRepositoryName(elem,"String_Node_Str");
  String dbVersionName=EDatabaseVersion4Drivers.getDbVersionName(type,driverName);
  if (EDatabaseTypeName.HIVE.getProduct().equalsIgnoreCase(type)) {
    if (EDatabaseVersion4Drivers.HIVE_EMBEDDED.getVersionValue().equals(elem.getElementParameter("String_Node_Str").getValue())) {
      connParameters.setDbVersion(EDatabaseVersion4Drivers.HIVE_EMBEDDED.getVersionValue());
    }
 else {
      connParameters.setDbVersion(EDatabaseVersion4Drivers.HIVE.getVersionValue());
    }
  }
 else {
    connParameters.setDbVersion(dbVersionName);
  }
  connParameters.setNode(elem);
  String selectedComponentName=(String)elem.getPropertyValue(EParameterName.UNIQUE_NAME.getName());
  connParameters.setSelectedComponentName(selectedComponentName);
  connParameters.setFieldType(paramFieldType);
  if (elem instanceof Node) {
    connParameters.setMetadataTable(((Node)elem).getMetadataList().get(0));
  }
  connParameters.setSchemaRepository(EmfComponent.REPOSITORY.equals(elem.getPropertyValue(EParameterName.SCHEMA_TYPE.getName())));
  connParameters.setFromDBNode(true);
  connParameters.setQuery("String_Node_Str");
  List<? extends IElementParameter> list=elem.getElementParameters();
  boolean end=false;
  for (int i=0; i < list.size() && !end; i++) {
    IElementParameter param=list.get(i);
    if (param.getFieldType() == EParameterFieldType.MEMO_SQL) {
      connParameters.setNodeReadOnly(param.isReadOnly());
      end=true;
    }
  }
  Object value=elem.getPropertyValue("String_Node_Str");
  IElementParameter compList=elem.getElementParameterFromField(EParameterFieldType.COMPONENT_LIST);
  if (value != null && (value instanceof Boolean) && ((Boolean)value) && compList != null && !isConnectionExist()) {
    Object compValue=compList.getValue();
    if (compValue != null && !compValue.equals("String_Node_Str")) {
      List<? extends INode> nodes=part.getProcess().getGraphicalNodes();
      for (      INode node : nodes) {
        if (node.getUniqueName().equals(compValue) && (node instanceof Node)) {
          connectionNode=node;
          break;
        }
      }
      if (connectionNode != null) {
        setAllConnectionParameters(type,connectionNode);
      }
    }
  }
 else {
    setAllConnectionParameters(null,elem);
  }
  if (connectionNode != null) {
    setConnectionParameterNames(connectionNode,connParameters);
  }
 else {
    setConnectionParameterNames(elem,connParameters);
  }
}

Fixed version (ground truth):
protected void initConnectionParameters(){
  connParameters=null;
  connParameters=new ConnectionParameters();
  String type=getValueFromRepositoryName(elem,"String_Node_Str");
  if (type.equals("String_Node_Str") || type.contains("String_Node_Str")) {
    IElementParameter ele=elem.getElementParameter("String_Node_Str");
    if (ele != null) {
      type=(String)ele.getValue();
    }
 else {
      type="String_Node_Str";
    }
  }
 else   if (EDatabaseTypeName.HIVE.getProduct().equalsIgnoreCase(type)) {
    setSpecialParamsForHiveEmbedded(elem);
  }
  if (type.equals(EDatabaseTypeName.HSQLDB.name()) && getValueFromRepositoryName(elem,"String_Node_Str").equals("String_Node_Str")) {
    type=EDatabaseTypeName.HSQLDB_IN_PROGRESS.getDisplayName();
  }
  connParameters.setDbType(type);
  String driverName=getValueFromRepositoryName(elem,"String_Node_Str");
  String dbVersionName=EDatabaseVersion4Drivers.getDbVersionName(type,driverName);
  if (EDatabaseTypeName.HIVE.getProduct().equalsIgnoreCase(type)) {
    if (EDatabaseVersion4Drivers.HIVE_EMBEDDED.getVersionValue().equals(elem.getElementParameter("String_Node_Str").getValue())) {
      connParameters.setDbVersion(EDatabaseVersion4Drivers.HIVE_EMBEDDED.getVersionValue());
    }
 else {
      connParameters.setDbVersion(EDatabaseVersion4Drivers.HIVE.getVersionValue());
    }
  }
 else {
    connParameters.setDbVersion(dbVersionName);
  }
  connParameters.setNode(elem);
  String selectedComponentName=(String)elem.getPropertyValue(EParameterName.UNIQUE_NAME.getName());
  connParameters.setSelectedComponentName(selectedComponentName);
  connParameters.setFieldType(paramFieldType);
  if (elem instanceof Node) {
    connParameters.setMetadataTable(((Node)elem).getMetadataList().get(0));
  }
  connParameters.setSchemaRepository(EmfComponent.REPOSITORY.equals(elem.getPropertyValue(EParameterName.SCHEMA_TYPE.getName())));
  connParameters.setFromDBNode(true);
  connParameters.setQuery("String_Node_Str");
  List<? extends IElementParameter> list=elem.getElementParameters();
  boolean end=false;
  for (int i=0; i < list.size() && !end; i++) {
    IElementParameter param=list.get(i);
    if (param.getFieldType() == EParameterFieldType.MEMO_SQL) {
      connParameters.setNodeReadOnly(param.isReadOnly());
      end=true;
    }
  }
  Object value=elem.getPropertyValue("String_Node_Str");
  IElementParameter compList=elem.getElementParameterFromField(EParameterFieldType.COMPONENT_LIST);
  if (value != null && (value instanceof Boolean) && ((Boolean)value) && compList != null && !isConnectionExist()) {
    Object compValue=compList.getValue();
    if (compValue != null && !compValue.equals("String_Node_Str")) {
      List<? extends INode> nodes=part.getProcess().getGraphicalNodes();
      for (      INode node : nodes) {
        if (node.getUniqueName().equals(compValue) && (node instanceof Node)) {
          connectionNode=node;
          break;
        }
      }
      if (connectionNode != null) {
        setAllConnectionParameters(type,connectionNode);
      }
    }
  }
 else {
    setAllConnectionParameters(null,elem);
  }
  if (connectionNode != null) {
    setConnectionParameterNames(connectionNode,connParameters);
  }
 else {
    setConnectionParameterNames(elem,connParameters);
  }
}