X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=datarouter-prov%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fdmaap%2Fdatarouter%2Fprovisioning%2Futils%2FDRProvCadiFilter.java;h=526bfd545289b22ca232257d472efc92e8e471e7;hb=06a86fa387e05f57bb1cec4295901e6d7786aa98;hp=8301bf9b1471a82649cc51075ef322558b9b275b;hpb=381d4ebc5e83d5fd5b62fff7e5a6fa6d582149d9;p=dmaap%2Fdatarouter.git diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/DRProvCadiFilter.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/DRProvCadiFilter.java index 8301bf9b..526bfd54 100644 --- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/DRProvCadiFilter.java +++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/DRProvCadiFilter.java @@ -6,16 +6,16 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - *

- * http://www.apache.org/licenses/LICENSE-2.0 - *

- * Unless required by applicable law or agreed to in writing, software + * + *

* http://www.apache.org/licenses/LICENSE-2.0 + * + *

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 * limitations under the License. - *

- * SPDX-License-Identifier: Apache-2.0 + * + *

* SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ @@ -66,9 +66,9 @@ public class DRProvCadiFilter extends CadiFilter { || pathUrl.contains("group"))) { String method = httpRequest.getMethod().toUpperCase(); - if (!(method.equals("POST"))) { + if (!("POST".equals(method))) { // if request method is PUT method (publish or Feed update) Needs to check for DELETE - if (method.equals("PUT") || method.equals("DELETE")) { + if ("PUT".equals(method) || "DELETE".equals(method)) { if ((pathUrl.contains("subs"))) { //edit subscriber int subId = BaseServlet.getIdFromPath(httpRequest); if (subId <= 0) { @@ -209,7 +209,7 @@ public class DRProvCadiFilter extends CadiFilter { try { Feed feed = Feed.getFeedById(feedId); if (feed != null) { - if (!((feed.getAafInstance().equalsIgnoreCase("legacy")) || feed.getAafInstance() == null + if (!(("legacy".equalsIgnoreCase(feed.getAafInstance())) || feed.getAafInstance() == null || feed.getAafInstance().equals(""))) { //also apply null check and empty check too aafInstance = feed.getAafInstance(); String message = "DRProvCadiFilter.isAAFFeed: aafInstance-:" + aafInstance + "; feedId:- " + feedId; @@ -241,9 +241,9 @@ public class DRProvCadiFilter extends CadiFilter { try { Subscription subscriber = Subscription.getSubscriptionById(subId); if (subscriber != null) { - if (!((subscriber.getAafInstance().equalsIgnoreCase("legacy")) + if (!(("legacy".equalsIgnoreCase(subscriber.getAafInstance())) || subscriber.getAafInstance() == null - || subscriber.getAafInstance().equals(""))) { //also apply null check and empty check too + || "".equals(subscriber.getAafInstance()))) { //also apply null check and empty check too aafInstance = subscriber.getAafInstance(); String message = "DRProvCadiFilter.isAAFSubscriber: aafInstance-:" + aafInstance + "; subId:- " + subId;