urllib icon indicating copy to clipboard operation
urllib copied to clipboard

Immutable classes getters should return unmodifiable collections

Open cdalexndr opened this issue 7 years ago • 1 comments

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;

cdalexndr avatar Jan 11 '18 01:01 cdalexndr

Nice catch! Want to make a pull request?

On Jan 10, 2018 5:00 PM, "cdalexndr" [email protected] 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 .

EricEdens avatar Jan 11 '18 06:01 EricEdens