Program: 172011
Project: 172011
Buggy source:
public ResultSet executeQuery(BasicSearchParameters searchParameters,String language){
  if (repositoryState.isBootstrapping()) {
    throw new AlfrescoRuntimeException("String_Node_Str");
  }
  if (StringUtils.isEmpty(searchParameters.getQuery())) {
    throw new AlfrescoRuntimeException("String_Node_Str");
  }
  try {
    StoreRef store=SolrClientUtil.extractStoreRef(searchParameters);
    SolrStoreMappingWrapper mapping=SolrClientUtil.extractMapping(store,mappingLookup,shardRegistry,useDynamicShardRegistration,beanFactory);
    Pair<HttpClient,String> httpClientAndBaseUrl=mapping.getHttpClientAndBaseUrl();
    HttpClient httpClient=httpClientAndBaseUrl.getFirst();
    URLCodec encoder=new URLCodec();
    StringBuilder url=new StringBuilder();
    url.append(httpClientAndBaseUrl.getSecond());
    if (!url.toString().endsWith("String_Node_Str")) {
      url.append("String_Node_Str");
    }
    url.append("String_Node_Str" + encoder.encode(searchParameters.getQuery()));
    SearchParameters sp=(SearchParameters)searchParameters;
    url.append("String_Node_Str" + sp.isIncludeMetadata());
    url.append("String_Node_Str");
    url.append("String_Node_Str");
    if (mapping.isSharded()) {
      url.append(mapping.getShards());
    }
 else {
      String solrurl=httpClient.getHostConfiguration().getHostURL() + httpClientAndBaseUrl.getSecond();
      url.append(solrurl);
    }
    JSONObject body=new JSONObject();
    Set<String> allAuthorisations=permissionService.getAuthorisations();
    boolean includeGroups=includeGroupsForRoleAdmin ? true : !allAuthorisations.contains(PermissionService.ADMINISTRATOR_AUTHORITY);
    JSONArray authorities=new JSONArray();
    for (    String authority : allAuthorisations) {
      if (includeGroups) {
        authorities.put(authority);
      }
 else {
        if (AuthorityType.getAuthorityType(authority) != AuthorityType.GROUP) {
          authorities.put(authority);
        }
      }
    }
    body.put("String_Node_Str",authorities);
    body.put("String_Node_Str",anyDenyDenies);
    JSONArray tenants=new JSONArray();
    tenants.put(tenantService.getCurrentUserDomain());
    body.put("String_Node_Str",tenants);
    JSONArray locales=new JSONArray();
    for (    Locale currentLocale : searchParameters.getLocales()) {
      locales.put(DefaultTypeConverter.INSTANCE.convert(String.class,currentLocale));
    }
    if (locales.length() == 0) {
      locales.put(I18NUtil.getLocale());
    }
    body.put("String_Node_Str",locales);
    return (ResultSet)postSolrQuery(httpClient,url.toString(),body,json -> {
      return new SolrSQLJSONResultSet(json,searchParameters);
    }
);
  }
 catch (  JSONException|IOException|EncoderException e) {
    throw new LuceneQueryParserException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public ResultSet executeQuery(SearchParameters searchParameters,String language){
  if (repositoryState.isBootstrapping()) {
    throw new AlfrescoRuntimeException("String_Node_Str");
  }
  if (StringUtils.isEmpty(searchParameters.getQuery())) {
    throw new AlfrescoRuntimeException("String_Node_Str");
  }
  try {
    StoreRef store=SolrClientUtil.extractStoreRef(searchParameters);
    SolrStoreMappingWrapper mapping=SolrClientUtil.extractMapping(store,mappingLookup,shardRegistry,useDynamicShardRegistration,beanFactory);
    Pair<HttpClient,String> httpClientAndBaseUrl=mapping.getHttpClientAndBaseUrl();
    HttpClient httpClient=httpClientAndBaseUrl.getFirst();
    URLCodec encoder=new URLCodec();
    StringBuilder url=new StringBuilder();
    url.append(httpClientAndBaseUrl.getSecond());
    if (!url.toString().endsWith("String_Node_Str")) {
      url.append("String_Node_Str");
    }
    url.append("String_Node_Str" + encoder.encode(searchParameters.getQuery()));
    SearchParameters sp=(SearchParameters)searchParameters;
    url.append("String_Node_Str" + sp.isIncludeMetadata());
    url.append("String_Node_Str");
    url.append("String_Node_Str");
    if (mapping.isSharded()) {
      url.append(mapping.getShards());
    }
 else {
      String solrurl=httpClient.getHostConfiguration().getHostURL() + httpClientAndBaseUrl.getSecond();
      url.append(solrurl);
    }
    JSONObject body=new JSONObject();
    Set<String> allAuthorisations=permissionService.getAuthorisations();
    boolean includeGroups=includeGroupsForRoleAdmin ? true : !allAuthorisations.contains(PermissionService.ADMINISTRATOR_AUTHORITY);
    JSONArray authorities=new JSONArray();
    for (    String authority : allAuthorisations) {
      if (includeGroups) {
        authorities.put(authority);
      }
 else {
        if (AuthorityType.getAuthorityType(authority) != AuthorityType.GROUP) {
          authorities.put(authority);
        }
      }
    }
    body.put("String_Node_Str",authorities);
    body.put("String_Node_Str",anyDenyDenies);
    JSONArray tenants=new JSONArray();
    tenants.put(tenantService.getCurrentUserDomain());
    body.put("String_Node_Str",tenants);
    JSONArray locales=new JSONArray();
    for (    Locale currentLocale : searchParameters.getLocales()) {
      locales.put(DefaultTypeConverter.INSTANCE.convert(String.class,currentLocale));
    }
    if (locales.length() == 0) {
      locales.put(I18NUtil.getLocale());
    }
    body.put("String_Node_Str",locales);
    return (ResultSet)postSolrQuery(httpClient,url.toString(),body,json -> {
      return new SolrSQLJSONResultSet(json,searchParameters);
    }
);
  }
 catch (  JSONException|IOException|EncoderException e) {
    throw new LuceneQueryParserException("String_Node_Str",e);
  }
}