Program: 86977
Project: 86977
Buggy source:
/** 
 * Return a dimension filter instance corresponding to the dimension set specified by the user (or discovered by the tag). The dimension filter is configured with the preferred dimensions of the user (also configured). <p/> The preferred locales are identified by checking the following locations, in the order specified: <ol> <li>set by the locale attribute by id of locale <li>set by locale attribute by name of locale <li>detected by finding the locale dimension id in the ics variable "locale" <li>detected by finding the locale name in the ics variable "locale" <li>detected by finding the locale dimension id in the ics session variable "locale" <li>detected by finding the locale name in the ics session variable "locale" <li>detected by reading the Accept-Language header </ol> The dimension set is identified by checking in the following places, in order: <ol> <li>set by the dimset attribute by name of dimension set <li>set by dimset attribute by the id of the dimension set <li>looked up by finding the site name in the ics variable "site" and loading the single dimension set associated with that site </ol>
 * @return a dimension filter, configured with the set preferred locales, ornull, if either the dimenion set or the preferred dimensions could not be found (with extensive errors)
 */
protected final DimensionFilterInstance getDimensionFilter(ICS ics){
  DimensionFilterInstance filter;
  try {
    Collection<AssetId> preferredLocales=getPreferredLocales(ics);
    DimensionSetInstance dimSet=getDimensionSet(ics);
    filter=DimensionUtils.getDimensionFilter(DimensionUtils.getDM(ics),preferredLocales,dimSet);
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + filter + "String_Node_Str"+ dimSet+ "String_Node_Str"+ preferredLocales+ "String_Node_Str");
    }
  }
 catch (  DimensionException e) {
    LOG.error("String_Node_Str",e);
    filter=null;
  }
catch (  RuntimeException e) {
    LOG.error("String_Node_Str",e);
    filter=null;
  }
  return filter;
}

Fixed version (ground truth):
/** 
 * Return a dimension filter instance corresponding to the dimension set specified by the user (or discovered by the tag). The dimension filter is configured with the preferred dimensions of the user (also configured). <p/> The preferred locales are identified by checking the following locations, in the order specified: <ol> <li>set by the locale attribute by id of locale <li>set by locale attribute by name of locale <li>detected by finding the locale dimension id in the ics variable "locale" <li>detected by finding the locale name in the ics variable "locale" <li>detected by finding the locale dimension id in the ics session variable "locale" <li>detected by finding the locale name in the ics session variable "locale" <li>detected by reading the Accept-Language header </ol> The dimension set is identified by checking in the following places, in order: <ol> <li>set by the dimset attribute by name of dimension set <li>set by dimset attribute by the id of the dimension set <li>looked up by finding the site name in the ics variable "site" and loading the single dimension set associated with that site </ol>
 * @return a dimension filter, configured with the set preferred locales, ornull, if either the dimension set or the preferred dimensions could not be found (with extensive errors)
 */
protected final DimensionFilterInstance getDimensionFilter(ICS ics){
  DimensionFilterInstance filter;
  try {
    DimensionSetInstance dimSet=getDimensionSet(ics);
    if (dimSet == null) {
      if (LOG.isTraceEnabled()) {
        LOG.trace("String_Node_Str");
      }
      return null;
    }
    Collection<AssetId> preferredLocales=getPreferredLocales(ics);
    filter=DimensionUtils.getDimensionFilter(DimensionUtils.getDM(ics),preferredLocales,dimSet);
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + filter + "String_Node_Str"+ dimSet+ "String_Node_Str"+ preferredLocales+ "String_Node_Str");
    }
  }
 catch (  DimensionException e) {
    LOG.error("String_Node_Str",e);
    filter=null;
  }
catch (  RuntimeException e) {
    LOG.error("String_Node_Str",e);
    filter=null;
  }
  return filter;
}