Skip to content

Commit

Permalink
Use ExecutorService variables to assign ExecutorService Instances (ap…
Browse files Browse the repository at this point in the history
…ache#11373)

* Added inspection rule to prohibit ExecutorService assignment to Executor

* Use ExecutorService type variable to assign ExecutorService

* Changed : Variable => variable

* Removed unused Executor import
  • Loading branch information
ksankeerth authored Jun 25, 2021
1 parent df9b57a commit af2ab98
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
10 changes: 10 additions & 0 deletions .idea/inspectionProfiles/Druid.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;

public class KerberosHttpClient extends AbstractHttpClient
{
private static final Logger log = new Logger(KerberosHttpClient.class);

private final HttpClient delegate;
private final CookieManager cookieManager;
private final Executor exec = Execs.singleThreaded("test-%s");
private final ExecutorService exec = Execs.singleThreaded("test-%s");
private final String internalClientPrincipal;
private final String internalClientKeytab;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -268,7 +268,7 @@ public EnumSet<DispatcherType> getDispatcherType()
public void testTimeouts() throws Exception
{
// test for request timeouts properly not locking up all threads
final Executor executor = Executors.newFixedThreadPool(100);
final ExecutorService executor = Executors.newFixedThreadPool(100);
final AtomicLong count = new AtomicLong(0);
final CountDownLatch latch = new CountDownLatch(1000);
for (int i = 0; i < 10000; i++) {
Expand Down

0 comments on commit af2ab98

Please sign in to comment.