From eec3233505be2d6d9cc95c9bfc8359b91572ac51 Mon Sep 17 00:00:00 2001 From: Sébastien Lesaint Date: Tue, 22 Mar 2016 12:34:35 +0100 Subject: fix quality flaws --- .../src/main/java/org/sonar/ce/app/CeServer.java | 26 +++++++++++----------- .../test/java/org/sonar/ce/app/CeServerTest.java | 3 --- 2 files changed, 13 insertions(+), 16 deletions(-) (limited to 'server/sonar-ce') diff --git a/server/sonar-ce/src/main/java/org/sonar/ce/app/CeServer.java b/server/sonar-ce/src/main/java/org/sonar/ce/app/CeServer.java index 986f957bab7..3ea020171f0 100644 --- a/server/sonar-ce/src/main/java/org/sonar/ce/app/CeServer.java +++ b/server/sonar-ce/src/main/java/org/sonar/ce/app/CeServer.java @@ -129,19 +129,6 @@ public class CeServer implements Monitored { } } - private void stopAwait() { - stopAwait = true; - Thread t = awaitThread.get(); - if (t != null) { - t.interrupt(); - try { - t.join(1000); - } catch (InterruptedException e) { - // Ignored - } - } - } - private class CeMainThread extends Thread { private static final int CHECK_FOR_STOP_DELAY = 50; private volatile boolean stop = false; @@ -227,6 +214,19 @@ public class CeServer implements Monitored { // interrupt current thread in case its waiting for WebServer interrupt(); } + + private void stopAwait() { + stopAwait = true; + Thread t = awaitThread.get(); + if (t != null) { + t.interrupt(); + try { + t.join(1000); + } catch (InterruptedException e) { + // Ignored + } + } + } } } diff --git a/server/sonar-ce/src/test/java/org/sonar/ce/app/CeServerTest.java b/server/sonar-ce/src/test/java/org/sonar/ce/app/CeServerTest.java index 62e5382cfb1..c863a9a8da3 100644 --- a/server/sonar-ce/src/test/java/org/sonar/ce/app/CeServerTest.java +++ b/server/sonar-ce/src/test/java/org/sonar/ce/app/CeServerTest.java @@ -28,7 +28,6 @@ import org.junit.After; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; -import org.junit.rules.TemporaryFolder; import org.junit.rules.Timeout; import org.mockito.Mockito; import org.sonar.ce.ComputeEngine; @@ -44,8 +43,6 @@ public class CeServerTest { public Timeout timeout = Timeout.seconds(50); @Rule public ExpectedException expectedException = ExpectedException.none(); - @Rule - public TemporaryFolder temp = new TemporaryFolder(); private CeServer underTest = null; private Thread waitingThread = null; -- cgit v1.2.3