fixed sonar issue in ArchiveInfraRequestsScheduler 57/64357/1
authorSandeep J <sandeejh@in.ibm.com>
Tue, 4 Sep 2018 08:41:57 +0000 (14:11 +0530)
committerSandeep J <sandeejh@in.ibm.com>
Tue, 4 Sep 2018 08:42:03 +0000 (14:12 +0530)
fixed sonar issue as detailed in SO-963

Issue-ID: SO-963
Change-Id: Id5625663fdb531c1a2136bc17b1238ae79ba8eed
Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsScheduler.java

index 9a7382f..28c56b3 100644 (file)
@@ -4,6 +4,8 @@
  * ================================================================================
  * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
+ * Modifications Copyright (C) 2018 IBM.
+ * ================================================================================
  * 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
@@ -76,14 +78,14 @@ public class ArchiveInfraRequestsScheduler {
                        requestsByEndTime = infraActiveRepo.findByEndTimeLessThan(archivingDate, pageRequest);
                        logger.debug(requestsByEndTime.size() + " requests to be archived based on End Time" );
                        archiveInfraRequests(requestsByEndTime);
-               } while(requestsByEndTime.size() > 0);
+               } while(!requestsByEndTime.isEmpty());
                
                List<InfraActiveRequests> requestsByStartTime = new ArrayList<>();
                do {
                        requestsByStartTime = infraActiveRepo.findByStartTimeLessThanAndEndTime(archivingDate, null, pageRequest);
                        logger.debug(requestsByEndTime.size() + " requests to be archived based on Start Time" );
                        archiveInfraRequests(requestsByStartTime);
-               } while(requestsByStartTime.size() > 0);
+               } while(!requestsByStartTime.isEmpty());
                
                logger.debug("End of archiveInfraRequestsScheduler");
        }