nus-yam/ex-repair huggingface dataset:
Program: 8759
Project: 8759
Buggy source:
public void doFilter(ServletRequest servletRequest,ServletResponse response,FilterChain filterChain) throws IOException, ServletException {
  HttpServletRequest request=(HttpServletRequest)servletRequest;
  String simonName=getSimonName(request);
  Split split=SimonManager.getStopwatch(simonPrefix + Manager.HIERARCHY_DELIMITER + simonName).start();
  filterChain.doFilter(request,response);
  split.stop();
}

Fixed version (ground truth):
public void doFilter(ServletRequest servletRequest,ServletResponse response,FilterChain filterChain) throws IOException, ServletException {
  HttpServletRequest request=(HttpServletRequest)servletRequest;
  String simonName=getSimonName(request);
  Split split=SimonManager.getStopwatch(simonPrefix + Manager.HIERARCHY_DELIMITER + simonName).start();
  try {
    filterChain.doFilter(request,response);
  }
  finally {
    split.stop();
  }
}
Program: 8760
Project: 8760
Buggy source:
private void register(SimonSuperMXBean simonMxBean){
  String name=simonMxBean.getName() + "String_Node_Str" + simonMxBean.getType();
  try {
    ObjectName objectName=new ObjectName(name);
    if (mBeanServer.isRegistered(objectName)) {
      mBeanServer.unregisterMBean(objectName);
    }
 else {
      registeredNames.add(name);
    }
    mBeanServer.registerMBean(simonMxBean,objectName);
    message("String_Node_Str" + objectName);
  }
 catch (  JMException e) {
    warning("String_Node_Str" + name,e);
    registeredNames.remove(name);
  }
}

Fixed version (ground truth):
private void register(SimonSuperMXBean simonMxBean){
  String name=constructObjectName(simonMxBean);
  try {
    ObjectName objectName=new ObjectName(name);
    if (mBeanServer.isRegistered(objectName)) {
      mBeanServer.unregisterMBean(objectName);
    }
 else {
      registeredNames.add(name);
    }
    mBeanServer.registerMBean(simonMxBean,objectName);
    message("String_Node_Str" + objectName);
  }
 catch (  JMException e) {
    warning("String_Node_Str" + name,e);
    registeredNames.remove(name);
  }
}
Program: 8761
Project: 8761
Buggy source:
/** 
 * Returns timestamp in human readable form, yet condensed form "yyMMdd-HHmmss.SSS".
 * @param timestamp timestamp in millis
 * @return timestamp as a human readable string
 */
public static String presentTimestamp(long timestamp){
  return TIMESTAMP_FORMAT.format(new Date(timestamp));
}

Fixed version (ground truth):
/** 
 * Returns timestamp in human readable form, yet condensed form "yyMMdd-HHmmss.SSS".
 * @param timestamp timestamp in millis
 * @return timestamp as a human readable string
 */
public static String presentTimestamp(long timestamp){
  if (timestamp == 0) {
    return UNDEF_STRING;
  }
  return TIMESTAMP_FORMAT.format(new Date(timestamp));
}
Program: 8762
Project: 8762
Buggy source:
public void init(FilterConfig filterConfig) throws ServletException {
  simonPrefix=filterConfig.getInitParameter(INIT_PARAM_PREFIX);
  String publishManager=filterConfig.getInitParameter(INIT_PARAM_PUBLISH_MANAGER);
  if (publishManager != null) {
    filterConfig.getServletContext().setAttribute(publishManager,SimonManager.manager());
  }
}

Fixed version (ground truth):
public void init(FilterConfig filterConfig) throws ServletException {
  if (filterConfig.getInitParameter(INIT_PARAM_PREFIX) != null) {
    simonPrefix=filterConfig.getInitParameter(INIT_PARAM_PREFIX);
  }
  String publishManager=filterConfig.getInitParameter(INIT_PARAM_PUBLISH_MANAGER);
  if (publishManager != null) {
    filterConfig.getServletContext().setAttribute(publishManager,SimonManager.manager());
  }
}
Program: 8763
Project: 8763
Buggy source:
public void doFilter(ServletRequest servletRequest,ServletResponse response,FilterChain filterChain) throws IOException, ServletException {
  HttpServletRequest request=(HttpServletRequest)servletRequest;
  String simonName=getSimonName(request);
  Split split=SimonManager.getStopwatch(simonPrefix + Manager.HIERARCHY_DELIMITER + simonName).start();
  filterChain.doFilter(request,response);
  split.stop();
}

Fixed version (ground truth):
public void doFilter(ServletRequest servletRequest,ServletResponse response,FilterChain filterChain) throws IOException, ServletException {
  HttpServletRequest request=(HttpServletRequest)servletRequest;
  String simonName=getSimonName(request);
  Split split=SimonManager.getStopwatch(simonPrefix + Manager.HIERARCHY_DELIMITER + simonName).start();
  try {
    filterChain.doFilter(request,response);
  }
  finally {
    split.stop();
  }
}
Program: 8764
Project: 8764
Buggy source:
private void register(SimonSuperMXBean simonMxBean){
  String name=simonMxBean.getName() + "String_Node_Str" + simonMxBean.getType();
  try {
    ObjectName objectName=new ObjectName(name);
    if (mBeanServer.isRegistered(objectName)) {
      mBeanServer.unregisterMBean(objectName);
    }
 else {
      registeredNames.add(name);
    }
    mBeanServer.registerMBean(simonMxBean,objectName);
    message("String_Node_Str" + objectName);
  }
 catch (  JMException e) {
    warning("String_Node_Str" + name,e);
    registeredNames.remove(name);
  }
}

Fixed version (ground truth):
private void register(SimonSuperMXBean simonMxBean){
  String name=constructObjectName(simonMxBean);
  try {
    ObjectName objectName=new ObjectName(name);
    if (mBeanServer.isRegistered(objectName)) {
      mBeanServer.unregisterMBean(objectName);
    }
 else {
      registeredNames.add(name);
    }
    mBeanServer.registerMBean(simonMxBean,objectName);
    message("String_Node_Str" + objectName);
  }
 catch (  JMException e) {
    warning("String_Node_Str" + name,e);
    registeredNames.remove(name);
  }
}
Program: 8765
Project: 8765
Buggy source:
/** 
 * Returns timestamp in human readable form, yet condensed form "yyMMdd-HHmmss.SSS".
 * @param timestamp timestamp in millis
 * @return timestamp as a human readable string
 */
public static String presentTimestamp(long timestamp){
  return TIMESTAMP_FORMAT.format(new Date(timestamp));
}

Fixed version (ground truth):
/** 
 * Returns timestamp in human readable form, yet condensed form "yyMMdd-HHmmss.SSS".
 * @param timestamp timestamp in millis
 * @return timestamp as a human readable string
 */
public static String presentTimestamp(long timestamp){
  if (timestamp == 0) {
    return UNDEF_STRING;
  }
  return TIMESTAMP_FORMAT.format(new Date(timestamp));
}
Program: 8766
Project: 8766
Buggy source:
/** 
 * Class constructor. It loads well known driver list from resource file drivers.properties.
 */
