Program: 174769
Project: 174769
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);
    validateFilterID(filterID);
    final String facetQNameStr=json.getString(PARAM_FACET_QNAME);
    final QName facetQName=QName.createQName(facetQNameStr,namespaceService);
    final String displayName=json.getString(PARAM_DISPLAY_NAME);
    final String displayControl=json.getString(PARAM_DISPLAY_CONTROL);
    final int maxFilters=json.getInt(PARAM_MAX_FILTERS);
    final int hitThreshold=json.getInt(PARAM_HIT_THRESHOLD);
    final int minFilterValueLength=json.getInt(PARAM_MIN_FILTER_VALUE_LENGTH);
    final String sortBy=json.getString(PARAM_SORT_BY);
    final String scope=getValue(String.class,json.opt(PARAM_SCOPE),"String_Node_Str");
    final boolean isEnabled=getValue(Boolean.class,json.opt(PARAM_IS_ENABLED),false);
    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);
    validateFilterID(filterID);
    final String facetQNameStr=json.getString(PARAM_FACET_QNAME);
    final QName facetQName=FacetQNameUtils.createQName(facetQNameStr,namespaceService);
    final String displayName=json.getString(PARAM_DISPLAY_NAME);
    final String displayControl=json.getString(PARAM_DISPLAY_CONTROL);
    final int maxFilters=json.getInt(PARAM_MAX_FILTERS);
    final int hitThreshold=json.getInt(PARAM_HIT_THRESHOLD);
    final int minFilterValueLength=json.getInt(PARAM_MIN_FILTER_VALUE_LENGTH);
    final String sortBy=json.getString(PARAM_SORT_BY);
    final String scope=getValue(String.class,json.opt(PARAM_SCOPE),"String_Node_Str");
    final boolean isEnabled=getValue(Boolean.class,json.opt(PARAM_IS_ENABLED),false);
    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);
  }
}