diff options
author | Munir Ahmad <munir.ahmad@bell.ca> | 2018-02-24 12:24:11 -0500 |
---|---|---|
committer | Munir Ahmad <munir.ahmad@bell.ca> | 2018-02-24 12:24:11 -0500 |
commit | 06907552e96482ae66a43f4d5cd735432b7ccd65 (patch) | |
tree | dd8ebbfaa6040480f5d1a0f612f790f86cab4244 /mso-api-handlers/mso-requests-db/src/main | |
parent | 6f242c09ef7b4d48c47104729a641a4bc9dd008e (diff) |
Swap for loop in favor of foreach
Change-Id: I04b3691abd958a1455f55b8b295a7f08998b8692
Issue-ID: SO-437
Signed-off-by: Munir Ahmad <munir.ahmad@bell.ca>
Diffstat (limited to 'mso-api-handlers/mso-requests-db/src/main')
-rw-r--r-- | mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java index 98121d8490..d9448d06fa 100644 --- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java +++ b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java @@ -38,6 +38,7 @@ import org.hibernate.criterion.Criterion; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; import org.openecomp.mso.db.AbstractSessionFactoryManager; +import org.openecomp.mso.requestsdb.RequestsDbConstant.Status; import org.openecomp.mso.requestsdb.RequestsDbSessionFactoryManager; import org.openecomp.mso.logger.MsoLogger; @@ -757,9 +758,9 @@ public class RequestsDatabase { int resourceCount = lstResourceStatus.size(); int progress = 0; boolean isFinished = true; - for(int i = 0; i < resourceCount; i++) { - progress = progress + Integer.valueOf(lstResourceStatus.get(i).getProgress()) / resourceCount; - if(RequestsDbConstant.Status.PROCESSING.equals(lstResourceStatus.get(i).getStatus())) { + for (ResourceOperationStatus lstResourceStatu : lstResourceStatus) { + progress = progress + Integer.valueOf(lstResourceStatu.getProgress()) / resourceCount; + if (Status.PROCESSING.equals(lstResourceStatu.getStatus())) { isFinished = false; } } |