Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fixed issue with adding profile information to an unmodifiable list #448
This pull request fixes the issue outlined here: #447
The change proposed here makes a new list instead, populates it with elements of the previous list and adds the new profile. An unmodifiable view on this new list is put back into the map to be consistent with the documentation of the ResourceMetadataKeyEnum.PROFILES constant.
This approach has a squared time complexity to the number of profile declaration in the received resource. However, assuming the number of profile declarations per resource is low, this should not be a problem.
If deemed too inefficient, either the profiles list should be modifiable or another approach should be used. Perhaps a builder pattern would be adequate.