X-Git-Url: https://gerrit.onap.org/r/gitweb?p=policy%2Fengine.git;a=blobdiff_plain;f=POLICY-SDK-APP%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fcontroller%2FAutoPushController.java;h=b5e17f2e064c0af8d3873a2f2c5fb98f1fb355bf;hp=f97a131a0a4bbb14f39c15b7cb782701da8e5621;hb=0950d79047d3404c15b4dd30cffeb81346565f64;hpb=f36e53a3637e1204a42491ec0eeed7b3c763f681;ds=sidebyside diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/AutoPushController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/AutoPushController.java index f97a131a0..b5e17f2e0 100644 --- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/AutoPushController.java +++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/AutoPushController.java @@ -31,7 +31,6 @@ import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; -import java.io.PrintWriter; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -339,15 +338,9 @@ public class AutoPushController extends RestrictedBaseController { response.setContentType("application / json"); request.setCharacterEncoding(UTF8); - PrintWriter out = response.getWriter(); refreshGroups(); - JsonMessage msg = new JsonMessage(mapper.writeValueAsString(groups)); - out.write(new JSONObject(msg).toString()); - // - // Why is this here? This defeats the purpose of the loop?? - // Sonar says to remove it or make it conditional - // - return null; + response.getWriter().write(new JSONObject( + new JsonMessage(mapper.writeValueAsString(groups))).toString()); } } catch (Exception e) { response.setCharacterEncoding(UTF8); @@ -401,10 +394,8 @@ public class AutoPushController extends RestrictedBaseController { response.setContentType("application / json"); request.setCharacterEncoding(UTF8); - PrintWriter out = response.getWriter(); refreshGroups(); - out.write(new JSONObject(new JsonMessage(mapper.writeValueAsString(groups))).toString()); - return null; + response.getWriter().write(new JSONObject(new JsonMessage(mapper.writeValueAsString(groups))).toString()); } catch (Exception e) { response.setCharacterEncoding(UTF8); request.setCharacterEncoding(UTF8);