public Driver(){
  try {
    drivers.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("String_Node_Str"));
  }
 catch (  IOException e) {
  }
}

Fixed version (ground truth):
/** 
 * Class constructor. It loads well known driver list from resource file drivers.properties.
 */
public Driver(){
  try {
    InputStream stream=null;
    try {
      stream=Thread.currentThread().getContextClassLoader().getResourceAsStream("String_Node_Str");
      drivers.load(stream);
    }
  finally {
      if (stream != null) {
        stream.close();
      }
    }
  }
 catch (  IOException e) {
  }
}
Program: 8767
Project: 8767
Buggy source:
/** 
 * Opens new Simon proxy driver connection associated with real connection to specified database.
 * @param url jdbc connection string (i.e. jdbc:simon:h2:file:test)
 * @param info properties for connection
 * @return open connection to database or null if provided url is not accepted by this driver
 * @throws SQLException if there is no real driver registered/recognized or opening real connection fails
 * @see org.javasimon.jdbc.Driver
 */
public Connection connect(String url,Properties info) throws SQLException {
  if (!acceptsURL(url)) {
    return null;
  }
  String realUrl=url.replaceFirst(SIMON_JDBC,"String_Node_Str");
  java.sql.Driver driver=getRealDriver(realUrl,info);
  return new org.javasimon.jdbc.Connection(driver.connect(realUrl,info),DEFAULT_PREFIX);
}

Fixed version (ground truth):
/** 
 * Opens new Simon proxy driver connection associated with real connection to specified database.
 * @param url	jdbc connection string (i.e. jdbc:simon:h2:file:test)
 * @param info properties for connection
 * @return open connection to database or null if provided url is not accepted by this driver
 * @throws SQLException if there is no real driver registered/recognized or opening real connection fails
 * @see org.javasimon.jdbc.Driver
 */
public Connection connect(String url,Properties info) throws SQLException {
  if (!acceptsURL(url)) {
    return null;
  }
  String realUrl=url.replaceFirst(SIMON_JDBC,"String_Node_Str");
  java.sql.Driver driver=getRealDriver(realUrl,info);
  return new org.javasimon.jdbc.Connection(driver.connect(realUrl,info),DEFAULT_PREFIX);
}
Program: 8768
Project: 8768
Buggy source:
private static void printSimon(int level,Simon simon){
  for (int i=0; i < level; i++) {
    System.out.print("String_Node_Str");
  }
  System.out.println(localName(simon.getName()) + "String_Node_Str" + (simon.isEnabled() ? '+' : '-')+ "String_Node_Str"+ simon);
}

Fixed version (ground truth):
private static void printSimon(int level,Simon simon,StringBuilder sb){
  for (int i=0; i < level; i++) {
    sb.append("String_Node_Str");
  }
  sb.append(localName(simon.getName())).append('(').append(simon.isEnabled() ? '+' : '-').append("String_Node_Str").append(simon.toString()).append('\n');
}
Program: 8769
Project: 8769
Buggy source:
private static void printSimonTree(int level,Simon simon){
  printSimon(level,simon);
  for (  Simon child : simon.getChildren()) {
    printSimonTree(level + 1,child);
  }
}

Fixed version (ground truth):
private static void printSimonTree(int level,Simon simon,StringBuilder sb){
  printSimon(level,simon,sb);
  for (  Simon child : simon.getChildren()) {
    printSimonTree(level + 1,child,sb);
  }
}
Program: 8770
Project: 8770
Buggy source:
/** 
 * Class constructor. It loads well known driver list from resource file drivers.properties.
 */
public Driver(){
  try {
    drivers.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("String_Node_Str"));
  }
 catch (  IOException e) {
  }
}

Fixed version (ground truth):
/** 
 * Class constructor. It loads well known driver list from resource file drivers.properties.
 */
public Driver(){
  try {
    InputStream stream=null;
    try {
      stream=Thread.currentThread().getContextClassLoader().getResourceAsStream("String_Node_Str");
      drivers.load(stream);
    }
  finally {
      if (stream != null) {
        stream.close();
      }
    }
  }
 catch (  IOException e) {
  }
}
Program: 8771
Project: 8771
Buggy source:
/** 
 * Opens new Simon proxy driver connection associated with real connection to specified database.
 * @param url jdbc connection string (i.e. jdbc:simon:h2:file:test)
 * @param info properties for connection
 * @return open connection to database or null if provided url is not accepted by this driver
 * @throws SQLException if there is no real driver registered/recognized or opening real connection fails
 * @see org.javasimon.jdbc.Driver
 */
public Connection connect(String url,Properties info) throws SQLException {
  if (!acceptsURL(url)) {
    return null;
  }
  String realUrl=url.replaceFirst(SIMON_JDBC,"String_Node_Str");
  java.sql.Driver driver=getRealDriver(realUrl,info);
  return new org.javasimon.jdbc.Connection(driver.connect(realUrl,info),DEFAULT_PREFIX);
}

Fixed version (ground truth):
/** 
 * Opens new Simon proxy driver connection associated with real connection to specified database.
 * @param url	jdbc connection string (i.e. jdbc:simon:h2:file:test)
 * @param info properties for connection
 * @return open connection to database or null if provided url is not accepted by this driver
 * @throws SQLException if there is no real driver registered/recognized or opening real connection fails
 * @see org.javasimon.jdbc.Driver
 */
public Connection connect(String url,Properties info) throws SQLException {
  if (!acceptsURL(url)) {
    return null;
  }
  String realUrl=url.replaceFirst(SIMON_JDBC,"String_Node_Str");
  java.sql.Driver driver=getRealDriver(realUrl,info);
  return new org.javasimon.jdbc.Connection(driver.connect(realUrl,info),DEFAULT_PREFIX);
}
Program: 8772
Project: 8772
Buggy source:
private static void printSimon(int level,Simon simon){
  for (int i=0; i < level; i++) {
    System.out.print("String_Node_Str");
  }
  System.out.println(localName(simon.getName()) + "String_Node_Str" + (simon.isEnabled() ? '+' : '-')+ "String_Node_Str"+ simon);
}

Fixed version (ground truth):
private static void printSimon(int level,Simon simon,StringBuilder sb){
  for (int i=0; i < level; i++) {
    sb.append("String_Node_Str");
  }
  sb.append(localName(simon.getName())).append('(').append(simon.isEnabled() ? '+' : '-').append("String_Node_Str").append(simon.toString()).append('\n');
}
Program: 8773
Project: 8773
Buggy source:
private static void printSimonTree(int level,Simon simon){
  printSimon(level,simon);
  for (  Simon child : simon.getChildren()) {
    printSimonTree(level + 1,child);
  }
}

