Program: 161529
Project: 161529
Buggy source:
/** 
 * Get all departures for a station. Cursor includes target station name, departure in remaining minutes.
 * @param stationID Station ID, station name might or might not work
 * @return List of departures
 */
public static List<Departure> getDeparturesFromExternal(Context context,String stationID){
  try {
    String language=LANGUAGE + Locale.getDefault().getLanguage();
    String departureQuery=DEPARTURE_QUERY_STATION + URLEncoder.encode(stationID,"String_Node_Str");
    String query=DEPARTURE_QUERY_CONST + language + '&'+ departureQuery;
    Utils.logv(query);
    NetUtils net=new NetUtils(context);
    List<Departure> result=new ArrayList<>();
    Optional<JSONArray> departures=net.downloadJsonArray(query,CacheManager.VALIDITY_DO_NOT_CACHE,true);
    if (!departures.isPresent()) {
      return result;
    }
    JSONArray arr=departures.get();
    for (int i=0; i < arr.length(); i++) {
      JSONObject departure=arr.getJSONObject(i);
      JSONObject servingLine=departure.getJSONObject("String_Node_Str");
      result.add(new Departure(servingLine.getString("String_Node_Str"),servingLine.getString("String_Node_Str"),String.format("String_Node_Str",servingLine.getString("String_Node_Str")).trim(),departure.getInt("String_Node_Str")));
    }
    Collections.sort(result,new Comparator<Departure>(){
      @Override public int compare(      Departure lhs,      Departure rhs){
        return lhs.countDown - rhs.countDown;
      }
    }
);
    return result;
  }
 catch (  UnsupportedEncodingException e) {
    throw new Error(e);
  }
catch (  JSONException e) {
    Utils.log(e,ERROR_INVALID_JSON + DEPARTURE_QUERY);
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Get all departures for a station. Cursor includes target station name, departure in remaining minutes.
 * @param stationID Station ID, station name might or might not work
 * @return List of departures
 */
public static List<Departure> getDeparturesFromExternal(Context context,String stationID){
  List<Departure> result=new ArrayList<>();
  try {
    String language=LANGUAGE + Locale.getDefault().getLanguage();
    String departureQuery=DEPARTURE_QUERY_STATION + URLEncoder.encode(stationID,"String_Node_Str");
    String query=DEPARTURE_QUERY_CONST + language + '&'+ departureQuery;
    Utils.logv(query);
    NetUtils net=new NetUtils(context);
    Optional<JSONObject> departures=net.downloadJson(query);
    if (!departures.isPresent()) {
      return result;
    }
    JSONArray arr=departures.get().getJSONArray("String_Node_Str");
    for (int i=0; i < arr.length(); i++) {
      JSONObject departure=arr.getJSONObject(i);
      JSONObject servingLine=departure.getJSONObject("String_Node_Str");
      result.add(new Departure(servingLine.getString("String_Node_Str"),servingLine.getString("String_Node_Str"),String.format("String_Node_Str",servingLine.getString("String_Node_Str")).trim(),departure.getInt("String_Node_Str")));
    }
    Collections.sort(result,new Comparator<Departure>(){
      @Override public int compare(      Departure lhs,      Departure rhs){
        return lhs.countDown - rhs.countDown;
      }
    }
);
  }
 catch (  UnsupportedEncodingException e) {
    throw new Error(e);
  }
catch (  JSONException e) {
    Utils.log(e,ERROR_INVALID_JSON + DEPARTURE_QUERY);
  }
  return result;
}