Program: 58460
Project: 58460
Buggy source:
public void viewDirection(ActionRequest request,ActionResponse response){
  try {
    Company company=AuthUtils.getUser().getActiveCompany();
    if (company == null) {
      response.setFlash(I18n.get(IExceptionMessage.PRODUCT_NO_ACTIVE_COMPANY));
      return;
    }
    Address departureAddress=company.getAddress();
    if (departureAddress == null) {
      response.setFlash(I18n.get(IExceptionMessage.ADDRESS_7));
      return;
    }
    if (appBaseService.getAppBase().getMapApiSelect() != AppBaseRepository.MAP_API_GOOGLE) {
      response.setFlash(I18n.get(IExceptionMessage.ADDRESS_6));
      return;
    }
    departureAddress=addressService.checkLatLang(departureAddress,false);
    BigDecimal dLat=departureAddress.getLatit();
    BigDecimal dLon=departureAddress.getLongit();
    BigDecimal zero=BigDecimal.ZERO;
    if (zero.compareTo(dLat) == 0 || zero.compareTo(dLon) == 0) {
      response.setFlash(String.format(I18n.get(IExceptionMessage.ADDRESS_5),departureAddress.getFullName()));
      return;
    }
    Address arrivalAddress=request.getContext().asType(Address.class);
    arrivalAddress=addressService.checkLatLang(arrivalAddress,false);
    BigDecimal aLat=arrivalAddress.getLatit();
    BigDecimal aLon=arrivalAddress.getLongit();
    if (zero.compareTo(aLat) == 0 || zero.compareTo(aLon) == 0) {
      response.setFlash(String.format(I18n.get(IExceptionMessage.ADDRESS_5),arrivalAddress.getFullName()));
      return;
    }
    Map<String,Object> mapView=new HashMap<String,Object>();
    mapView.put("String_Node_Str","String_Node_Str");
    mapView.put("String_Node_Str",Beans.get(MapService.class).getDirectionUrl(dLat,dLon,aLat,aLon));
    mapView.put("String_Node_Str","String_Node_Str");
    response.setView(mapView);
    response.setReload(true);
  }
 catch (  Exception e) {
    TraceBackService.trace(response,e);
  }
}

Fixed version (ground truth):
public void viewDirection(ActionRequest request,ActionResponse response){
  try {
    MapService mapService=Beans.get(MapService.class);
    String key=mapService.getGoogleMapsApiKey();
    Company company=AuthUtils.getUser().getActiveCompany();
    if (company == null) {
      response.setFlash(I18n.get(IExceptionMessage.PRODUCT_NO_ACTIVE_COMPANY));
      return;
    }
    Address departureAddress=company.getAddress();
    if (departureAddress == null) {
      response.setFlash(I18n.get(IExceptionMessage.ADDRESS_7));
      return;
    }
    if (appBaseService.getAppBase().getMapApiSelect() != AppBaseRepository.MAP_API_GOOGLE) {
      response.setFlash(I18n.get(IExceptionMessage.ADDRESS_6));
      return;
    }
    departureAddress=addressService.checkLatLang(departureAddress,false);
    BigDecimal dLat=departureAddress.getLatit();
    BigDecimal dLon=departureAddress.getLongit();
    BigDecimal zero=BigDecimal.ZERO;
    if (zero.compareTo(dLat) == 0 || zero.compareTo(dLon) == 0) {
      response.setFlash(String.format(I18n.get(IExceptionMessage.ADDRESS_5),departureAddress.getFullName()));
      return;
    }
    Address arrivalAddress=request.getContext().asType(Address.class);
    arrivalAddress=addressService.checkLatLang(arrivalAddress,false);
    BigDecimal aLat=arrivalAddress.getLatit();
    BigDecimal aLon=arrivalAddress.getLongit();
    if (zero.compareTo(aLat) == 0 || zero.compareTo(aLon) == 0) {
      response.setFlash(String.format(I18n.get(IExceptionMessage.ADDRESS_5),arrivalAddress.getFullName()));
      return;
    }
    Map<String,Object> mapView=new HashMap<String,Object>();
    mapView.put("String_Node_Str","String_Node_Str");
    mapView.put("String_Node_Str",mapService.getDirectionUrl(key,dLat,dLon,aLat,aLon));
    mapView.put("String_Node_Str","String_Node_Str");
    response.setView(mapView);
    response.setReload(true);
  }
 catch (  Exception e) {
    TraceBackService.trace(response,e);
  }
}