Fixed version (ground truth):
private static void printSimonTree(int level,Simon simon,StringBuilder sb){
  printSimon(level,simon,sb);
  for (  Simon child : simon.getChildren()) {
    printSimonTree(level + 1,child,sb);
  }
}
Program: 8774
Project: 8774
Buggy source:
private java.sql.Driver getRealDriver(String url,Properties info) throws SQLException {
  java.sql.Driver drv=null;
  try {
    drv=DriverManager.getDriver(url);
  }
 catch (  SQLException e) {
  }
  if (drv == null && info != null && info.keySet().contains(REAL_DRIVER)) {
    drv=registerDriver(info.getProperty(REAL_DRIVER));
  }
  int i=url.indexOf(':',5);
  if (drv == null && i > -1) {
    drv=registerDriver(drivers.getProperty(url.substring(5,i - 1)));
  }
  if (drv == null) {
    Pattern re=Pattern.compile("String_Node_Str" + REAL_DRIVER + "String_Node_Str");
    Matcher matcher=re.matcher(url);
    if (matcher.lookingAt()) {
      drv=registerDriver(matcher.group(1).trim());
    }
  }
  if (drv == null) {
    throw new SQLException("String_Node_Str");
  }
  return drv;
}

Fixed version (ground truth):
private java.sql.Driver getRealDriver(String url,Properties info) throws SQLException {
  java.sql.Driver drv=null;
  try {
    drv=DriverManager.getDriver(url);
  }
 catch (  SQLException e) {
  }
  if (drv == null && info != null && info.keySet().contains(REAL_DRIVER)) {
    drv=registerDriver(info.getProperty(REAL_DRIVER));
  }
  int i=url.indexOf(':',5);
  if (drv == null && i > -1) {
    drv=registerDriver(drivers.getProperty(url.substring(5,i - 1)));
  }
  if (drv == null) {
    Matcher matcher=REAL_DRIVER_PATTERN.matcher(url);
    if (matcher.find()) {
      drv=registerDriver(matcher.group(1));
    }
  }
  if (drv == null) {
    throw new SQLException("String_Node_Str");
  }
  return drv;
}
Program: 8775
Project: 8775
Buggy source:
private java.sql.Driver getRealDriver(String url,Properties info) throws SQLException {
  java.sql.Driver drv=null;
  try {
    drv=DriverManager.getDriver(url);
  }
 catch (  SQLException e) {
  }
  if (drv == null && info != null && info.keySet().contains(REAL_DRIVER)) {
    drv=registerDriver(info.getProperty(REAL_DRIVER));
  }
  int i=url.indexOf(':',5);
  if (drv == null && i > -1) {
    drv=registerDriver(drivers.getProperty(url.substring(5,i - 1)));
  }
  if (drv == null) {
    Pattern re=Pattern.compile("String_Node_Str" + REAL_DRIVER + "String_Node_Str");
    Matcher matcher=re.matcher(url);
    if (matcher.lookingAt()) {
      drv=registerDriver(matcher.group(1).trim());
    }
  }
  if (drv == null) {
    throw new SQLException("String_Node_Str");
  }
  return drv;
}

Fixed version (ground truth):
private java.sql.Driver getRealDriver(String url,Properties info) throws SQLException {
  java.sql.Driver drv=null;
  try {
    drv=DriverManager.getDriver(url);
  }
 catch (  SQLException e) {
  }
  if (drv == null && info != null && info.keySet().contains(REAL_DRIVER)) {
    drv=registerDriver(info.getProperty(REAL_DRIVER));
  }
  int i=url.indexOf(':',5);
  if (drv == null && i > -1) {
    drv=registerDriver(drivers.getProperty(url.substring(5,i - 1)));
  }
  if (drv == null) {
    Matcher matcher=REAL_DRIVER_PATTERN.matcher(url);
    if (matcher.find()) {
      drv=registerDriver(matcher.group(1));
    }
  }
  if (drv == null) {
    throw new SQLException("String_Node_Str");
  }
  return drv;
}
Program: 8777
Project: 8777
Buggy source:
public static Alerts convertToNewAlert(JSONArray alertJSONArray,String language) throws JSONException {
  ArrayList<Alert> alertLists=new ArrayList<Alert>();
  Alerts alerts=new Alerts();
  for (int i=0; i < alertJSONArray.length(); ++i) {
    JSONObject jsonObject=alertJSONArray.getJSONObject(i);
    Alerts.Alert alert=new Alerts.Alert();
    alert.setAbnormal(jsonObject.getString("String_Node_Str"));
    alert.setDetail(jsonObject.getString("String_Node_Str"));
    alert.setHoliday(jsonObject.getString("String_Node_Str"));
    alert.setLevel(jsonObject.getString("String_Node_Str"));
    alert.setPubTime(Long.valueOf(jsonObject.getLong("String_Node_Str")));
    alert.setTitle(jsonObject.getString("String_Node_Str"));
    alertLists.add(alert);
  }
  alerts.setPid(language);
  alerts.setArryAlert(alertLists);
  return alerts;
}

Fixed version (ground truth):
public static Alerts convertToNewAlert(JSONArray alertJSONArray,String language){
  ArrayList<Alert> alertLists=new ArrayList<Alert>();
  Alerts alerts=new Alerts();
  try {
    for (int i=0; i < alertJSONArray.length(); ++i) {
      JSONObject jsonObject=alertJSONArray.getJSONObject(i);
      Alerts.Alert alert=new Alerts.Alert();
      alert.setAbnormal(jsonObject.getString("String_Node_Str"));
      alert.setDetail(jsonObject.getString("String_Node_Str"));
      alert.setHoliday(jsonObject.getString("String_Node_Str"));
      alert.setLevel(jsonObject.getString("String_Node_Str"));
      alert.setPubTime(Long.valueOf(jsonObject.getLong("String_Node_Str")));
      alert.setTitle(jsonObject.getString("String_Node_Str"));
      alertLists.add(alert);
    }
    alerts.setPid(language);
    alerts.setArryAlert(alertLists);
  }
 catch (  JSONException e) {
    e.printStackTrace();
  }
  return alerts;
}
Program: 8778
Project: 8778
Buggy source:
public static AQI convertToNewAQI(JSONObject aqiJSONObject,String language,String pid) throws JSONException {
  AQI aqi=new AQI();
  aqi.setCity_code(pid);
  aqi.setPub_time(getAQITime(aqiJSONObject.getString("String_Node_Str")));
  int aqiValue=WeatherUtilities.getAqi(aqiJSONObject.getString("String_Node_Str"));
  aqi.setAqi(aqiValue);
  aqi.setPm25(WeatherUtilities.getAqi(aqiJSONObject.getString("String_Node_Str")));
  aqi.setPm10(WeatherUtilities.getAqi(aqiJSONObject.getString("String_Node_Str")));
  aqi.setNo2(WeatherUtilities.getAqi(aqiJSONObject.getString("String_Node_Str")));
  aqi.setSo2(WeatherUtilities.getAqi(aqiJSONObject.getString("String_Node_Str")));
  aqi.setCo(WeatherConstants.NO_VALUE_FLAG);
  aqi.setO3(WeatherConstants.NO_VALUE_FLAG);
  aqi.setAqi_level(WeatherUtilities.getAqiLevel(aqiValue,language));
  aqi.setAqi_desc(WeatherUtilities.getAqiDesc(aqiValue,language));
  aqi.setSource(WeatherUtilities.getAQISource(language));
  aqi.setSpot(aqiJSONObject.getString("String_Node_Str"));
  return aqi;
}

