mirror of https://github.com/apache/druid.git
* StructuralSearchInspection, Prohibit check on Thread.getState() * review changes - 1 * review changes 2 * review changes 3 * test fix * review changes-2 * review changes-3
This commit is contained in:
parent
868bb42301
commit
ade8d1922d
|
@ -311,6 +311,14 @@
|
||||||
<constraint name="k" within="" contains="" />
|
<constraint name="k" within="" contains="" />
|
||||||
<constraint name="v" within="" contains="" />
|
<constraint name="v" within="" contains="" />
|
||||||
</searchConfiguration>
|
</searchConfiguration>
|
||||||
|
<searchConfiguration name="Prohibit Thread.getState() != TERMINATED antipattern" text="$t$.getState()!=Thread.State.$state$" recursive="true" caseInsensitive="true" type="JAVA">
|
||||||
|
<constraint name="t" within="" contains="" />
|
||||||
|
<constraint name="state" within="" contains="" />
|
||||||
|
</searchConfiguration>
|
||||||
|
<searchConfiguration name="Prohibit Thread.getState() == TERMINATED antipattern" text="$t$.getState()==Thread.State.$state$" recursive="true" caseInsensitive="true" type="JAVA">
|
||||||
|
<constraint name="t" within="" contains="" />
|
||||||
|
<constraint name="state" within="" contains="" />
|
||||||
|
</searchConfiguration>
|
||||||
<searchConfiguration name="Use CollectionUtils.mapValues(Map<K,V>, Function<V,V2>)" text="$x$.entrySet().stream().collect(Collectors.toMap($k$ -> $k$.getKey(), $y$))" recursive="true" caseInsensitive="true" type="JAVA">
|
<searchConfiguration name="Use CollectionUtils.mapValues(Map<K,V>, Function<V,V2>)" text="$x$.entrySet().stream().collect(Collectors.toMap($k$ -> $k$.getKey(), $y$))" recursive="true" caseInsensitive="true" type="JAVA">
|
||||||
<constraint name="x" within="" contains="" />
|
<constraint name="x" within="" contains="" />
|
||||||
<constraint name="y" within="" contains="" />
|
<constraint name="y" within="" contains="" />
|
||||||
|
|
|
@ -179,6 +179,7 @@ final class DeadlockDetectingFailOnTimeout extends Statement
|
||||||
* problem or if the thread cannot be determined. The return value is never equal
|
* problem or if the thread cannot be determined. The return value is never equal
|
||||||
* to {@code mainThread}.
|
* to {@code mainThread}.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("SSBasedInspection") // Prohibit check on Thread.getState()
|
||||||
private Thread getStuckThread(Thread mainThread)
|
private Thread getStuckThread(Thread mainThread)
|
||||||
{
|
{
|
||||||
List<Thread> threadsInGroup = getThreadsInGroup(mainThread.getThreadGroup());
|
List<Thread> threadsInGroup = getThreadsInGroup(mainThread.getThreadGroup());
|
||||||
|
|
|
@ -100,9 +100,7 @@ public class EventReceiverFirehoseIdleTest
|
||||||
|
|
||||||
private void awaitDelayedExecutorThreadTerminated() throws InterruptedException
|
private void awaitDelayedExecutorThreadTerminated() throws InterruptedException
|
||||||
{
|
{
|
||||||
while (firehose.getDelayedCloseExecutor().getState() != Thread.State.TERMINATED) {
|
firehose.getDelayedCloseExecutor().join();
|
||||||
Thread.sleep(50);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(timeout = 40_000L)
|
@Test(timeout = 40_000L)
|
||||||
|
|
|
@ -275,9 +275,7 @@ public class EventReceiverFirehoseTest
|
||||||
|
|
||||||
private void awaitDelayedExecutorThreadTerminated() throws InterruptedException
|
private void awaitDelayedExecutorThreadTerminated() throws InterruptedException
|
||||||
{
|
{
|
||||||
while (firehose.getDelayedCloseExecutor().getState() != Thread.State.TERMINATED) {
|
firehose.getDelayedCloseExecutor().join();
|
||||||
Thread.sleep(50);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(timeout = 60_000L)
|
@Test(timeout = 60_000L)
|
||||||
|
|
Loading…
Reference in New Issue