Program: 19233
Project: 19233
Buggy source:
private void formatSingleComponent(){
  String strPlatform=this.getGlobalAttribute("String_Node_Str",null);
  ucar.nc2.Variable identVar;
  if (strPlatform != null) {
    identVar=this.getVariableByName(strPlatform);
  }
 else {
    identVar=this.stationVariable;
  }
  for (  Map.Entry<Integer,String> station : this.getStationNames().entrySet()) {
    network.addSmlComponent(station.getValue());
    network.addIdentifierToComponent(station.getValue(),"String_Node_Str",GetIoosDef("String_Node_Str"),this.procedure.substring(0,this.procedure.lastIndexOf("String_Node_Str")) + station.getValue());
    network.addIdentifierToComponent(station.getValue(),"String_Node_Str",GetIoosDef("String_Node_Str"),this.checkForRequiredValue(identVar,"String_Node_Str"));
    network.addIdentifierToComponent(station.getValue(),"String_Node_Str",GetIoosDef("String_Node_Str"),this.checkForRequiredValue(identVar,"String_Node_Str"));
    Attribute identAtt=identVar.findAttribute("String_Node_Str");
    if (identAtt != null) {
      network.addIdentifierToComponent(station.getValue(),"String_Node_Str",VocabDefinitions.GetIoosDefinition("String_Node_Str"),identAtt.getStringValue());
    }
    network.setComponentValidTime(station.getValue(),this.stationData.getTimeBegin(station.getKey()),this.stationData.getTimeEnd(station.getKey()));
    List<String> locations=this.stationData.getLocationsString(station.getKey());
    if (locations.size() > 1) {
      network.setComponentLocation(station.getValue(),"String_Node_Str",locations);
    }
 else     if (locations.size() > 0) {
      network.setComponentLocation(station.getValue(),"String_Node_Str",locations.get(0));
    }
 else {
      logger.error("String_Node_Str");
    }
    for (    VariableSimpleIF var : this.getDataVariables()) {
      String name=var.getShortName();
      String title=this.procedure.substring(0,this.procedure.lastIndexOf("String_Node_Str") + 1) + station.getValue() + "String_Node_Str"+ name.replaceAll("String_Node_Str","String_Node_Str");
      String def=VocabDefinitions.GetDefinitionForParameter(this.checkForRequiredValue(var,"String_Node_Str"));
      String units=this.checkForRequiredValue(var,"String_Node_Str");
      network.addComponentOutput(station.getValue(),name,title,def,this.featureType,units);
    }
  }
}

Fixed version (ground truth):
private void formatSingleComponent(){
  String strPlatform=this.getGlobalAttribute("String_Node_Str",null);
  ucar.nc2.Variable identVar;
  if (strPlatform != null) {
    identVar=this.getVariableByName(strPlatform);
  }
 else {
    identVar=this.stationVariable;
  }
  for (  Map.Entry<Integer,String> station : this.getStationNames().entrySet()) {
    network.addSmlComponent(station.getValue());
    network.addIdentifierToComponent(station.getValue(),"String_Node_Str",GetIoosDef("String_Node_Str"),this.procedure.substring(0,this.procedure.lastIndexOf("String_Node_Str")) + station.getValue());
    network.addIdentifierToComponent(station.getValue(),"String_Node_Str",GetIoosDef("String_Node_Str"),this.checkForRequiredValue(identVar,"String_Node_Str"));
    network.addIdentifierToComponent(station.getValue(),"String_Node_Str",GetIoosDef("String_Node_Str"),this.checkForRequiredValue(identVar,"String_Node_Str"));
    Attribute identAtt=identVar.findAttribute("String_Node_Str");
    if (identAtt != null) {
      network.addIdentifierToComponent(station.getValue(),"String_Node_Str",VocabDefinitions.GetIoosDefinition("String_Node_Str"),identAtt.getStringValue());
    }
    network.setComponentValidTime(station.getValue(),this.stationData.getTimeBegin(station.getKey()),this.stationData.getTimeEnd(station.getKey()));
    if (this.getGridDataset() == null) {
      List<String> locations=this.stationData.getLocationsString(station.getKey());
      if (locations.size() > 1) {
        network.setComponentLocation(station.getValue(),"String_Node_Str",locations);
      }
 else       if (locations.size() > 0) {
        network.setComponentLocation(station.getValue(),"String_Node_Str",locations.get(0));
      }
 else {
        logger.error("String_Node_Str");
      }
    }
 else {
      String lowerCorner=this.stationData.getLowerLat(station.getKey()) + "String_Node_Str" + this.stationData.getLowerLon(station.getKey());
      String upperCorner=this.stationData.getUpperLat(station.getKey()) + "String_Node_Str" + this.stationData.getUpperLon(station.getKey());
      network.setComponentLocation(station.getValue(),"String_Node_Str",lowerCorner,upperCorner);
    }
    for (    VariableSimpleIF var : this.getDataVariables()) {
      String name=var.getShortName();
      String title=this.procedure.substring(0,this.procedure.lastIndexOf("String_Node_Str") + 1) + station.getValue() + "String_Node_Str"+ name.replaceAll("String_Node_Str","String_Node_Str");
      String def=VocabDefinitions.GetDefinitionForParameter(this.checkForRequiredValue(var,"String_Node_Str"));
      String units=this.checkForRequiredValue(var,"String_Node_Str");
      network.addComponentOutput(station.getValue(),name,title,def,this.featureType,units);
    }
  }
}