killbill-memoizeit

Details

account/pom.xml 2(+1 -1)

diff --git a/account/pom.xml b/account/pom.xml
index 3381927..417f676 100644
--- a/account/pom.xml
+++ b/account/pom.xml
@@ -19,7 +19,7 @@
     <parent>
         <artifactId>killbill</artifactId>
         <groupId>org.kill-bill.billing</groupId>
-        <version>0.19.10-SNAPSHOT</version>
+        <version>0.19.11-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <artifactId>killbill-account</artifactId>

api/pom.xml 2(+1 -1)

diff --git a/api/pom.xml b/api/pom.xml
index c7a0a58..cd2c6d5 100644
--- a/api/pom.xml
+++ b/api/pom.xml
@@ -19,7 +19,7 @@
     <parent>
         <artifactId>killbill</artifactId>
         <groupId>org.kill-bill.billing</groupId>
-        <version>0.19.10-SNAPSHOT</version>
+        <version>0.19.11-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <artifactId>killbill-internal-api</artifactId>

beatrix/pom.xml 2(+1 -1)

diff --git a/beatrix/pom.xml b/beatrix/pom.xml
index 13276df..61adc18 100644
--- a/beatrix/pom.xml
+++ b/beatrix/pom.xml
@@ -19,7 +19,7 @@
     <parent>
         <artifactId>killbill</artifactId>
         <groupId>org.kill-bill.billing</groupId>
-        <version>0.19.10-SNAPSHOT</version>
+        <version>0.19.11-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <artifactId>killbill-beatrix</artifactId>

catalog/pom.xml 2(+1 -1)

diff --git a/catalog/pom.xml b/catalog/pom.xml
index f6e5a11..abb51d5 100644
--- a/catalog/pom.xml
+++ b/catalog/pom.xml
@@ -19,7 +19,7 @@
     <parent>
         <artifactId>killbill</artifactId>
         <groupId>org.kill-bill.billing</groupId>
-        <version>0.19.10-SNAPSHOT</version>
+        <version>0.19.11-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <artifactId>killbill-catalog</artifactId>

currency/pom.xml 2(+1 -1)

diff --git a/currency/pom.xml b/currency/pom.xml
index efb61bd..62792ff 100644
--- a/currency/pom.xml
+++ b/currency/pom.xml
@@ -19,7 +19,7 @@
     <parent>
         <artifactId>killbill</artifactId>
         <groupId>org.kill-bill.billing</groupId>
-        <version>0.19.10-SNAPSHOT</version>
+        <version>0.19.11-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <artifactId>killbill-currency</artifactId>
diff --git a/entitlement/pom.xml b/entitlement/pom.xml
index 4549ace..ee7964e 100644
--- a/entitlement/pom.xml
+++ b/entitlement/pom.xml
@@ -19,7 +19,7 @@
     <parent>
         <artifactId>killbill</artifactId>
         <groupId>org.kill-bill.billing</groupId>
-        <version>0.19.10-SNAPSHOT</version>
+        <version>0.19.11-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <artifactId>killbill-entitlement</artifactId>

invoice/pom.xml 2(+1 -1)

diff --git a/invoice/pom.xml b/invoice/pom.xml
index c52b20c..d86d45c 100644
--- a/invoice/pom.xml
+++ b/invoice/pom.xml
@@ -19,7 +19,7 @@
     <parent>
         <artifactId>killbill</artifactId>
         <groupId>org.kill-bill.billing</groupId>
-        <version>0.19.10-SNAPSHOT</version>
+        <version>0.19.11-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <artifactId>killbill-invoice</artifactId>
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/InvoicePluginDispatcher.java b/invoice/src/main/java/org/killbill/billing/invoice/InvoicePluginDispatcher.java
index 59f8db4..d170b10 100644
--- a/invoice/src/main/java/org/killbill/billing/invoice/InvoicePluginDispatcher.java
+++ b/invoice/src/main/java/org/killbill/billing/invoice/InvoicePluginDispatcher.java
@@ -20,6 +20,7 @@ package org.killbill.billing.invoice;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
@@ -267,10 +268,12 @@ public class InvoicePluginDispatcher {
         return existingValue;
     }
 
