Repository: hyperledger/quilt (java)

Issue:
Stop interning InterledgerAddress
In runtimes processing lots of STREAM payments, the ILP addresses will look something like `g.{connectorId}.{accountId}.{encryptedStreamInfo}`. For example, `test.jc.money.bob.123xyz`.

In this example, when an ILP address is created, the full address will never be re-used because the  `encryptedStreamInfo` will never be the same from packet to packet. Thus, interning the full address is not a good idea. 

That said, it _probably_ is a good idea to keep interning the `InterledgerAddressPrefix` and `AllocationScheme` because these will be duplicated over many packets.

Pull request description:
Stop interning InterledgerAddresses
fixes #418 

Patch:
diff --git a/ilp-core/src/main/java/org/interledger/core/InterledgerAddress.java b/ilp-core/src/main/java/org/interledger/core/InterledgerAddress.java
index bc05732..a038816 100644
--- a/ilp-core/src/main/java/org/interledger/core/InterledgerAddress.java
+++ b/ilp-core/src/main/java/org/interledger/core/InterledgerAddress.java
@@ -310,8 +310,7 @@ public interface InterledgerAddress {
   @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 = "[.]";


Test patch:
diff --git a/ilp-core/src/test/java/org/interledger/core/InterledgerAddressTest.java b/ilp-core/src/test/java/org/interledger/core/InterledgerAddressTest.java
index 54de93b..773ba46 100644
--- a/ilp-core/src/test/java/org/interledger/core/InterledgerAddressTest.java
+++ b/ilp-core/src/test/java/org/interledger/core/InterledgerAddressTest.java
@@ -391,7 +391,9 @@ public class InterledgerAddressTest {
     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());