Program: 174770
Project: 174770
Buggy source:
private SolrFacetProperties parseRequestForFacetProperties(WebScriptRequest req){
  JSONObject json=null;
  try {
    json=new JSONObject(new JSONTokener(req.getContent().getContent()));
    final String filterID=json.getString(PARAM_FILTER_ID);
    final String facetQNameStr=getValue(String.class,json.opt(PARAM_FACET_QNAME),null);
    final QName facetQName=(facetQNameStr == null) ? null : QName.createQName(facetQNameStr,namespaceService);
    final String displayName=getValue(String.class,json.opt(PARAM_DISPLAY_NAME),null);
    final String displayControl=getValue(String.class,json.opt(PARAM_DISPLAY_CONTROL),null);
    final int maxFilters=getValue(Integer.class,json.opt(PARAM_MAX_FILTERS),-1);
    final int hitThreshold=getValue(Integer.class,json.opt(PARAM_HIT_THRESHOLD),-1);
    final int minFilterValueLength=getValue(Integer.class,json.opt(PARAM_MIN_FILTER_VALUE_LENGTH),-1);
    final String sortBy=getValue(String.class,json.opt(PARAM_SORT_BY),null);
    final String scope=getValue(String.class,json.opt(PARAM_SCOPE),null);
    final Boolean isEnabled=getValue(Boolean.class,json.opt(PARAM_IS_ENABLED),null);
    JSONArray scopedSitesJsonArray=getValue(JSONArray.class,json.opt(PARAM_SCOPED_SITES),null);
    final Set<String> scopedSites=getScopedSites(scopedSitesJsonArray);
    final JSONObject customPropJsonObj=getValue(JSONObject.class,json.opt(PARAM_CUSTOM_PROPERTIES),null);
    final Set<CustomProperties> customProps=getCustomProperties(customPropJsonObj);
    SolrFacetProperties fp=new SolrFacetProperties.Builder().filterID(filterID).facetQName(facetQName).displayName(displayName).displayControl(displayControl).maxFilters(maxFilters).hitThreshold(hitThreshold).minFilterValueLength(minFilterValueLength).sortBy(sortBy).scope(scope).isEnabled(isEnabled).scopedSites(scopedSites).customProperties(customProps).build();
    return fp;
  }
 catch (  IOException e) {
    throw new WebScriptException(Status.STATUS_BAD_REQUEST,"String_Node_Str",e);
  }
catch (  JSONException e) {
    throw new WebScriptException(Status.STATUS_BAD_REQUEST,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
private SolrFacetProperties parseRequestForFacetProperties(WebScriptRequest req){
  JSONObject json=null;
  try {
    json=new JSONObject(new JSONTokener(req.getContent().getContent()));
    final String filterID=json.getString(PARAM_FILTER_ID);
    final String facetQNameStr=getValue(String.class,json.opt(PARAM_FACET_QNAME),null);
    final QName facetQName=(facetQNameStr == null) ? null : FacetQNameUtils.createQName(facetQNameStr,namespaceService);
    final String displayName=getValue(String.class,json.opt(PARAM_DISPLAY_NAME),null);
    final String displayControl=getValue(String.class,json.opt(PARAM_DISPLAY_CONTROL),null);
    final int maxFilters=getValue(Integer.class,json.opt(PARAM_MAX_FILTERS),-1);
    final int hitThreshold=getValue(Integer.class,json.opt(PARAM_HIT_THRESHOLD),-1);
    final int minFilterValueLength=getValue(Integer.class,json.opt(PARAM_MIN_FILTER_VALUE_LENGTH),-1);
    final String sortBy=getValue(String.class,json.opt(PARAM_SORT_BY),null);
    final String scope=getValue(String.class,json.opt(PARAM_SCOPE),null);
    final Boolean isEnabled=getValue(Boolean.class,json.opt(PARAM_IS_ENABLED),null);
    JSONArray scopedSitesJsonArray=getValue(JSONArray.class,json.opt(PARAM_SCOPED_SITES),null);
    final Set<String> scopedSites=getScopedSites(scopedSitesJsonArray);
    final JSONObject customPropJsonObj=getValue(JSONObject.class,json.opt(PARAM_CUSTOM_PROPERTIES),null);
    final Set<CustomProperties> customProps=getCustomProperties(customPropJsonObj);
    SolrFacetProperties fp=new SolrFacetProperties.Builder().filterID(filterID).facetQName(facetQName).displayName(displayName).displayControl(displayControl).maxFilters(maxFilters).hitThreshold(hitThreshold).minFilterValueLength(minFilterValueLength).sortBy(sortBy).scope(scope).isEnabled(isEnabled).scopedSites(scopedSites).customProperties(customProps).build();
    return fp;
  }
 catch (  IOException e) {
    throw new WebScriptException(Status.STATUS_BAD_REQUEST,"String_Node_Str",e);
  }
catch (  JSONException e) {
    throw new WebScriptException(Status.STATUS_BAD_REQUEST,"String_Node_Str",e);
  }
}