Fixed version (ground truth):
public static AQI convertToNewAQI(JSONObject aqiJSONObject,String language,String pid){
  AQI aqi=new AQI();
  aqi.setCity_code(pid);
  try {
    aqi.setPub_time(getAQITime(aqiJSONObject.getString("String_Node_Str")));
    int aqiValue=WeatherUtilities.getAqi(aqiJSONObject.getString("String_Node_Str"));
    aqi.setAqi(aqiValue);
    aqi.setPm25(WeatherUtilities.getAqi(aqiJSONObject.getString("String_Node_Str")));
    aqi.setPm10(WeatherUtilities.getAqi(aqiJSONObject.getString("String_Node_Str")));
    aqi.setNo2(WeatherUtilities.getAqi(aqiJSONObject.getString("String_Node_Str")));
    aqi.setSo2(WeatherUtilities.getAqi(aqiJSONObject.getString("String_Node_Str")));
    aqi.setCo(WeatherConstants.NO_VALUE_FLAG);
    aqi.setO3(WeatherConstants.NO_VALUE_FLAG);
    aqi.setAqi_level(WeatherUtilities.getAqiLevel(aqiValue,language));
    aqi.setAqi_desc(WeatherUtilities.getAqiDesc(aqiValue,language));
    aqi.setSource(WeatherUtilities.getAQISource(language));
    aqi.setSpot(aqiJSONObject.getString("String_Node_Str"));
  }
 catch (  JSONException e) {
    e.printStackTrace();
  }
  return aqi;
}
Program: 8779
Project: 8779
Buggy source:
private static long parseTime(String timeStr){
  String[] times=timeStr.split("String_Node_Str");
  int hour=Integer.parseInt(times[0]);
  int minute=Integer.parseInt(times[1]);
  Long localTime=Calendar.getInstance().getTimeInMillis();
  if (hour - Calendar.getInstance().get(11) > 2)   localTime=Long.valueOf(localTime.longValue() - 24 * 60 * 60* 1000L);
  Calendar calendar=Calendar.getInstance();
  calendar.setTimeInMillis(localTime.longValue());
  calendar.set(11,hour);
  calendar.set(12,minute);
  return calendar.getTimeInMillis();
}

Fixed version (ground truth):
private static long parseTime(String timeStr){
  SimpleDateFormat simpleDateFormat=new SimpleDateFormat("String_Node_Str");
  String data=simpleDateFormat.format(new Date(System.currentTimeMillis()));
  timeStr=data + "String_Node_Str" + timeStr;
  long realTime=getAQITime(timeStr);
  Log.i("String_Node_Str","String_Node_Str" + timeStr + "String_Node_Str"+ realTime);
  return realTime;
}
Program: 8780
Project: 8780
Buggy source:
@Override public View getView(int position,View convertView,ViewGroup parent){
  int itemType=getItemViewType(position);
  if (convertView == null || !convertView.getTag().equals(R.drawable.ic_launcher + itemType)) {
    final WeakReference<WeatherBaseView> weakFragment=mWeatherBaseViews.get(itemType);
    if (weakFragment != null && weakFragment.get() != null) {
      convertView=weakFragment.get();
    }
 else {
switch (itemType) {
case FORECAST_TYPE:
        convertView=(WeatherBaseView)mLayoutInflater.inflate(R.layout.weather_forecast,parent,false);
      break;
case WEATHER_DETAILS_TYPE:
    convertView=(WeatherBaseView)mLayoutInflater.inflate(R.layout.weather_details,parent,false);
  break;
case AQI_TYPE:
convertView=(WeatherBaseView)mLayoutInflater.inflate(R.layout.weather_aqi,parent,false);
break;
case INDEX_TYPE:
convertView=(WeatherBaseView)mLayoutInflater.inflate(R.layout.weather_index,parent,false);
break;
default :
break;
}
mWeatherBaseViews.put(itemType,new WeakReference<WeatherBaseView>((WeatherBaseView)convertView));
}
convertView.setTag(R.drawable.ic_launcher + itemType);
}
if (convertView instanceof WeatherBaseView && !WeatherSpider.isEmpty(mWeatherInfo)) {
WeatherBaseView baseView=(WeatherBaseView)convertView;
baseView.setWeatherInfo(mWeatherInfo);
return baseView;
}
return convertView;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,ViewGroup parent){
  int itemType=getItemViewType(position);
  if (convertView == null || !convertView.getTag().equals(R.drawable.ic_launcher + itemType)) {
    final WeatherBaseView weakFragment=mWeatherBaseViews.get(itemType);
    if (weakFragment != null) {
      Log.i("String_Node_Str","String_Node_Str" + "String_Node_Str" + weakFragment);
      convertView=weakFragment;
    }
 else {
switch (itemType) {
case FORECAST_TYPE:
        convertView=(WeatherBaseView)mLayoutInflater.inflate(R.layout.weather_forecast,parent,false);
      break;
case WEATHER_DETAILS_TYPE:
    convertView=(WeatherBaseView)mLayoutInflater.inflate(R.layout.weather_details,parent,false);
  break;
case AQI_TYPE:
convertView=(WeatherBaseView)mLayoutInflater.inflate(R.layout.weather_aqi,parent,false);
break;
case INDEX_TYPE:
convertView=(WeatherBaseView)mLayoutInflater.inflate(R.layout.weather_index,parent,false);
break;
default :
break;
}
mWeatherBaseViews.put(itemType,(WeatherBaseView)convertView);
}
convertView.setTag(R.drawable.ic_launcher + itemType);
}
if (convertView instanceof WeatherBaseView && !WeatherSpider.isEmpty(mWeatherInfo)) {
WeatherBaseView baseView=(WeatherBaseView)convertView;
baseView.setWeatherInfo(mWeatherInfo);
return baseView;
}
return convertView;
}
Program: 8781
Project: 8781
Buggy source:
/** 
 * 初始化所有的view
 * @param view
 */
private void initViews(View view,Bundle savedInstanceState){
  mSwipeRefreshLayout=(SwipeRefreshLayout)view.findViewById(R.id.swiperefresh);
  mSwipeRefreshLayout.setOnRefreshListener(this);
  mListView=(ListView)view.findViewById(R.id.drag_list);
  mWeatherAdapter=new WeatherListAdapter(getActivity());
  mListView.setAdapter(mWeatherAdapter);
  mNormalImageView=(ImageView)view.findViewById(R.id.weather_background);
  mBlurredImageView=(ImageView)view.findViewById(R.id.weather_background_blurred);
  if (savedInstanceState != null) {
    float alpha=savedInstanceState.getFloat(ALPHA_KEY);
    mBlurredImageView.setAlpha(alpha);
  }
 else {
    mBlurredImageView.setAlpha(0f);
  }
  mListHeaderView=LayoutInflater.from(getActivity()).inflate(R.layout.weather_current_condition,null);
  int displayHeight=SystemUtils.getDisplayHeight(getActivity());
  mHeaderHeight=displayHeight - getResources().getDimensionPixelSize(R.dimen.abs__action_bar_default_height);
  mListHeaderView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,mHeaderHeight));
  mListView.addHeaderView(mListHeaderView,null,false);
  mListView.setOnScrollListener(mOnScrollListener);
  initCurWeatherViews(view);
}

