Skip to content
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

Fix #3708: javalib Inet6Address ipv6Address argumentsare now resistant to outside change. #3715

Conversation

LeeTibbert
Copy link
Contributor

Fix #3708

The ipv6Address argument to javalib Inet6Address constructors is now defensively copied.
This makes them effectively immutable to callers.

A change was also made to InetAddress equals() method to avoid the overhead of cloning the ipv6Address.
This also changed the semantics of the test from the previous loose "the address bytes match" to a more
Java/Scala idiomatic "the fields of the object match". Meaning that the hostnames, if any must match.
A "" hostname will not match a hostname.

@LeeTibbert LeeTibbert marked this pull request as ready for review January 27, 2024 22:16
@LeeTibbert
Copy link
Contributor Author

I believe this PR is ready for review when its turn comes around.

Examined the log file of failing tests: Same song, next verse.

@LeeTibbert LeeTibbert changed the title Fix #3708: javalib Inet6Address ipv6Address arguments resistant to outside change. Fix #3708: javalib Inet6Address ipv6Address argumentsare now resistant to outside change. Jan 28, 2024
@WojciechMazur WojciechMazur merged commit 2cb947c into scala-native:main Jan 29, 2024
55 of 62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

java.net.Inet*Address static methods should be making defensive copies of mutable Array arguments.
2 participants