-    private Map<String, InvoicePluginApi> getInvoicePlugins(final InternalTenantContext tenantContext) {
+    @VisibleForTesting
+    Map<String, InvoicePluginApi> getInvoicePlugins(final InternalTenantContext tenantContext) {
         final Collection<String> resultingPluginList = getResultingPluginNameList(tenantContext);
 
-        final Map<String, InvoicePluginApi> invoicePlugins = new HashMap<String, InvoicePluginApi>();
+        // Keys ordering matters!
+        final Map<String, InvoicePluginApi> invoicePlugins = new LinkedHashMap<String, InvoicePluginApi>();
         for (final String name : resultingPluginList) {
             final InvoicePluginApi serviceForName = pluginRegistry.getServiceForName(name);
             invoicePlugins.put(name, serviceForName);
diff --git a/invoice/src/test/java/org/killbill/billing/invoice/TestInvoicePluginDispatcher.java b/invoice/src/test/java/org/killbill/billing/invoice/TestInvoicePluginDispatcher.java
index 78d1b74..6c3922e 100644
--- a/invoice/src/test/java/org/killbill/billing/invoice/TestInvoicePluginDispatcher.java
+++ b/invoice/src/test/java/org/killbill/billing/invoice/TestInvoicePluginDispatcher.java
@@ -1,6 +1,6 @@
 /*
- * Copyright 2014-2017 Groupon, Inc
- * Copyright 2014-2017 The Billing Project, LLC
+ * Copyright 2014-2018 Groupon, Inc
+ * Copyright 2014-2018 The Billing Project, LLC
  *
  * The Billing Project licenses this file to you under the Apache License, version 2.0
  * (the "License"); you may not use this file except in compliance with the
@@ -39,9 +39,10 @@ import static org.testng.Assert.assertEquals;
 
 public class TestInvoicePluginDispatcher extends InvoiceTestSuiteNoDB {
 
-    private final String PLUGIN_1 = "plugin1";
-    private final String PLUGIN_2 = "plugin2";
-    private final String PLUGIN_3 = "plugin3";
+    // Reversed lexicographic order on purpose to test ordering
+    private final String PLUGIN_1 = "C_plugin1";
+    private final String PLUGIN_2 = "B_plugin2";
+    private final String PLUGIN_3 = "A_plugin3";
 
     @Inject
     protected InvoicePluginDispatcher invoicePluginDispatcher;
@@ -51,6 +52,7 @@ public class TestInvoicePluginDispatcher extends InvoiceTestSuiteNoDB {
     @Inject
     TenantInternalApi tenantInternalApi;
 
+    @Override
     protected KillbillConfigSource getConfigSource() {
         return getConfigSource("/resource.properties", ImmutableMap.<String, String>builder()
                 .put("org.killbill.invoice.plugin", Joiner.on(",").join(PLUGIN_1, PLUGIN_2))
@@ -68,7 +70,6 @@ public class TestInvoicePluginDispatcher extends InvoiceTestSuiteNoDB {
 
     @Test(groups = "fast")
     public void testWithNoConfig() throws Exception {
-
         // We Use the per-tenant config and specify a empty list of plugins
         Mockito.when(tenantInternalApi.getTenantConfig(Mockito.any(InternalCallContext.class))).thenReturn("{\"org.killbill.invoice.plugin\":\"\"}");
         // We register one plugin
@@ -100,11 +101,12 @@ public class TestInvoicePluginDispatcher extends InvoiceTestSuiteNoDB {
         final Iterator<String> iterator = result.iterator();
         assertEquals(iterator.next(), PLUGIN_1);
         assertEquals(iterator.next(), PLUGIN_2);
+
+        assertEquals(invoicePluginDispatcher.getInvoicePlugins(internalCallContext).keySet(), result);
     }
 
     @Test(groups = "fast")
     public void testWithIncorrectCorrectOrder() throws Exception {
-
         // 3 plugins registered in *incorrect* order and  only 2 got specified in config
         registerPlugin(PLUGIN_2);
         registerPlugin(PLUGIN_3);
@@ -115,8 +117,9 @@ public class TestInvoicePluginDispatcher extends InvoiceTestSuiteNoDB {
         final Iterator<String> iterator = result.iterator();
         assertEquals(iterator.next(), PLUGIN_1);
         assertEquals(iterator.next(), PLUGIN_2);
-    }
 
+        assertEquals(invoicePluginDispatcher.getInvoicePlugins(internalCallContext).keySet(), result);
+    }
 
     private void registerPlugin(final String plugin) {
         pluginRegistry.registerService(new OSGIServiceDescriptor() {

jaxrs/pom.xml 2(+1 -1)

diff --git a/jaxrs/pom.xml b/jaxrs/pom.xml
index 764f7ee..335c64a 100644
--- a/jaxrs/pom.xml
+++ b/jaxrs/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <artifactId>killbill</artifactId>
         <groupId>org.kill-bill.billing</groupId>
-        <version>0.19.10-SNAPSHOT</version>
+        <version>0.19.11-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <artifactId>killbill-jaxrs</artifactId>

junction/pom.xml 2(+1 -1)

diff --git a/junction/pom.xml b/junction/pom.xml
index 3d51db9..e861302 100644
--- a/junction/pom.xml
+++ b/junction/pom.xml
@@ -19,7 +19,7 @@
     <parent>
         <artifactId>killbill</artifactId>
         <groupId>org.kill-bill.billing</groupId>
-        <version>0.19.10-SNAPSHOT</version>
+        <version>0.19.11-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <artifactId>killbill-junction</artifactId>

NEWS 4(+4 -0)

diff --git a/NEWS b/NEWS
index b7c3775..cc38732 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+0.19.10
+    Entitlement and Subscription performance
+    Fix issue in invoice plugin ordering
+
 0.19.9
     Introduce thread-local dirty DB flag
     Fix NPE in bus and notifications threads

overdue/pom.xml 2(+1 -1)

diff --git a/overdue/pom.xml b/overdue/pom.xml
index 0670da2..50e64d0 100644
--- a/overdue/pom.xml
+++ b/overdue/pom.xml
@@ -19,7 +19,7 @@
     <parent>
         <artifactId>killbill</artifactId>
         <groupId>org.kill-bill.billing</groupId>
-        <version>0.19.10-SNAPSHOT</version>
+        <version>0.19.11-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <artifactId>killbill-overdue</artifactId>

payment/pom.xml 2(+1 -1)

diff --git a/payment/pom.xml b/payment/pom.xml
index 8c33f57..66b0100 100644
--- a/payment/pom.xml
+++ b/payment/pom.xml
@@ -19,7 +19,7 @@
     <parent>
         <artifactId>killbill</artifactId>
         <groupId>org.kill-bill.billing</groupId>
-        <version>0.19.10-SNAPSHOT</version>
+        <version>0.19.11-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <artifactId>killbill-payment</artifactId>

pom.xml 2(+1 -1)

diff --git a/pom.xml b/pom.xml
index 06735c7..0be4e28 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@
         <version>0.141.58</version>
     </parent>
     <artifactId>killbill</artifactId>
-    <version>0.19.10-SNAPSHOT</version>
+    <version>0.19.11-SNAPSHOT</version>
     <packaging>pom</packaging>
     <name>killbill</name>
     <description>Library for managing recurring subscriptions and the associated billing</description>
diff --git a/profiles/killbill/pom.xml b/profiles/killbill/pom.xml
index 206a11c..a06c3ac 100644
--- a/profiles/killbill/pom.xml
+++ b/profiles/killbill/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <artifactId>killbill-profiles</artifactId>
         <groupId>org.kill-bill.billing</groupId>
-        <version>0.19.10-SNAPSHOT</version>
+        <version>0.19.11-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <artifactId>killbill-profiles-killbill</artifactId>
diff --git a/profiles/killpay/pom.xml b/profiles/killpay/pom.xml
index 6d90d6f..7bd7494 100644
--- a/profiles/killpay/pom.xml
+++ b/profiles/killpay/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <artifactId>killbill-profiles</artifactId>
         <groupId>org.kill-bill.billing</groupId>
-        <version>0.19.10-SNAPSHOT</version>
+        <version>0.19.11-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <artifactId>killbill-profiles-killpay</artifactId>

profiles/pom.xml 2(+1 -1)

diff --git a/profiles/pom.xml b/profiles/pom.xml
index 355a94f..afe81c3 100644
--- a/profiles/pom.xml
+++ b/profiles/pom.xml
@@ -19,7 +19,7 @@
     <parent>
         <artifactId>killbill</artifactId>
         <groupId>org.kill-bill.billing</groupId>
-        <version>0.19.10-SNAPSHOT</version>
+        <version>0.19.11-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <artifactId>killbill-profiles</artifactId>
diff --git a/subscription/pom.xml b/subscription/pom.xml
index 53ae54d..a2d2459 100644
--- a/subscription/pom.xml
+++ b/subscription/pom.xml
@@ -19,7 +19,7 @@
     <parent>
         <artifactId>killbill</artifactId>
         <groupId>org.kill-bill.billing</groupId>
-        <version>0.19.10-SNAPSHOT</version>
+        <version>0.19.11-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <artifactId>killbill-subscription</artifactId>

tenant/pom.xml 2(+1 -1)

diff --git a/tenant/pom.xml b/tenant/pom.xml
index c83a4c3..3936329 100644
--- a/tenant/pom.xml
+++ b/tenant/pom.xml
@@ -19,7 +19,7 @@
     <parent>
         <artifactId>killbill</artifactId>
         <groupId>org.kill-bill.billing</groupId>
-        <version>0.19.10-SNAPSHOT</version>
+        <version>0.19.11-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <artifactId>killbill-tenant</artifactId>

usage/pom.xml 2(+1 -1)

diff --git a/usage/pom.xml b/usage/pom.xml
index c648b85..2858c6c 100644
--- a/usage/pom.xml
+++ b/usage/pom.xml
@@ -19,7 +19,7 @@
     <parent>
         <artifactId>killbill</artifactId>
         <groupId>org.kill-bill.billing</groupId>
-        <version>0.19.10-SNAPSHOT</version>
+        <version>0.19.11-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <artifactId>killbill-usage</artifactId>

util/pom.xml 2(+1 -1)

diff --git a/util/pom.xml b/util/pom.xml
index fe72a83..946d4c3 100644
--- a/util/pom.xml
+++ b/util/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <artifactId>killbill</artifactId>
         <groupId>org.kill-bill.billing</groupId>
-        <version>0.19.10-SNAPSHOT</version>
+        <version>0.19.11-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <artifactId>killbill-util</artifactId>