FeedService-Fixed String Comparison 41/75341/1
authorDriptaroop Das <driptaroop.das@in.ibm.com>
Mon, 7 Jan 2019 07:17:10 +0000 (12:47 +0530)
committerDriptaroop Das <driptaroop.das@in.ibm.com>
Mon, 7 Jan 2019 07:17:22 +0000 (12:47 +0530)
FeedService.java - Move the "startsWith" string literal on the left side of this string comparison.

Issue-ID: DMAAP-935
Change-Id: I63c07fcb2c9aaae2dba9ecc9ee90775344ec64ed
Signed-off-by: Driptaroop Das <driptaroop.das@in.ibm.com>
src/main/java/org/onap/dmaap/dbcapi/service/FeedService.java

index baf6f2f..de18d95 100644 (file)
@@ -3,6 +3,8 @@
  * org.onap.dmaap
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ *
+ * Modifications Copyright (C) 2019 IBM.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -73,7 +75,7 @@ public class FeedService  extends BaseLoggingClass {
                for( Feed f:  feeds.values() ) {
                        boolean keep = true;
                        if ( name != null ) {
-                               if ( match != null && match.equals("startsWith") ) {
+                               if ( match != null && "startsWith".equals(match) ) {
                                        if ( ! f.getFeedName().startsWith( name ) ) {
                                                logger.info( "getAllFeeds: feedName=" + f.getFeedName() + " doesn't start with=" + name);
                                                keep = false;