Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

Commit

Permalink
Stop interning InterledgerAddresses (#419)
Browse files Browse the repository at this point in the history
* took away intern = true in @value.Style annotation on AbstractInterledgerAddress
* equals test no longer passed, as Addresses were not interned, so i changed it

Signed-off-by: nkramer44 <noah.ph.kramer@gmail.com>
  • Loading branch information
nkramer44 authored and sappenin committed Jan 24, 2020
1 parent 59dbced commit 549c030
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,7 @@ public String getMessageFormat() {
@Value.Style(
typeBuilder = "*Builder",
visibility = Value.Style.ImplementationVisibility.PRIVATE,
builderVisibility = Value.Style.BuilderVisibility.PUBLIC,
defaults = @Value.Immutable(intern = true))
builderVisibility = Value.Style.BuilderVisibility.PUBLIC)
abstract class AbstractInterledgerAddress implements InterledgerAddress {

static final String SEPARATOR_REGEX = "[.]";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,9 @@ public void testAddressEqualsHashcode() {
final InterledgerAddress addressPrefix3 = InterledgerAddress.of("g.foo.bar");

assertThat(addressPrefix1.hashCode()).isEqualTo(addressPrefix2.hashCode());
assertThat(addressPrefix1 == addressPrefix2).isTrue();
// As of https://github.com/hyperledger/quilt/issues/418, this should NOT be true, as InterledgerAddresses
// are not interned
assertThat(addressPrefix1 == addressPrefix2).isFalse();
assertThat(addressPrefix1).isEqualTo(addressPrefix2);
assertThat(addressPrefix2).isEqualTo(addressPrefix1);
assertThat(addressPrefix1.toString()).isEqualTo(addressPrefix2.toString());
Expand Down

0 comments on commit 549c030

Please sign in to comment.