SOLR-6625: formatting fixed

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1693434 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Noble Paul 2015-07-30 14:39:23 +00:00
parent b09a4553f7
commit e513869cd6
4 changed files with 16 additions and 16 deletions

View File

@ -26,19 +26,19 @@ import org.apache.solr.client.solrj.impl.SolrHttpContext;
*/
public class SolrQueryRequestContext extends SolrHttpContext {
final private SolrQueryRequest solrQueryRequest;
public SolrQueryRequestContext(SolrQueryRequest solrQueryRequest) {
this.solrQueryRequest = solrQueryRequest;
setAttribute(SolrHttpContext.class.getName(), this);
}
public SolrQueryRequest getSolrQueryRequest() {
return solrQueryRequest;
}
@Override
public String toString() {
return "[SolrQueryRequestContext contains: "+solrQueryRequest+"]";
return "[SolrQueryRequestContext contains: " + solrQueryRequest + "]";
}
}

View File

@ -119,7 +119,7 @@ public class SolrDispatchFilter extends BaseSolrFilter {
if (this.cores.getAuthenticationPlugin() != null) {
HttpClientConfigurer configurer = this.cores.getAuthenticationPlugin().getDefaultConfigurer();
if (configurer != null) {
configurer.configure((DefaultHttpClient)httpClient, new ModifiableSolrParams());
configurer.configure((DefaultHttpClient) httpClient, new ModifiableSolrParams());
}
}

View File

@ -388,7 +388,7 @@ public class HttpClientUtil {
Constructor<? extends SystemDefaultHttpClient> constructor;
try {
constructor = systemDefaultHttpClientClass.getDeclaredConstructor();
return constructor.newInstance();
return constructor.newInstance();
} catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
throw new SolrException(ErrorCode.SERVER_ERROR, "Unable to create HttpClient instance. ", e);
}
@ -397,10 +397,10 @@ public class HttpClientUtil {
public static DefaultHttpClient createHttpClient(ClientConnectionManager cm) {
Constructor<? extends DefaultHttpClient> productConstructor;
try {
productConstructor = defaultHttpClientClass.getDeclaredConstructor(new Class[] { ClientConnectionManager.class });
return productConstructor.newInstance(new Object[] { cm });
productConstructor = defaultHttpClientClass.getDeclaredConstructor(new Class[]{ClientConnectionManager.class});
return productConstructor.newInstance(new Object[]{cm});
} catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
throw new SolrException(ErrorCode.SERVER_ERROR, "Unable to create HttpClient instance, registered class is: "+defaultHttpClientClass, e);
throw new SolrException(ErrorCode.SERVER_ERROR, "Unable to create HttpClient instance, registered class is: " + defaultHttpClientClass, e);
}
}

View File

@ -169,7 +169,7 @@ public class ExecutorUtil {
StringBuilder contextString = new StringBuilder();
if (submitterContext != null) {
Collection<String> values = submitterContext.values();
for (String value : values) {
contextString.append(value + " ");
}
@ -177,13 +177,13 @@ public class ExecutorUtil {
contextString.setLength(contextString.length() - 1);
}
}
String ctxStr = contextString.toString().replace("/", "//");
final String submitterContextStr = ctxStr.length() <= MAX_THREAD_NAME_LEN ? ctxStr : ctxStr.substring(0, MAX_THREAD_NAME_LEN);
final Exception submitterStackTrace = new Exception("Submitter stack trace");
final List<InheritableThreadLocalProvider> providersCopy = providers;
final ArrayList<AtomicReference> ctx = providersCopy.isEmpty()? null: new ArrayList<>(providersCopy.size());
if(ctx != null) {
final ArrayList<AtomicReference> ctx = providersCopy.isEmpty() ? null : new ArrayList<>(providersCopy.size());
if (ctx != null) {
for (int i = 0; i < providers.size(); i++) {
AtomicReference reference = new AtomicReference();
ctx.add(reference);
@ -193,7 +193,7 @@ public class ExecutorUtil {
super.execute(new Runnable() {
@Override
public void run() {
if(ctx != null) {
if (ctx != null) {
for (int i = 0; i < providersCopy.size(); i++) providersCopy.get(i).set(ctx.get(i));
}
Map<String, String> threadContext = MDC.getCopyOfContextMap();
@ -208,7 +208,7 @@ public class ExecutorUtil {
try {
command.run();
} catch (Throwable t) {
if (t instanceof OutOfMemoryError) {
if (t instanceof OutOfMemoryError) {
throw t;
}
log.error("Uncaught exception {} thrown by thread: {}", t, currentThread.getName(), submitterStackTrace);
@ -219,7 +219,7 @@ public class ExecutorUtil {
} else {
MDC.clear();
}
if(ctx != null) {
if (ctx != null) {
for (int i = 0; i < providersCopy.size(); i++) providersCopy.get(i).clean(ctx.get(i));
}
currentThread.setName(oldName);