- if (actions != null && !actions.isEmpty()) {
- for (String actiongrp : actions) {
- // check output ports
- sstr = Pattern.compile("OUTPUT=(.*)").matcher(actiongrp);
- if (sstr.matches()) {
- for (String t : sstr.group(1).split(",")) {
- Matcher n = Pattern.compile("(?:(\\d+))").matcher(t);
- if (n.matches()) {
- if (n.group(1) != null) {
- Short port = Short.parseShort(n.group(1));
- if (isPortValid(sw, port) == false) {
- String msg = String.format("Output port %d is not valid for this switch", port);
- if (!containerName.equals(GlobalConstants.DEFAULT.toString())) {
- msg += " in Container " + containerName;
- }
- return new Status(StatusCode.BADREQUEST, msg);
+ if (actions == null || actions.isEmpty()) {
+ return new Status(StatusCode.BADREQUEST, "Actions value is null or empty");
+ }
+ for (String actiongrp : actions) {
+ // check output ports
+ sstr = Pattern.compile("OUTPUT=(.*)").matcher(actiongrp);
+ if (sstr.matches()) {
+ for (String t : sstr.group(1).split(",")) {
+ Matcher n = Pattern.compile("(?:(\\d+))").matcher(t);
+ if (n.matches()) {
+ if (n.group(1) != null) {
+ Short port = Short.parseShort(n.group(1));
+ if (isPortValid(sw, port) == false) {
+ String msg = String.format("Output port %d is not valid for this switch", port);
+ if (!containerName.equals(GlobalConstants.DEFAULT.toString())) {
+ msg += " in Container " + containerName;