Program: 20157
Project: 20157
Buggy source:
@Override public HistoricalWeather getHistoricalWeather(String data) throws WeatherLibException {
  HistoricalWeather histWeather=new HistoricalWeather();
  try {
    JSONObject jObj=new JSONObject(data);
    JSONObject histObj=jObj.getJSONObject("String_Node_Str");
    JSONArray wList=histObj.getJSONArray("String_Node_Str");
    for (int i=0; i < wList.length(); i++) {
      HistoricalHourWeather hhWeather=new HistoricalHourWeather();
      JSONObject jHour=wList.getJSONObject(i);
      JSONObject utcObj=jHour.getJSONObject("String_Node_Str");
      int y=utcObj.getInt("String_Node_Str");
      int m=utcObj.getInt("String_Node_Str");
      int mday=utcObj.getInt("String_Node_Str");
      int h=utcObj.getInt("String_Node_Str");
      int min=utcObj.getInt("String_Node_Str");
      Calendar cal=GregorianCalendar.getInstance();
      cal.set(y,Calendar.JANUARY,mday,h,min);
      cal.add(Calendar.MONTH,m - 1);
      hhWeather.timestamp=cal.getTimeInMillis();
      String tag=null;
      if (WeatherUtility.isMetric(config.unitSystem))       tag="String_Node_Str";
 else       tag="String_Node_Str";
      hhWeather.weather.temperature.setTemp((float)jHour.getDouble("String_Node_Str" + tag));
      hhWeather.weather.currentCondition.setDewPoint((float)jHour.getDouble("String_Node_Str" + tag));
      hhWeather.weather.currentCondition.setHumidity((float)jHour.getInt("String_Node_Str"));
      hhWeather.weather.wind.setSpeed((float)jHour.getDouble("String_Node_Str" + tag));
      hhWeather.weather.wind.setGust((float)jHour.getDouble("String_Node_Str" + tag));
      hhWeather.weather.wind.setDeg((float)jHour.getDouble("String_Node_Str"));
      hhWeather.weather.wind.setChill((float)jHour.getDouble("String_Node_Str" + tag));
      hhWeather.weather.currentCondition.setVisibility((float)jHour.getDouble("String_Node_Str" + tag));
      hhWeather.weather.currentCondition.setPressure((float)jHour.getDouble("String_Node_Str" + tag));
      hhWeather.weather.currentCondition.setHeatIndex(jHour.getString("String_Node_Str" + tag));
      hhWeather.weather.rain[0].setAmmount((float)jHour.getDouble("String_Node_Str" + tag));
      hhWeather.weather.currentCondition.setDescr(jHour.getString("String_Node_Str"));
      hhWeather.weather.currentCondition.setIcon(jHour.getString("String_Node_Str"));
      if (codeProvider != null)       hhWeather.weather.currentCondition.setWeatherCode(codeProvider.getWeatherCode(hhWeather.weather.currentCondition.getIcon()));
      histWeather.addHistoricalHourWeather(hhWeather);
    }
  }
 catch (  JSONException json) {
    throw new WeatherLibException(json);
  }
  histWeather.setUnit(units);
  return histWeather;
}

Fixed version (ground truth):
@Override public HistoricalWeather getHistoricalWeather(String data) throws WeatherLibException {
  HistoricalWeather histWeather=new HistoricalWeather();
  try {
    JSONObject jObj=new JSONObject(data);
    JSONObject histObj=jObj.getJSONObject("String_Node_Str");
    JSONArray wList=histObj.getJSONArray("String_Node_Str");
    for (int i=0; i < wList.length(); i++) {
      HistoricalHourWeather hhWeather=new HistoricalHourWeather();
      JSONObject jHour=wList.getJSONObject(i);
      JSONObject utcObj=jHour.getJSONObject("String_Node_Str");
      int y=utcObj.getInt("String_Node_Str");
      int m=utcObj.getInt("String_Node_Str");
      int mday=utcObj.getInt("String_Node_Str");
      int h=utcObj.getInt("String_Node_Str");
      int min=utcObj.getInt("String_Node_Str");
      Calendar cal=GregorianCalendar.getInstance();
      cal.set(y,Calendar.JANUARY,mday,h,min);
      cal.add(Calendar.MONTH,m - 1);
      hhWeather.timestamp=cal.getTimeInMillis();
      String tag=null;
      if (WeatherUtility.isMetric(config.unitSystem))       tag="String_Node_Str";
 else       tag="String_Node_Str";
      hhWeather.weather.temperature.setTemp((float)jHour.getDouble("String_Node_Str" + tag));
      hhWeather.weather.currentCondition.setDewPoint((float)jHour.getDouble("String_Node_Str" + tag));
      hhWeather.weather.currentCondition.setHumidity((float)jHour.getInt("String_Node_Str"));
      hhWeather.weather.wind.setSpeed((float)jHour.getDouble("String_Node_Str" + tag));
      hhWeather.weather.wind.setGust((float)jHour.getDouble("String_Node_Str" + tag));
      hhWeather.weather.wind.setDeg((float)jHour.getDouble("String_Node_Str"));
      hhWeather.weather.wind.setChill((float)jHour.getDouble("String_Node_Str" + tag));
      hhWeather.weather.currentCondition.setVisibility((float)jHour.getDouble("String_Node_Str" + tag));
      hhWeather.weather.currentCondition.setPressure((float)jHour.getDouble("String_Node_Str" + tag));
      hhWeather.weather.currentCondition.setHeatIndex(jHour.getString("String_Node_Str" + tag));
      hhWeather.weather.rain[0].setAmmount((float)jHour.getDouble("String_Node_Str" + tag));
      hhWeather.weather.currentCondition.setDescr(jHour.getString("String_Node_Str"));
      hhWeather.weather.currentCondition.setIcon(jHour.getString("String_Node_Str"));
      if (codeProvider != null) {
        try {
          hhWeather.weather.currentCondition.setWeatherCode(codeProvider.getWeatherCode(hhWeather.weather.currentCondition.getIcon()));
        }
 catch (        Throwable t) {
          hhWeather.weather.currentCondition.setWeatherCode(WeatherCode.NOT_AVAILABLE);
        }
      }
      histWeather.addHistoricalHourWeather(hhWeather);
    }
  }
 catch (  JSONException json) {
    throw new WeatherLibException(json);
  }
  histWeather.setUnit(units);
  return histWeather;
}