aboutsummaryrefslogtreecommitdiffstats
path: root/policy-endpoints
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-04-06 11:26:13 -0400
committerJim Hahn <jrh3@att.com>2020-04-06 11:41:32 -0400
commit82ac8775dfa540fa856ecfd284c69afa44790dd8 (patch)
tree551db3b365be7a0a13aabaa1c52191079d305369 /policy-endpoints
parenta56d3929f2387252525577fb36f9e03933064b8f (diff)
More sonar issues in common
Fixed additional sonar issues: - infinit loop; while the issue is bogus, it was easy enough to modify the code to satisfy sonar - doesn't like "volatile"; again, the issue is bogus, but easy enough to modify the code Disabled a couple of sonars in NetworkUtil, as they are not actually an issue. Issue-ID: POLICY-2305 Change-Id: I5500183e3fe4060696994cff55bdae4ba7e138c7 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'policy-endpoints')
-rw-r--r--policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java
index f7f2fc15..6825f07c 100644
--- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java
+++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java
@@ -115,7 +115,7 @@ public abstract class JettyServletServer implements HttpServletServer, Runnable
/**
* Jetty thread.
*/
- protected volatile Thread jettyThread;
+ protected Thread jettyThread;
/**
* Start condition.
@@ -418,12 +418,13 @@ public abstract class JettyServletServer implements HttpServletServer, Runnable
this.stop();
- if (this.jettyThread == null) {
- return;
+ Thread jettyThreadCopy;
+ synchronized (this) {
+ if ((jettyThreadCopy = this.jettyThread) == null) {
+ return;
+ }
}
- Thread jettyThreadCopy = this.jettyThread;
-
if (jettyThreadCopy.isAlive()) {
try {
jettyThreadCopy.join(2000L);