imgix / imgix-java

A Java client library for generating URLs with imgix
https://www.imgix.com
BSD 2-Clause "Simplified" License
19 stars 8 forks source link

fix: createSrcSet no longer mutates params #78

Closed atlawrie closed 1 year ago

atlawrie commented 1 year ago

Fixes a bug where params was mutated by the createSrcSet function.

Before

createSrcSet directly manipulated params, resulting in mutation of params after a function call. This could result in unintentional behavior if params was shared across multiple function calls.

After

createSrcSet creates a copy of params rather than manipulating it directly. params can now be safely reused across functions.

Notes

Our method of copying params functions as a deep copy due how Java implements String. If a future developer uses this PR as reference for a similar issue in this library, please note that complications might arise depending on HashMap's key value pairs.

commit-lint[bot] commented 1 year ago

Bug Fixes

Contributors

atlawrie

Commit-Lint commands
You can trigger Commit-Lint actions by commenting on this PR: - `@Commit-Lint merge patch` will merge dependabot PR on "patch" versions (X.X.Y - Y change) - `@Commit-Lint merge minor` will merge dependabot PR on "minor" versions (X.Y.Y - Y change) - `@Commit-Lint merge major` will merge dependabot PR on "major" versions (Y.Y.Y - Y change) - `@Commit-Lint merge disable` will desactivate merge dependabot PR - `@Commit-Lint review` will approve dependabot PR - `@Commit-Lint stop review` will stop approve dependabot PR
sherwinski commented 1 year ago

@atlawrie Just double checking here but did we confirm that this same issue does not exist in the createURL method as well?