code cleanup pull-request feedback

Signed-off-by: Michael Hirsch <michael.hirsch@bosch-si.com>
This commit is contained in:
Michael Hirsch
2016-04-28 11:45:06 +02:00
parent f62b740ae8
commit 30788904be

View File

@@ -299,7 +299,7 @@ public class RolloutManagement {
* amount of given groups. In same cases this will lead to less rollout * amount of given groups. In same cases this will lead to less rollout
* groups than given by client. * groups than given by client.
* *
* @param amountGroup * @param amountOfGroups
* the amount of groups * the amount of groups
* @param conditions * @param conditions
* the rollout group conditions * the rollout group conditions
@@ -307,18 +307,17 @@ public class RolloutManagement {
* the rollout * the rollout
* @return the rollout with created groups * @return the rollout with created groups
*/ */
private Rollout createRolloutGroups(final int amountGroup, final RolloutGroupConditions conditions, private Rollout createRolloutGroups(final int amountOfGroups, final RolloutGroupConditions conditions,
final Rollout savedRollout) { final Rollout savedRollout) {
int pageIndex = 0; int pageIndex = 0;
int groupIndex = 0; int groupIndex = 0;
final Long totalCount = savedRollout.getTotalTargets(); final Long totalCount = savedRollout.getTotalTargets();
final int groupSize = (int) Math.ceil((double) totalCount / (double) amountGroup); final int groupSize = (int) Math.ceil((double) totalCount / (double) amountOfGroups);
// validate if the amount of groups that will be created are the // validate if the amount of groups that will be created are the amount
// amount
// of groups that the client what's to have created. // of groups that the client what's to have created.
int amountGroupValidated = amountGroup; int amountGroupValidated = amountOfGroups;
final int amountGroupCreation = (int) (Math.ceil((double) totalCount / (double) groupSize)); final int amountGroupCreation = (int) (Math.ceil((double) totalCount / (double) groupSize));
if (amountGroupCreation == (amountGroup - 1)) { if (amountGroupCreation == (amountOfGroups - 1)) {
amountGroupValidated--; amountGroupValidated--;
} }
RolloutGroup lastSavedGroup = null; RolloutGroup lastSavedGroup = null;