@@ -222,8 +222,9 @@ public void testConcurrentModificationException() throws InterruptedException {
222222 }
223223 }
224224
225- private boolean runConcurrencyTest () throws InterruptedException {
226- final int numberOfThreads = 20 ; final CountDownLatch startLatch = new CountDownLatch (1 );
225+ private boolean runConcurrencyTest () throws InterruptedException {
226+ final int numberOfThreads = 20 ;
227+ final CountDownLatch startLatch = new CountDownLatch (1 );
227228 final CountDownLatch endLatch = new CountDownLatch (numberOfThreads );
228229 final AtomicBoolean exceptionOccurred = new AtomicBoolean (false );
229230
@@ -254,30 +255,30 @@ private boolean runConcurrencyTest() throws InterruptedException {
254255 for (int j = 0 ; j < 30 ; j ++) {
255256 try {
256257 String detectorId = "detector-" + (j % 3 );
257- resultWriteQueue .put (
258+ resultWriteQueue
259+ .put (
258260 new ADResultWriteRequest (
259- System .currentTimeMillis () + j ,
260- detectorId ,
261- RequestPriority .MEDIUM ,
262- detectResult ,
263- null ,
264- null
261+ System .currentTimeMillis () + j ,
262+ detectorId ,
263+ RequestPriority .MEDIUM ,
264+ detectResult ,
265+ null ,
266+ null
265267 )
266- );
268+ );
267269 } catch (ConcurrentModificationException e ) {
268270 exceptionOccurred .set (true );
269271 return ;
270272 }
271273 }
272- } catch (Exception ignored ) {
273- } finally {
274+ } catch (Exception ignored ) {} finally {
274275 endLatch .countDown ();
275276 }
276277 });
277278 thread .start ();
278279 }
279280 startLatch .countDown ();
280281 assertTrue ("Test should complete" , endLatch .await (30 , TimeUnit .SECONDS ));
281- return exceptionOccurred .get ();
282+ return exceptionOccurred .get ();
282283 }
283284}
0 commit comments