Program: 79191
Project: 79191
Buggy source:
/** 
 * Returns   {@code true} if the given {@code locale} is supported bythis locale service provider. The given  {@code locale} may contain<a href="../Locale.html#def_extensions">extensions<a/> that should be taken into account for the support determination. <p>The default implementation returns  {@code true} if the given {@code locale}is equal to any of the available   {@code Locale}s returned by  {@link #getAvailableLocales()} with ignoring any extensions in both thegiven  {@code locale} and the available locales. Concrete locale serviceprovider implementations should override this method if those implementations are  {@code Locale} extensions-aware. For example,{@code DecimalFormatSymbolsProvider} implementations will need to checkextensions in the given  {@code locale} to see if any numbering system isspecified and can be supported. However,  {@code CollatorProvider}implementations may not be affected by any particular numbering systems, and in that case, extensions for numbering systems should be ignored.
 * @param locale a {@code Locale} to be tested
 * @return {@code true} if the given {@code locale} is supported by thisprovider;  {@code false} otherwise.
 * @throws NullPointerException if the given  {@code locale} is {@code null}
 * @see Locale#hasExtensions()
 * @see Locale#stripExtensions()
 * @since 1.8
 */
public boolean isSupportedLocale(Locale locale){
  locale=locale.stripExtensions();
  for (  Locale available : getAvailableLocales()) {
    if (locale.equals(available.stripExtensions())) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Returns   {@code true} if the given {@code locale} is supported bythis locale service provider. The given  {@code locale} may contain<a href="../Locale.html#def_extensions">extensions</a> that should be taken into account for the support determination. <p>The default implementation returns  {@code true} if the given {@code locale}is equal to any of the available   {@code Locale}s returned by  {@link #getAvailableLocales()} with ignoring any extensions in both thegiven  {@code locale} and the available locales. Concrete locale serviceprovider implementations should override this method if those implementations are  {@code Locale} extensions-aware. For example,{@code DecimalFormatSymbolsProvider} implementations will need to checkextensions in the given  {@code locale} to see if any numbering system isspecified and can be supported. However,  {@code CollatorProvider}implementations may not be affected by any particular numbering systems, and in that case, extensions for numbering systems should be ignored.
 * @param locale a {@code Locale} to be tested
 * @return {@code true} if the given {@code locale} is supported by thisprovider;  {@code false} otherwise.
 * @throws NullPointerException if the given  {@code locale} is {@code null}
 * @see Locale#hasExtensions()
 * @see Locale#stripExtensions()
 * @since 1.8
 */
public boolean isSupportedLocale(Locale locale){
  locale=locale.stripExtensions();
  for (  Locale available : getAvailableLocales()) {
    if (locale.equals(available.stripExtensions())) {
      return true;
    }
  }
  return false;
}