diff options
author | Rupinder <rupinsi1@in.ibm.com> | 2020-06-11 11:09:05 +0530 |
---|---|---|
committer | Rupinderjeet Singh <rupinsi1@in.ibm.com> | 2020-06-11 08:31:24 +0000 |
commit | f52e09d71a82551ac7409912f9d55ca02eca3091 (patch) | |
tree | 2d877a214244671c950a1c0fcd3b5b55ed634dbc | |
parent | 564dcdbcb8dce99e1df425a1f10f11467f5b5301 (diff) |
fixed some sonar code smells
Issue-ID: PORTAL-865
Change-Id: I1714739f137a7f5ce5fe1f518217cc3f7ac2a8aa
Signed-off-by: Rupinder <rupinsi1@in.ibm.com>
3 files changed, 14 insertions, 12 deletions
diff --git a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/sample/BroadcastController.java b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/sample/BroadcastController.java index 4392aeb5..0cbcd2ed 100644 --- a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/sample/BroadcastController.java +++ b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/sample/BroadcastController.java @@ -12,7 +12,7 @@ * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software + * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and @@ -56,7 +56,8 @@ import org.onap.portalsdk.core.web.support.JsonMessage; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.servlet.ModelAndView; import com.fasterxml.jackson.databind.DeserializationFeature; @@ -76,7 +77,7 @@ public class BroadcastController extends RestrictedBaseController { @Autowired private BroadcastService broadcastService; - @RequestMapping(value = { "/broadcast" }, method = RequestMethod.GET) + @GetMapping(value = { "/broadcast" }) public ModelAndView broadcast(HttpServletRequest request) { Map<String, Object> model = new HashMap<>(); ObjectMapper mapper = new ObjectMapper(); @@ -90,7 +91,7 @@ public class BroadcastController extends RestrictedBaseController { return new ModelAndView(getViewName(), model); } - @RequestMapping(value = { "/get_broadcast" }, method = RequestMethod.GET) + @GetMapping(value = { "/get_broadcast" }) public void getBroadcast(HttpServletRequest request, HttpServletResponse response) { Map<String, Object> model = new HashMap<>(); ObjectMapper mapper = new ObjectMapper(); @@ -121,7 +122,7 @@ public class BroadcastController extends RestrictedBaseController { return lookupData; } - @RequestMapping(value = { "/broadcast/save" }, method = RequestMethod.POST) + @PostMapping(value = { "/broadcast/save" }) public ModelAndView save(HttpServletRequest request, HttpServletResponse response) throws IOException { try { diff --git a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/sample/BroadcastListController.java b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/sample/BroadcastListController.java index c9c666fb..4e66743e 100644 --- a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/sample/BroadcastListController.java +++ b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/sample/BroadcastListController.java @@ -54,7 +54,8 @@ import org.onap.portalsdk.core.web.support.JsonMessage; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.servlet.ModelAndView; import com.fasterxml.jackson.databind.DeserializationFeature; @@ -71,7 +72,7 @@ public class BroadcastListController extends RestrictedBaseController { @Autowired private BroadcastService broadcastService; - @RequestMapping(value = { "/broadcast_list" }, method = RequestMethod.GET) + @GetMapping(value = { "/broadcast_list" }) public ModelAndView broadcastList(HttpServletRequest request) { Map<String, Object> model = new HashMap<>(); @@ -79,7 +80,7 @@ public class BroadcastListController extends RestrictedBaseController { return new ModelAndView(getViewName(), model); } - @RequestMapping(value = { "/get_broadcast_list" }, method = RequestMethod.GET) + @GetMapping(value = { "/get_broadcast_list" }) public void getBroadcast(HttpServletRequest request, HttpServletResponse response) { Map<String, Object> model = new HashMap<>(); ObjectMapper mapper = new ObjectMapper(); @@ -96,7 +97,7 @@ public class BroadcastListController extends RestrictedBaseController { } - @RequestMapping(value = { "/broadcast_list/remove" }, method = RequestMethod.POST) + @PostMapping(value = { "/broadcast_list/remove" }) public ModelAndView remove(HttpServletRequest request, HttpServletResponse response) throws IOException { try { @@ -131,7 +132,7 @@ public class BroadcastListController extends RestrictedBaseController { } - @RequestMapping(value = { "/broadcast_list/toggleActive" }, method = RequestMethod.POST) + @PostMapping(value = { "/broadcast_list/toggleActive" }) public ModelAndView toggleActive(HttpServletRequest request, HttpServletResponse response) throws IOException { try { diff --git a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/sample/CallflowController.java b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/sample/CallflowController.java index 09b28dc1..34c777cd 100644 --- a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/sample/CallflowController.java +++ b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/sample/CallflowController.java @@ -40,7 +40,7 @@ package org.onap.portalapp.controller.sample; import org.onap.portalsdk.core.controller.RestrictedBaseController; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.servlet.ModelAndView; @@ -54,7 +54,7 @@ import org.springframework.web.servlet.ModelAndView; @RequestMapping("/") public class CallflowController extends RestrictedBaseController { - @RequestMapping(value = { "/callflow" }, method = RequestMethod.GET) + @GetMapping(value = { "/callflow" }) public ModelAndView plot() { final String defaultViewName = null; return new ModelAndView(defaultViewName); |