Fixed version (ground truth):
/** 
 * 初始化所有的view
 * @param view
 */
private void initViews(View view,Bundle savedInstanceState){
  mSwipeRefreshLayout=(SwipeRefreshLayout)view.findViewById(R.id.swiperefresh);
  mSwipeRefreshLayout.setOnRefreshListener(this);
  mListView=(ListView)view.findViewById(R.id.drag_list);
  mNormalImageView=(ImageView)view.findViewById(R.id.weather_background);
  mBlurredImageView=(ImageView)view.findViewById(R.id.weather_background_blurred);
  if (savedInstanceState != null) {
    float alpha=savedInstanceState.getFloat(ALPHA_KEY);
    mBlurredImageView.setAlpha(alpha);
  }
 else {
    mBlurredImageView.setAlpha(0f);
  }
  mListHeaderView=LayoutInflater.from(getActivity()).inflate(R.layout.weather_current_condition,null);
  int displayHeight=SystemUtils.getDisplayHeight(getActivity());
  mHeaderHeight=displayHeight - getResources().getDimensionPixelSize(R.dimen.abs__action_bar_default_height);
  mListHeaderView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,mHeaderHeight));
  mListView.addHeaderView(mListHeaderView,null,false);
  mWeatherAdapter=new WeatherListAdapter(getActivity());
  mListView.setAdapter(mWeatherAdapter);
  mListView.setOnScrollListener(mOnScrollListener);
  initCurWeatherViews(view);
}
Program: 8782
Project: 8782
Buggy source:
@Override public WeatherInfo workInBackground(Boolean... params) throws TaskException {
  boolean isForce=params[0];
  WeatherInfo weatherInfo=null;
  if (isNeedRequestNet() || isForce) {
    try {
      weatherInfo=loadWeatherInfoFromNetwork();
    }
 catch (    Exception e) {
    }
    if (WeatherSpider.isEmpty(weatherInfo)) {
      weatherInfo=loadWeatherInfoFromLocal();
      weatherInfo.setNewData(false);
    }
 else {
      weatherInfo.setNewData(true);
    }
  }
 else {
    weatherInfo=loadWeatherInfoFromLocal();
  }
  if (WeatherSpider.isEmpty(weatherInfo))   weatherInfo=loadWeatherInfoFromLocal();
  return weatherInfo;
}

Fixed version (ground truth):
@Override public WeatherInfo workInBackground(Boolean... params) throws TaskException {
  mWeatherAdapter.initViews();
  boolean isForce=params[0];
  WeatherInfo weatherInfo=null;
  if (isNeedRequestNet() || isForce) {
    try {
      weatherInfo=loadWeatherInfoFromNetwork();
    }
 catch (    Exception e) {
    }
    if (WeatherSpider.isEmpty(weatherInfo)) {
      weatherInfo=loadWeatherInfoFromLocal();
      weatherInfo.setNewData(false);
    }
 else {
      weatherInfo.setNewData(true);
    }
  }
 else {
    weatherInfo=loadWeatherInfoFromLocal();
  }
  if (WeatherSpider.isEmpty(weatherInfo))   weatherInfo=loadWeatherInfoFromLocal();
  return weatherInfo;
}
Program: 8783
Project: 8783
Buggy source:
public static WeatherInfo getWeatherInfo(Context context,String postID,String result) throws JSONException {
  String language=context.getResources().getConfiguration().locale.toString();
  JSONObject response=new JSONObject(result);
  Forecast forecast=WeatherController.convertToNewForecast(response,language,postID);
  RealTime realTime=WeatherController.convertToNewRealTime(response.getJSONObject("String_Node_Str"),language,postID);
  Alerts alerts=WeatherController.convertToNewAlert(response.getJSONArray("String_Node_Str"),postID);
  Index index=WeatherController.convertToNewIndex(response,language,postID);
  AQI aqi=WeatherController.convertToNewAQI(response.getJSONObject("String_Node_Str"),language,postID);
  return new WeatherInfo(realTime,forecast,aqi,index,alerts);
}

Fixed version (ground truth):
public static WeatherInfo getWeatherInfo(Context context,String postID,String result) throws JSONException {
  String language=context.getResources().getConfiguration().locale.toString();
  JSONObject response=new JSONObject(TextUtils.isEmpty(result) ? "String_Node_Str" : result);
  Forecast forecast=WeatherController.convertToNewForecast(response,language,postID);
  RealTime realTime=WeatherController.convertToNewRealTime(response.getJSONObject("String_Node_Str"),language,postID);
  Alerts alerts=WeatherController.convertToNewAlert(response.getJSONArray("String_Node_Str"),postID);
  Index index=WeatherController.convertToNewIndex(response,language,postID);
  AQI aqi=WeatherController.convertToNewAQI(response.getJSONObject("String_Node_Str"),language,postID);
  return new WeatherInfo(realTime,forecast,aqi,index,alerts);
}
Program: 8784
Project: 8784
Buggy source:
/** 
 * 根据  {@link ABaseTask} 的加载状态，刷新视图
 * @param state
 * @param tag
 */
protected void taskStateChanged(ABaseTaskState state,Serializable tag){
  if (state == ABaseTaskState.prepare) {
    mHandler.removeCallbacks(startRefreshAnim);
    mHandler.postDelayed(startRefreshAnim,200);
  }
 else   if (state == ABaseTaskState.success) {
    mHandler.removeCallbacks(stopRefreshAnim);
    mHandler.postDelayed(stopRefreshAnim,500);
  }
 else   if (state == ABaseTaskState.canceled) {
    mHandler.removeCallbacks(stopRefreshAnim);
    mHandler.postDelayed(stopRefreshAnim,500);
  }
 else   if (state == ABaseTaskState.falid) {
    mHandler.removeCallbacks(stopRefreshAnim);
    mHandler.postDelayed(stopRefreshAnim,500);
  }
 else   if (state == ABaseTaskState.finished) {
    mHandler.removeCallbacks(stopRefreshAnim);
    mHandler.postDelayed(stopRefreshAnim,500);
  }
}

Fixed version (ground truth):
/** 
 * 根据  {@link ABaseTask} 的加载状态，刷新视图
 * @param state
 * @param tag
 */
protected void taskStateChanged(ABaseTaskState state,Serializable tag){
  if (state == ABaseTaskState.prepare) {
    mHandler.removeCallbacks(startRefreshAnim);
    mHandler.postDelayed(startRefreshAnim,200);
  }
 else   if (state == ABaseTaskState.success) {
    mHandler.removeCallbacks(stopRefreshAnim);
    mHandler.postDelayed(stopRefreshAnim,500);
  }
 else   if (state == ABaseTaskState.canceled) {
    mHandler.removeCallbacks(stopRefreshAnim);
    mHandler.postDelayed(stopRefreshAnim,500);
  }
 else   if (state == ABaseTaskState.falid) {
    Toast.makeText(mActivity,"String_Node_Str" + tag,Toast.LENGTH_SHORT).show();
    mHandler.removeCallbacks(stopRefreshAnim);
    mHandler.postDelayed(stopRefreshAnim,500);
  }
 else   if (state == ABaseTaskState.finished) {
    mHandler.removeCallbacks(stopRefreshAnim);
    mHandler.postDelayed(stopRefreshAnim,500);
  }
}
Program: 8785
Project: 8785
Buggy source:
/** 
 * 更新天气信息界面
 */
