EricEdens / urllib

A modern URL toolset for Java. Compliant with RFC 3986.
Apache License 2.0
77 stars 20 forks source link

Immutable classes getters should return unmodifiable collections #1

Open cdalexndr opened 6 years ago

cdalexndr commented 6 years ago

Test case:

Url url = Urls.parse( "http://test.com/path" );
int hash = url.hashCode();
url.path().segments().add( "segment" );
int newHash = url.hashCode();
assert hash == newHash;
EricEdens commented 6 years ago

Nice catch! Want to make a pull request?

On Jan 10, 2018 5:00 PM, "cdalexndr" notifications@github.com wrote:

Test case:

Url url = Urls.parse( "http://test.com/path" ); int hash = url.hashCode(); url.path().segments().add( "segment" ); int newHash = url.hashCode(); assert hash == newHash;

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/EricEdens/urllib/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjIipUvkh4Uj1Y24cOXX7YMjdFmAJkRks5tJV0YgaJpZM4RaK5D .