From f0954415a54b0dc11040f815970d287e14e63309 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 24 Jul 2014 12:50:48 -0400 Subject: sisu-inject-bootstrap: don't remove the beans package --- rules/sisu-inject-bootstrap/delete.list | 1 - .../sisu-inject-bootstrap/no-guice-unstable.patch | 96 ++++++++++++++++++++++ 2 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 rules/sisu-inject-bootstrap/no-guice-unstable.patch (limited to 'rules') diff --git a/rules/sisu-inject-bootstrap/delete.list b/rules/sisu-inject-bootstrap/delete.list index 6b5f115..de9e211 100644 --- a/rules/sisu-inject-bootstrap/delete.list +++ b/rules/sisu-inject-bootstrap/delete.list @@ -1,2 +1 @@ org.eclipse.sisu.inject/src/org/eclipse/sisu/launch/InjectedTest.java -org.eclipse.sisu.inject/src/org/eclipse/sisu/bean/ diff --git a/rules/sisu-inject-bootstrap/no-guice-unstable.patch b/rules/sisu-inject-bootstrap/no-guice-unstable.patch new file mode 100644 index 0000000..3c53b41 --- /dev/null +++ b/rules/sisu-inject-bootstrap/no-guice-unstable.patch @@ -0,0 +1,96 @@ +diff -ru sisu-inject-bootstrap.orig/org.eclipse.sisu.inject/src/org/eclipse/sisu/bean/BeanScheduler.java sisu-inject-bootstrap/org.eclipse.sisu.inject/src/org/eclipse/sisu/bean/BeanScheduler.java +--- sisu-inject-bootstrap.orig/org.eclipse.sisu.inject/src/org/eclipse/sisu/bean/BeanScheduler.java 2014-07-22 20:36:53.223380900 -0400 ++++ sisu-inject-bootstrap/org.eclipse.sisu.inject/src/org/eclipse/sisu/bean/BeanScheduler.java 2014-07-24 12:34:51.562456309 -0400 +@@ -29,23 +29,7 @@ + + static + { +- Object activator; +- try +- { +- // extra check in case we have both old and new versions of guice overlapping on the runtime classpath +- Binder.class.getMethod( "bindListener", Matcher.class, com.google.inject.spi.ProvisionListener[].class ); +- +- activator = new Activator(); +- } +- catch ( final Exception e ) +- { +- activator = null; +- } +- catch ( final LinkageError e ) +- { +- activator = null; +- } +- ACTIVATOR = activator; ++ ACTIVATOR = null; + } + + // ---------------------------------------------------------------------- +@@ -60,10 +44,6 @@ + { + public void configure( final Binder binder ) + { +- if ( null != ACTIVATOR ) +- { +- binder.bindListener( Matchers.any(), (com.google.inject.spi.ProvisionListener) ACTIVATOR ); +- } + } + }; + +@@ -84,21 +64,6 @@ + */ + public final void schedule( final Object bean ) + { +- if ( null != ACTIVATOR ) +- { +- final Object[] holder = getPendingHolder(); +- final Object pending = holder[0]; +- if ( pending == PLACEHOLDER ) +- { +- holder[0] = new Pending( bean ); +- return; // will be activated later +- } +- else if ( pending instanceof Pending ) +- { +- ( (Pending) pending ).add( bean ); +- return; // will be activated later +- } +- } + activate( bean ); // no ProvisionListener, so activate immediately + } + +@@ -157,34 +122,4 @@ + } + } + } +- +- /** +- * Listens to provisioning events in order to determine safe activation points. +- */ +- static final class Activator +- implements com.google.inject.spi.ProvisionListener +- { +- public void onProvision( final ProvisionInvocation pi ) +- { +- final Object[] holder = getPendingHolder(); +- if ( null == holder[0] ) +- { +- final Object pending; +- holder[0] = PLACEHOLDER; +- try +- { +- pi.provision(); // may involve nested calls/cycles +- } +- finally +- { +- pending = holder[0]; +- holder[0] = null; +- } +- if ( pending instanceof Pending ) +- { +- ( (Pending) pending ).activate(); +- } +- } +- } +- } + } -- cgit v1.2.2