private void updateWeatherView(WeatherInfo weatherInfo){
  if (WeatherSpider.isEmpty(weatherInfo)) {
    Toast.makeText(mActivity,"String_Node_Str",Toast.LENGTH_SHORT).show();
    return;
  }
  if (!isVisible)   return;
  isLoaded=true;
  Toast.makeText(mActivity,mCurCity.getName() + "String_Node_Str",Toast.LENGTH_SHORT).show();
  RealTime realTime=weatherInfo.getRealTime();
  AQI aqi=weatherInfo.getAqi();
  Forecast forecast=weatherInfo.getForecast();
  Index index=weatherInfo.getIndex();
  int type=realTime.getAnimation_type();
  Glide.with(this).load(WeatherIconUtils.getWeatherNromalBg(type)).placeholder(R.drawable.bg_na_blur).error(R.drawable.bg_na).into(mNormalImageView);
  Glide.with(this).load(WeatherIconUtils.getWeatherBlurBg(type)).placeholder(R.drawable.bg_na_blur).error(R.drawable.bg_na_blur).into(mBlurredImageView);
  mCurWeatherIV.setImageResource(WeatherIconUtils.getWeatherIcon(type));
  mCurWeatherTV.setText(realTime.getWeather_name());
  mCurFeelsTempTV.setText(realTime.getTemp() + "String_Node_Str");
  mCurHighTempTV.setText(forecast.getTmpHigh(1) + "String_Node_Str");
  mCurLowTempTV.setText(forecast.getTmpLow(1) + "String_Node_Str");
  mCurWeatherCopyTV.setText(TimeUtils.getDay(realTime.getPub_time()) + "String_Node_Str");
  mWeatherAdapter=new WeatherListAdapter(getActivity());
  mListView.setAdapter(mWeatherAdapter);
  mWeatherAdapter.setWeather(realTime,aqi,forecast,index);
}

Fixed version (ground truth):
/** 
 * 更新天气信息界面
 */
private void updateWeatherView(WeatherInfo weatherInfo){
  if (WeatherSpider.isEmpty(weatherInfo)) {
    Toast.makeText(mActivity,"String_Node_Str",Toast.LENGTH_SHORT).show();
    return;
  }
  if (!isVisible)   return;
  isLoaded=true;
  if (weatherInfo.isNewData())   Toast.makeText(mActivity,mCurCity.getName() + "String_Node_Str",Toast.LENGTH_SHORT).show();
  RealTime realTime=weatherInfo.getRealTime();
  AQI aqi=weatherInfo.getAqi();
  Forecast forecast=weatherInfo.getForecast();
  Index index=weatherInfo.getIndex();
  int type=realTime.getAnimation_type();
  mNormalImageView.setImageResource(WeatherIconUtils.getWeatherNromalBg(type));
  mBlurredImageView.setImageResource(WeatherIconUtils.getWeatherBlurBg(type));
  mCurWeatherIV.setImageResource(WeatherIconUtils.getWeatherIcon(type));
  mCurWeatherTV.setText(realTime.getWeather_name());
  mCurFeelsTempTV.setText(realTime.getTemp() + "String_Node_Str");
  mCurHighTempTV.setText(forecast.getTmpHigh(1) + "String_Node_Str");
  mCurLowTempTV.setText(forecast.getTmpLow(1) + "String_Node_Str");
  mCurWeatherCopyTV.setText(TimeUtils.getDay(realTime.getPub_time()) + "String_Node_Str");
  mWeatherAdapter=new WeatherListAdapter(getActivity());
  mListView.setAdapter(mWeatherAdapter);
  mWeatherAdapter.setWeather(realTime,aqi,forecast,index);
}
Program: 8786
Project: 8786
Buggy source:
@Override public WeatherInfo workInBackground(Boolean... params) throws TaskException {
  boolean isForce=params[0];
  WeatherInfo weatherInfo=null;
  if (isNeedRequestNet() || isForce) {
    weatherInfo=loadWeatherInfoFromNetwork();
  }
 else {
    weatherInfo=loadWeatherInfoFromLocal();
  }
  return weatherInfo;
}

Fixed version (ground truth):
@Override public WeatherInfo workInBackground(Boolean... params) throws TaskException {
  boolean isForce=params[0];
  WeatherInfo weatherInfo=null;
  if (isNeedRequestNet() || isForce) {
    try {
      weatherInfo=loadWeatherInfoFromNetwork();
    }
 catch (    Exception e) {
    }
    if (WeatherSpider.isEmpty(weatherInfo)) {
      weatherInfo=loadWeatherInfoFromLocal();
      weatherInfo.setNewData(false);
    }
 else {
      weatherInfo.setNewData(true);
    }
  }
 else {
    weatherInfo=loadWeatherInfoFromLocal();
  }
  if (WeatherSpider.isEmpty(weatherInfo))   weatherInfo=loadWeatherInfoFromLocal();
  return weatherInfo;
}
Program: 8787
Project: 8787
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + realTime + "String_Node_Str"+ forecast+ "String_Node_Str"+ aqi+ "String_Node_Str"+ index+ "String_Node_Str"+ alerts+ "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + isNewData + "String_Node_Str"+ realTime+ "String_Node_Str"+ forecast+ "String_Node_Str"+ aqi+ "String_Node_Str"+ index+ "String_Node_Str"+ alerts+ "String_Node_Str";
}
Program: 8788
Project: 8788
Buggy source:
@Override public Fragment getItem(int position){
  ItemInfo info=mItemInfos.get(position);
  if (info.fragment == null) {
    info.fragment=new WeatherFragment(mActivity,info.city);
  }
  return info.fragment;
}

Fixed version (ground truth):
@Override public Fragment getItem(int position){
  ItemInfo info=mItemInfos.get(position);
  if (info.fragment == null) {
    info.fragment=WeatherFragment.newInstance(info.city);
  }
  return info.fragment;
}
Program: 8789
Project: 8789
Buggy source:
public WeatherPagerAdapter(BaseActivity activity){
  super(activity.getFragmentManager());
  this.mActivity=activity;
  mItemInfos=new ArrayList<ItemInfo>();
}

