New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue with adding profile information to an unmodifiable list #448

merged 1 commit into from Sep 16, 2016


None yet
3 participants

FilipDomazet commented Sep 16, 2016

This pull request fixes the issue outlined here: #447
In short, an UnsupportedOperationException occured when parsing profile information. This was due to an attempt to add to an unmodifiable list.

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.


This comment has been minimized.

coveralls commented Sep 16, 2016

Coverage Status

Coverage decreased (-0.009%) to 87.979% when pulling 780790c on FilipDomazet:profile_parsing_fix into 1db9f72 on jamesagnew:master.

jamesagnew added a commit that referenced this pull request Sep 16, 2016

@jamesagnew jamesagnew merged commit e2f03a9 into jamesagnew:master Sep 16, 2016

1 of 2 checks passed

coverage/coveralls Coverage decreased (-0.009%) to 87.979%
continuous-integration/travis-ci/pr The Travis CI build passed

@FilipDomazet FilipDomazet deleted the FilipDomazet:profile_parsing_fix branch Oct 3, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment