Continued clean up of code smells
[dmaap/datarouter.git] / datarouter-prov / src / main / java / org / onap / dmaap / datarouter / provisioning / utils / DRProvCadiFilter.java
index 8301bf9..526bfd5 100644 (file)
@@ -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
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * Unless required by applicable law or agreed to in writing, software
+ *
+ * <p>* http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * <p>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.
- * <p>
- * SPDX-License-Identifier: Apache-2.0
+ *
+ * <p>* 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;