Fixed version (ground truth):
public WeatherPagerAdapter(BaseActivity activity){
  super(activity.getFragmentManager());
  mItemInfos=new ArrayList<ItemInfo>();
}
Program: 8790
Project: 8790
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mContentResolver=getActivity().getContentResolver();
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mActivity=(MainActivity)getActivity();
  mContentResolver=getActivity().getContentResolver();
}
Program: 8791
Project: 8791
Buggy source:
private void loadWeatherInfoFromLocal(){
  if (mCurCity == null)   return;
  try {
    mWeatherInfo=WeatherSpider.getWeatherInfo(mActivity,mCurCity.getPostID(),mCurCity.getWeatherInfoStr());
    if (!WeatherSpider.isEmpty(mWeatherInfo)) {
      updateWeatherView();
    }
  }
 catch (  JSONException e) {
    e.printStackTrace();
  }
catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void loadWeatherInfoFromLocal(){
  if (mCurCity == null)   return;
  if (isVisible && !mPullRefreshScrollView.isRefreshing())   mPullRefreshScrollView.setRefreshing();
  try {
    mWeatherInfo=WeatherSpider.getWeatherInfo(mActivity,mCurCity.getPostID(),mCurCity.getWeatherInfoStr());
    if (!WeatherSpider.isEmpty(mWeatherInfo)) {
      updateWeatherView();
    }
  }
 catch (  JSONException e) {
    e.printStackTrace();
  }
catch (  Exception e) {
    e.printStackTrace();
  }
  if (isVisible && mPullRefreshScrollView.isRefreshing())   mPullRefreshScrollView.onRefreshComplete();
}
Program: 8792
Project: 8792
Buggy source:
@Override public void onDestroyView(){
  super.onDestroyView();
  if (isNeedDestroy()) {
    mRootView=null;
    isVisible=false;
    isPrepared=false;
    isLoaded=false;
    mAsynState=AsynTaskState.INIT;
  }
}

Fixed version (ground truth):
@Override public void onDestroyView(){
  super.onDestroyView();
  Log.i("String_Node_Str","String_Node_Str" + "String_Node_Str" + mCurCity.getName());
  if (isNeedDestroy()) {
    mRootView=null;
    isVisible=false;
    isPrepared=false;
    isLoaded=false;
  }
  mAsynState=AsynTaskState.INIT;
}
Program: 8794
Project: 8794
Buggy source:
public WeatherFragment(BaseActivity activity,City city){
  mActivity=activity;
  mCurCity=city;
}

Fixed version (ground truth):
public WeatherFragment(){
}
Program: 8795
Project: 8795
Buggy source:
/** 
 * 在Fragment可见时进行判断是否载入数据
 */
private void onLoadedData(){
  if (!isPrepared)   return;
  if (isLoaded) {
    updateWeatherView();
  }
 else {
switch (mAsynState) {
case INIT:
      if (isNeedRequestNet()) {
        mAsynState=AsynTaskState.PROCESSING;
        getWeather(mCurCity.getPostID());
        if (mPullRefreshScrollView.getState() != State.MANUAL_REFRESHING)         mPullRefreshScrollView.setRefreshing();
      }
 else {
        loadWeatherInfoFromLocal();
      }
    break;
case PROCESSING:
  if (mPullRefreshScrollView.getState() != State.MANUAL_REFRESHING)   mPullRefreshScrollView.setRefreshing();
break;
case RPOCESSED:
if (mPullRefreshScrollView.getState() != State.MANUAL_REFRESHING) mPullRefreshScrollView.setRefreshing();
break;
case COMPLETE:
updateWeatherView();
break;
}
}
}

Fixed version (ground truth):
/** 
 * 在Fragment可见时进行判断是否载入数据
 */
private void onLoadedData(){
  mCurCity=getArguments().getParcelable(ARG_CITY);
  Log.i("String_Node_Str","String_Node_Str" + "String_Node_Str" + mCurCity.getName() + "String_Node_Str"+ isLoaded+ "String_Node_Str"+ mAsynState+ "String_Node_Str"+ isPrepared+ "String_Node_Str"+ isVisible);
  if (!isPrepared)   return;
  if (isLoaded) {
    updateWeatherView();
  }
 else {
switch (mAsynState) {
case INIT:
      if (isNeedRequestNet()) {
        getWeather(mCurCity.getPostID());
      }
 else {
        loadWeatherInfoFromLocal();
      }
    break;
case PROCESSING:
case RPOCESSED:
  if (!mPullRefreshScrollView.isRefreshing())   mPullRefreshScrollView.setRefreshing();
break;
case COMPLETE:
updateWeatherView();
break;
}
}
}
Program: 8796
Project: 8796
Buggy source:
@Override public void onResponse(String response){
  mAsynState=AsynTaskState.RPOCESSED;
  mPullRefreshScrollView.onRefreshComplete();
  try {
    WeatherInfo weatherInfo=WeatherSpider.getWeatherInfo(mActivity,postID,response);
    if (!WeatherSpider.isEmpty(weatherInfo)) {
      mWeatherInfo=weatherInfo;
      isLoaded=true;
      if (getActivity() != null)       Toast.makeText(getActivity(),"String_Node_Str" + mCurCity.getName(),Toast.LENGTH_SHORT).show();
      save2Database(postID,response);
      updateWeatherView();
    }
 else {
      if (getActivity() != null)       Toast.makeText(getActivity(),"String_Node_Str" + mCurCity.getName(),Toast.LENGTH_SHORT).show();
    }
  }
 catch (  JSONException e) {
    e.printStackTrace();
    if (getActivity() != null)     Toast.makeText(getActivity(),"String_Node_Str" + mCurCity.getName(),Toast.LENGTH_SHORT).show();
  }
  mAsynState=AsynTaskState.COMPLETE;
}

Fixed version (ground truth):
@Override public void onResponse(String response){
  mAsynState=AsynTaskState.RPOCESSED;
  if (mPullRefreshScrollView.isRefreshing())   mPullRefreshScrollView.onRefreshComplete();
  try {
    WeatherInfo weatherInfo=WeatherSpider.getWeatherInfo(mActivity,postID,response);
    if (!WeatherSpider.isEmpty(weatherInfo)) {
      mWeatherInfo=weatherInfo;
      isLoaded=true;
      if (getActivity() != null)       Toast.makeText(getActivity(),"String_Node_Str" + mCurCity.getName(),Toast.LENGTH_SHORT).show();
      save2Database(postID,response);
      updateWeatherView();
    }
 else {
      if (getActivity() != null)       Toast.makeText(getActivity(),"String_Node_Str" + mCurCity.getName(),Toast.LENGTH_SHORT).show();
    }
  }
 catch (  JSONException e) {
    e.printStackTrace();
    if (getActivity() != null)     Toast.makeText(getActivity(),"String_Node_Str" + mCurCity.getName(),Toast.LENGTH_SHORT).show();
  }
  mAsynState=AsynTaskState.COMPLETE;
}
Program: 8797
Project: 8797
Buggy source:
/** 
 * 更新天气信息界面
 */
private void updateWeatherView(){
  WeatherInfo weatherInfo=mWeatherInfo;
  if (WeatherSpider.isEmpty(weatherInfo)) {
    return;
  }
  RealTime realTime=weatherInfo.getRealTime();
  AQI aqi=weatherInfo.getAqi();
  Forecast forecast=weatherInfo.getForecast();
  Index index=weatherInfo.getIndex();
  int type=realTime.getAnimation_type();
  mNormalImageView.setImageResource(WeatherIconUtils.getWeatherNromalBg(type));
  mBlurredImageView.setImageResource(WeatherIconUtils.getWeatherBlurBg(type));
  mCurWeatherIV.setImageResource(WeatherIconUtils.getWeatherIcon(type));
  mCurWeatherTV.setText(realTime.getWeather_name());
  mCurFeelsTempTV.setText(realTime.getTemp() + "String_Node_Str");
  mCurHighTempTV.setText(forecast.getTmpHigh(1) + "String_Node_Str");
  mCurLowTempTV.setText(forecast.getTmpLow(1) + "String_Node_Str");
  mCurWeatherCopyTV.setText(TimeUtils.getDay(realTime.getPub_time()) + "String_Node_Str");
  mWeatherAdapter.setWeather(realTime,aqi,forecast,index);
}

Fixed version (ground truth):
/** 
 * 更新天气信息界面
 */
private void updateWeatherView(){
  WeatherInfo weatherInfo=mWeatherInfo;
  if (WeatherSpider.isEmpty(weatherInfo)) {
    return;
  }
  RealTime realTime=weatherInfo.getRealTime();
  AQI aqi=weatherInfo.getAqi();
  Forecast forecast=weatherInfo.getForecast();
  Index index=weatherInfo.getIndex();
  int type=realTime.getAnimation_type();
  mNormalImageView.setImageBitmap(SystemUtils.readBitMap(mActivity,WeatherIconUtils.getRawNromalBg(type)));
  mBlurredImageView.setImageBitmap(SystemUtils.readBitMap(mActivity,WeatherIconUtils.getRawBlurBg(type)));
  mCurWeatherIV.setImageResource(WeatherIconUtils.getWeatherIcon(type));
  mCurWeatherTV.setText(realTime.getWeather_name());
  mCurFeelsTempTV.setText(realTime.getTemp() + "String_Node_Str");
  mCurHighTempTV.setText(forecast.getTmpHigh(1) + "String_Node_Str");
  mCurLowTempTV.setText(forecast.getTmpLow(1) + "String_Node_Str");
  mCurWeatherCopyTV.setText(TimeUtils.getDay(realTime.getPub_time()) + "String_Node_Str");
  mWeatherAdapter.setWeather(realTime,aqi,forecast,index);
}
Program: 8798
Project: 8798
Buggy source:
private boolean isNeedRequestNet(){
  int netState=NetUtil.getNetworkState(getActivity());
  if (netState == NetUtil.NETWORN_NONE) {
    return false;
  }
  long refreshTime=getRefreshTime();
  if (netState == NetUtil.NETWORN_WIFI) {
    return ((System.currentTimeMillis() - refreshTime) > (1000 * 60 * 30));
  }
  if (netState == NetUtil.NETWORN_MOBILE) {
    return ((System.currentTimeMillis() - refreshTime) > (1000 * 60 * 60* 2));
  }
  return false;
}

Fixed version (ground truth):
private boolean isNeedRequestNet(){
  int netState=NetUtil.getNetworkState(getActivity());
  if (netState == NetUtil.NETWORN_NONE) {
    return false;
  }
  long refreshTime=getRefreshTime();
  Log.i("String_Node_Str","String_Node_Str" + mCurCity.getName() + "String_Node_Str"+ refreshTime+ "String_Node_Str"+ (System.currentTimeMillis() - refreshTime) / (1000 * 60) + "String_Node_Str");
  if (netState == NetUtil.NETWORN_WIFI) {
    return ((System.currentTimeMillis() - refreshTime) > (1000 * 60 * 30));
  }
  if (netState == NetUtil.NETWORN_MOBILE) {
    return ((System.currentTimeMillis() - refreshTime) > (1000 * 60 * 60* 2));
  }
  return false;
}
Program: 8799
Project: 8799
Buggy source:
/** 
 * 不提供覆写，需监听可见性的子类可覆写  {@link #onFragmentVisible()}和  {@link #onFragmentInvisible()}方法
 * @param isVisibleToUser 当前Fragment的可见性
 */
@Override public final void setUserVisibleHint(boolean isVisibleToUser){
  super.setUserVisibleHint(isVisibleToUser);
  isVisible=isVisibleToUser;
  if (getUserVisibleHint()) {
    onLoadedData();
  }
 else {
  }
}

Fixed version (ground truth):
/** 
 * 不提供覆写，需监听可见性的子类可覆写  {@link #onFragmentVisible()}和  {@link #onFragmentInvisible()}方法
 * @param isVisibleToUser 当前Fragment的可见性
 */
@Override public final void setUserVisibleHint(boolean isVisibleToUser){
  super.setUserVisibleHint(isVisibleToUser);
  isVisible=isVisibleToUser;
  if (getUserVisibleHint()) {
    onLoadedData();
  }
 else {
    if (mPullRefreshScrollView != null && mPullRefreshScrollView.isRefreshing())     mPullRefreshScrollView.onRefreshComplete();
  }
}
Program: 8800
Project: 8800
Buggy source:
/** 
 * 更新背景模糊度和移动距离
 * @param scrollPosition
 */
private void onNewScroll(int scrollPosition){
  if (scrollPosition == 0) {
    mPullRefreshScrollView.setMode(Mode.PULL_FROM_START);
  }
 else {
    if (mPullRefreshScrollView.getState() == State.RESET) {
      mPullRefreshScrollView.setMode(Mode.DISABLED);
    }
 else     if (scrollPosition > mHeaderHeight / 2) {
      mPullRefreshScrollView.onRefreshComplete();
      App.getVolleyRequestQueue().cancelAll(mCurCity.getPostID());
    }
  }
  float ratio=Math.min(1.5f * (-mListHeaderView.getTop()) / mHeaderHeight,1.0f);
  mBlurredImageView.setAlpha(ratio);
  int dampedScroll=Math.round(scrollPosition * 0.125f);
  int offset=mLastDampedScroll - dampedScroll;
  mBlurredImageView.offsetTopAndBottom(offset);
  mNormalImageView.offsetTopAndBottom(offset);
  mLastDampedScroll=dampedScroll;
}

Fixed version (ground truth):
/** 
 * 更新背景模糊度和移动距离
 * @param scrollPosition
 */
private void onNewScroll(int scrollPosition){
  if (scrollPosition == 0) {
    mPullRefreshScrollView.setMode(Mode.PULL_FROM_START);
  }
 else {
    if (mPullRefreshScrollView.getState() == State.RESET) {
      mPullRefreshScrollView.setMode(Mode.DISABLED);
    }
 else     if (scrollPosition > mHeaderHeight / 2) {
      if (mPullRefreshScrollView.isRefreshing()) {
        mPullRefreshScrollView.onRefreshComplete();
        App.getVolleyRequestQueue().cancelAll(mCurCity.getPostID());
      }
    }
  }
  float ratio=Math.min(1.5f * (-mListHeaderView.getTop()) / mHeaderHeight,1.0f);
  mBlurredImageView.setAlpha(ratio);
  int dampedScroll=Math.round(scrollPosition * 0.125f);
  int offset=mLastDampedScroll - dampedScroll;
  mBlurredImageView.offsetTopAndBottom(offset);
  mNormalImageView.offsetTopAndBottom(offset);
  mLastDampedScroll=dampedScroll;
}