Program: 15657
Project: 15657
Buggy source:
public void setLocale(Locale locale){
  Locale prevLocale=getLocale();
  super.setLocale(locale);
  if (!locale.equals(prevLocale)) {
    cachedNumberFormats=null;
    cachedNumberFormat=null;
    if (cachedTimeFormat != null && cachedTimeFormat.isLocaleBound()) {
      cachedTimeFormat=null;
    }
    if (cachedTimeFormatSysDefTZ != null && cachedTimeFormatSysDefTZ.isLocaleBound()) {
      cachedTimeFormatSysDefTZ=null;
    }
    if (cachedDateFormat != null && cachedDateFormat.isLocaleBound()) {
      cachedDateFormat=null;
    }
    if (cachedDateFormatSysDefTZ != null && cachedDateFormatSysDefTZ.isLocaleBound()) {
      cachedDateFormatSysDefTZ=null;
    }
    if (cachedDateTimeFormat != null && cachedDateTimeFormat.isLocaleBound()) {
      cachedDateTimeFormat=null;
    }
    if (cachedDateTimeFormatSysDefTZ != null && cachedDateTimeFormatSysDefTZ.isLocaleBound()) {
      cachedDateTimeFormatSysDefTZ=null;
    }
    if (cachedXSTemplateDateFormatFactory != null && cachedXSTemplateDateFormatFactory.isLocaleBound()) {
      cachedXSTemplateDateFormatFactory=null;
    }
    if (cachedXSTemplateDateFormatFactorySysDefTZ != null && cachedXSTemplateDateFormatFactorySysDefTZ.isLocaleBound()) {
      cachedXSTemplateDateFormatFactorySysDefTZ=null;
    }
    if (cachedISOTemplateDateFormatFactory != null && cachedISOTemplateDateFormatFactory.isLocaleBound()) {
      cachedISOTemplateDateFormatFactory=null;
    }
    if (cachedISOTemplateDateFormatFactorySysDefTZ != null && cachedISOTemplateDateFormatFactorySysDefTZ.isLocaleBound()) {
      cachedISOTemplateDateFormatFactorySysDefTZ=null;
    }
    if (cachedJavaTemplateDateFormatFactory != null && cachedJavaTemplateDateFormatFactory.isLocaleBound()) {
      cachedJavaTemplateDateFormatFactory=null;
    }
    if (cachedJavaTemplateDateFormatFactorySysDefTZ != null && cachedJavaTemplateDateFormatFactorySysDefTZ.isLocaleBound()) {
      cachedJavaTemplateDateFormatFactorySysDefTZ=null;
    }
    cachedCollator=null;
  }
}

Fixed version (ground truth):
public void setLocale(Locale locale){
  Locale prevLocale=getLocale();
  super.setLocale(locale);
  if (!locale.equals(prevLocale)) {
    cachedNumberFormats=null;
    cachedNumberFormat=null;
    if (cachedTemplateDateFormats != null) {
      for (int i=0; i < CACHED_TDFS_LENGTH; i++) {
        final TemplateDateFormat f=cachedTemplateDateFormats[i];
        if (f != null && f.isLocaleBound()) {
          cachedTemplateDateFormats[i]=null;
        }
      }
    }
    if (cachedXSTemplateDateFormatFactory != null && cachedXSTemplateDateFormatFactory.isLocaleBound()) {
      cachedXSTemplateDateFormatFactory=null;
    }
    if (cachedXSTemplateDateFormatFactorySysDefTZ != null && cachedXSTemplateDateFormatFactorySysDefTZ.isLocaleBound()) {
      cachedXSTemplateDateFormatFactorySysDefTZ=null;
    }
    if (cachedISOTemplateDateFormatFactory != null && cachedISOTemplateDateFormatFactory.isLocaleBound()) {
      cachedISOTemplateDateFormatFactory=null;
    }
    if (cachedISOTemplateDateFormatFactorySysDefTZ != null && cachedISOTemplateDateFormatFactorySysDefTZ.isLocaleBound()) {
      cachedISOTemplateDateFormatFactorySysDefTZ=null;
    }
    if (cachedJavaTemplateDateFormatFactory != null && cachedJavaTemplateDateFormatFactory.isLocaleBound()) {
      cachedJavaTemplateDateFormatFactory=null;
    }
    if (cachedJavaTemplateDateFormatFactorySysDefTZ != null && cachedJavaTemplateDateFormatFactorySysDefTZ.isLocaleBound()) {
      cachedJavaTemplateDateFormatFactorySysDefTZ=null;
    }
    cachedCollator=null;
  }
}