Skip to content

Commit

Permalink
Sort availability zones in setter method
Browse files Browse the repository at this point in the history
  • Loading branch information
Russsnizza committed Sep 19, 2024
1 parent 6ffd6c1 commit 9d7db0f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/gyro/aws/rds/DbClusterResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,9 @@ public List<String> getAvailabilityZones() {
}

public void setAvailabilityZones(List<String> availabilityZones) {
Collections.sort(availabilityZones);
this.availabilityZones = availabilityZones;
List<String> modifiableList = new ArrayList<>(availabilityZones); // creates a new modifiable list
Collections.sort(modifiableList);
this.availabilityZones = modifiableList;
}

/**
Expand Down

0 comments on commit 9d7db0f

Please sign in to comment.