From 249b5c317114a03e8b564e0294e62a749ab751f1 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: May 31 2016 08:48:46 +0000 Subject: import rh-maven33-google-guice-4.0-2.7.el7 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dc411fc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/google-guice-4.0.tar.xz diff --git a/.rh-maven33-google-guice.metadata b/.rh-maven33-google-guice.metadata new file mode 100644 index 0000000..4cf0130 --- /dev/null +++ b/.rh-maven33-google-guice.metadata @@ -0,0 +1 @@ +9ba04af3af21f7a19078d6141fdcf34b2f1df3a6 SOURCES/google-guice-4.0.tar.xz diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/0001-Revert-Some-work-on-issue-910-ensure-that-anonymous-.patch b/SOURCES/0001-Revert-Some-work-on-issue-910-ensure-that-anonymous-.patch new file mode 100644 index 0000000..77abf33 --- /dev/null +++ b/SOURCES/0001-Revert-Some-work-on-issue-910-ensure-that-anonymous-.patch @@ -0,0 +1,456 @@ +From 31b1e22561d5db89abfd09a8ecd9932d20f5eda3 Mon Sep 17 00:00:00 2001 +From: Mikolaj Izdebski +Date: Mon, 18 May 2015 12:05:45 +0200 +Subject: [PATCH] Revert "Some work on issue 910 -- ensure that anonymous keys + & typeliterals don't" + +This reverts commit 825f8c1df885b9d7643a9e18e336984f0138edaf. +--- + .../com/google/inject/internal/InjectorImpl.java | 1 - + core/src/com/google/inject/internal/MoreTypes.java | 37 ++----------------- + core/src/com/google/inject/spi/Dependency.java | 3 +- + core/src/com/google/inject/spi/Elements.java | 14 +++---- + core/test/com/google/inject/Asserts.java | 42 --------------------- + core/test/com/google/inject/KeyTest.java | 43 ---------------------- + .../com/google/inject/internal/WeakKeySetTest.java | 11 +++++- + .../google/inject/internal/WeakKeySetUtils.java | 42 +++++++++++++++++++++ + .../google/inject/multibindings/MapBinderTest.java | 3 +- + .../inject/multibindings/OptionalBinderTest.java | 3 +- + 10 files changed, 62 insertions(+), 137 deletions(-) + +diff --git a/core/src/com/google/inject/internal/InjectorImpl.java b/core/src/com/google/inject/internal/InjectorImpl.java +index 54ce8a3..d260046 100644 +--- a/core/src/com/google/inject/internal/InjectorImpl.java ++++ b/core/src/com/google/inject/internal/InjectorImpl.java +@@ -801,7 +801,6 @@ final class InjectorImpl implements Injector, Lookups { + throw errors.childBindingAlreadySet(key, sources).toException(); + } + +- key = MoreTypes.canonicalizeKey(key); // before storing the key long-term, canonicalize it. + BindingImpl binding = createJustInTimeBinding(key, errors, jitDisabled, jitType); + state.parent().blacklist(key, state, binding.getSource()); + jitBindings.put(key, binding); +diff --git a/core/src/com/google/inject/internal/MoreTypes.java b/core/src/com/google/inject/internal/MoreTypes.java +index bdf6029..12a7625 100644 +--- a/core/src/com/google/inject/internal/MoreTypes.java ++++ b/core/src/com/google/inject/internal/MoreTypes.java +@@ -23,7 +23,6 @@ import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.base.Objects; + import com.google.common.collect.ImmutableMap; + import com.google.inject.ConfigurationException; +-import com.google.inject.Key; + import com.google.inject.TypeLiteral; + import com.google.inject.util.Types; + +@@ -65,25 +64,6 @@ public class MoreTypes { + .build(); + + /** +- * Returns a key that doesn't hold any references to parent classes. +- * This is necessary for anonymous keys, so ensure we don't hold a ref +- * to the containing module (or class) forever. +- */ +- public static Key canonicalizeKey(Key key) { +- // If we know this isn't a subclass, return as-is. +- // Otherwise, recreate the key to avoid the subclass +- if (key.getClass() == Key.class) { +- return key; +- } else if (key.getAnnotation() != null) { +- return Key.get(key.getTypeLiteral(), key.getAnnotation()); +- } else if (key.getAnnotationType() != null) { +- return Key.get(key.getTypeLiteral(), key.getAnnotationType()); +- } else { +- return Key.get(key.getTypeLiteral()); +- } +- } +- +- /** + * Returns an type that's appropriate for use in a key. + * + *

If the raw type of {@code typeLiteral} is a {@code javax.inject.Provider}, this returns a +@@ -113,20 +93,9 @@ public class MoreTypes { + + @SuppressWarnings("unchecked") + TypeLiteral wrappedPrimitives = (TypeLiteral) PRIMITIVE_TO_WRAPPER.get(typeLiteral); +- if (wrappedPrimitives != null) { +- return wrappedPrimitives; +- } +- +- // If we know this isn't a subclass, return as-is. +- if (typeLiteral.getClass() == TypeLiteral.class) { +- return typeLiteral; +- } +- +- // recreate the TypeLiteral to avoid anonymous TypeLiterals from holding refs to their +- // surrounding classes. +- @SuppressWarnings("unchecked") +- TypeLiteral recreated = (TypeLiteral) TypeLiteral.get(typeLiteral.getType()); +- return recreated; ++ return wrappedPrimitives != null ++ ? wrappedPrimitives ++ : typeLiteral; + } + + /** +diff --git a/core/src/com/google/inject/spi/Dependency.java b/core/src/com/google/inject/spi/Dependency.java +index f86e255..c51d87c 100644 +--- a/core/src/com/google/inject/spi/Dependency.java ++++ b/core/src/com/google/inject/spi/Dependency.java +@@ -22,7 +22,6 @@ import com.google.common.base.Objects; + import com.google.common.collect.ImmutableSet; + import com.google.common.collect.Lists; + import com.google.inject.Key; +-import com.google.inject.internal.MoreTypes; + + import java.util.List; + import java.util.Set; +@@ -55,7 +54,7 @@ public final class Dependency { + * nullable. + */ + public static Dependency get(Key key) { +- return new Dependency(null, MoreTypes.canonicalizeKey(key), true, -1); ++ return new Dependency(null, key, true, -1); + } + + /** +diff --git a/core/src/com/google/inject/spi/Elements.java b/core/src/com/google/inject/spi/Elements.java +index 9348276..f5bbe89 100644 +--- a/core/src/com/google/inject/spi/Elements.java ++++ b/core/src/com/google/inject/spi/Elements.java +@@ -44,7 +44,6 @@ import com.google.inject.internal.ConstantBindingBuilderImpl; + import com.google.inject.internal.Errors; + import com.google.inject.internal.ExposureBuilder; + import com.google.inject.internal.InternalFlags.IncludeStackTraceOption; +-import com.google.inject.internal.MoreTypes; + import com.google.inject.internal.PrivateElementsImpl; + import com.google.inject.internal.ProviderMethodsModule; + import com.google.inject.internal.util.SourceProvider; +@@ -243,14 +242,13 @@ public final class Elements { + + @Override + public void requestInjection(TypeLiteral type, T instance) { +- elements.add(new InjectionRequest(getElementSource(), MoreTypes.canonicalizeForKey(type), +- instance)); ++ elements.add(new InjectionRequest(getElementSource(), type, instance)); + } + + @Override + public MembersInjector getMembersInjector(final TypeLiteral typeLiteral) { +- final MembersInjectorLookup element = new MembersInjectorLookup(getElementSource(), +- MoreTypes.canonicalizeForKey(typeLiteral)); ++ final MembersInjectorLookup element ++ = new MembersInjectorLookup(getElementSource(), typeLiteral); + elements.add(element); + return element.getMembersInjector(); + } +@@ -372,8 +370,7 @@ public final class Elements { + } + + public AnnotatedBindingBuilder bind(Key key) { +- BindingBuilder builder = +- new BindingBuilder(this, elements, getElementSource(), MoreTypes.canonicalizeKey(key)); ++ BindingBuilder builder = new BindingBuilder(this, elements, getElementSource(), key); + return builder; + } + +@@ -483,8 +480,7 @@ public final class Elements { + }; + } + +- ExposureBuilder builder = +- new ExposureBuilder(this, getElementSource(), MoreTypes.canonicalizeKey(key)); ++ ExposureBuilder builder = new ExposureBuilder(this, getElementSource(), key); + privateElements.addExposureBuilder(builder); + return builder; + } +diff --git a/core/test/com/google/inject/Asserts.java b/core/test/com/google/inject/Asserts.java +index 6c63158..363e161 100644 +--- a/core/test/com/google/inject/Asserts.java ++++ b/core/test/com/google/inject/Asserts.java +@@ -21,14 +21,12 @@ import static com.google.inject.internal.InternalFlags.IncludeStackTraceOption; + import static com.google.inject.internal.InternalFlags.getIncludeStackTraceOption; + import static junit.framework.Assert.assertEquals; + import static junit.framework.Assert.assertNotNull; +-import static junit.framework.Assert.assertSame; + import static junit.framework.Assert.assertTrue; + + import com.google.common.base.Function; + import com.google.common.base.Joiner; + import com.google.common.collect.ImmutableList; + import com.google.common.collect.Iterables; +-import com.google.common.testing.GcFinalization; + + import junit.framework.Assert; + +@@ -38,8 +36,6 @@ import java.io.IOException; + import java.io.NotSerializableException; + import java.io.ObjectInputStream; + import java.io.ObjectOutputStream; +-import java.lang.ref.ReferenceQueue; +-import java.lang.ref.WeakReference; + + /** + * @author jessewilson@google.com (Jesse Wilson) +@@ -163,42 +159,4 @@ public class Asserts { + } catch (NotSerializableException expected) { + } + } +- +- public static void awaitFullGc() { +- // GcFinalization *should* do it, but doesn't work well in practice... +- // so we put a second latch and wait for a ReferenceQueue to tell us. +- ReferenceQueue queue = new ReferenceQueue(); +- WeakReference ref = new WeakReference(new Object(), queue); +- GcFinalization.awaitFullGc(); +- try { +- assertSame("queue didn't return ref in time", ref, queue.remove(5000)); +- } catch (IllegalArgumentException e) { +- throw new RuntimeException(e); +- } catch (InterruptedException e) { +- throw new RuntimeException(e); +- } +- } +- +- public static void awaitClear(WeakReference ref) { +- // GcFinalization *should* do it, but doesn't work well in practice... +- // so we put a second latch and wait for a ReferenceQueue to tell us. +- Object data = ref.get(); +- ReferenceQueue queue = null; +- WeakReference extraRef = null; +- if (data != null) { +- queue = new ReferenceQueue(); +- extraRef = new WeakReference(data, queue); +- data = null; +- } +- GcFinalization.awaitClear(ref); +- if (queue != null) { +- try { +- assertSame("queue didn't return ref in time", extraRef, queue.remove(5000)); +- } catch (IllegalArgumentException e) { +- throw new RuntimeException(e); +- } catch (InterruptedException e) { +- throw new RuntimeException(e); +- } +- } +- } + } +diff --git a/core/test/com/google/inject/KeyTest.java b/core/test/com/google/inject/KeyTest.java +index d9dd943..c0401e0 100644 +--- a/core/test/com/google/inject/KeyTest.java ++++ b/core/test/com/google/inject/KeyTest.java +@@ -19,12 +19,10 @@ package com.google.inject; + import static com.google.inject.Asserts.assertContains; + import static com.google.inject.Asserts.assertEqualsBothWays; + import static com.google.inject.Asserts.assertNotSerializable; +-import static com.google.inject.Asserts.awaitClear; + import static java.lang.annotation.RetentionPolicy.RUNTIME; + + import com.google.inject.name.Named; + import com.google.inject.name.Names; +-import com.google.inject.spi.Dependency; + import com.google.inject.util.Types; + + import junit.framework.TestCase; +@@ -33,15 +31,12 @@ import java.io.IOException; + import java.lang.annotation.ElementType; + import java.lang.annotation.Retention; + import java.lang.annotation.Target; +-import java.lang.ref.WeakReference; + import java.lang.reflect.Method; + import java.lang.reflect.ParameterizedType; + import java.lang.reflect.Type; + import java.lang.reflect.TypeVariable; +-import java.util.ArrayList; + import java.util.List; + import java.util.Map; +-import java.util.concurrent.atomic.AtomicReference; + + /** + * @author crazybob@google.com (Bob Lee) +@@ -280,42 +275,4 @@ public class KeyTest extends TestCase { + @Marker + class HasAnnotations {} + +- public void testAnonymousClassesDontHoldRefs() { +- final AtomicReference>> stringProvider = +- new AtomicReference>>(); +- final AtomicReference>> intProvider = +- new AtomicReference>>(); +- final Object foo = new Object() { +- @SuppressWarnings("unused") @Inject List list; +- }; +- Module module = new AbstractModule() { +- @Override protected void configure() { +- bind(new Key>() {}).toInstance(new ArrayList()); +- bind(new TypeLiteral>() {}).toInstance(new ArrayList()); +- +- stringProvider.set(getProvider(new Key>() {})); +- intProvider.set(binder().getProvider(Dependency.get(new Key>() {}))); +- +- binder().requestInjection(new TypeLiteral() {}, foo); +- } +- }; +- WeakReference moduleRef = new WeakReference(module); +- final Injector injector = Guice.createInjector(module); +- module = null; +- awaitClear(moduleRef); // Make sure anonymous keys & typeliterals don't hold the module. +- +- Runnable runner = new Runnable() { +- @Override public void run() { +- injector.getInstance(new Key>() {}); +- injector.getInstance(Key.get(new TypeLiteral>() {})); +- } +- }; +- WeakReference runnerRef = new WeakReference(runner); +- runner.run(); +- runner = null; +- awaitClear(runnerRef); // also make sure anonymous keys & typeliterals don't hold for JITs +- } +- +- static class Typed {} +- + } +diff --git a/core/test/com/google/inject/internal/WeakKeySetTest.java b/core/test/com/google/inject/internal/WeakKeySetTest.java +index 4a81ebb..3797d88 100644 +--- a/core/test/com/google/inject/internal/WeakKeySetTest.java ++++ b/core/test/com/google/inject/internal/WeakKeySetTest.java +@@ -16,13 +16,13 @@ + + package com.google.inject.internal; + +-import static com.google.inject.Asserts.awaitClear; +-import static com.google.inject.Asserts.awaitFullGc; + import static com.google.inject.internal.WeakKeySetUtils.assertBlacklisted; + import static com.google.inject.internal.WeakKeySetUtils.assertInSet; + import static com.google.inject.internal.WeakKeySetUtils.assertNotBlacklisted; + import static com.google.inject.internal.WeakKeySetUtils.assertNotInSet; + import static com.google.inject.internal.WeakKeySetUtils.assertSourceNotInSet; ++import static com.google.inject.internal.WeakKeySetUtils.awaitClear; ++import static com.google.inject.internal.WeakKeySetUtils.awaitFullGc; + + import com.google.common.collect.ImmutableList; + import com.google.common.collect.ImmutableMap; +@@ -34,6 +34,13 @@ import com.google.inject.Injector; + import com.google.inject.Key; + import com.google.inject.Scope; + import com.google.inject.TypeLiteral; ++import com.google.inject.internal.BindingImpl; ++import com.google.inject.internal.Errors; ++/*if[AOP]*/ ++import com.google.inject.internal.MethodAspect; ++/*end[AOP]*/ ++import com.google.inject.internal.State; ++import com.google.inject.internal.WeakKeySet; + import com.google.inject.spi.ModuleAnnotatedMethodScannerBinding; + import com.google.inject.spi.ProvisionListenerBinding; + import com.google.inject.spi.ScopeBinding; +diff --git a/core/test/com/google/inject/internal/WeakKeySetUtils.java b/core/test/com/google/inject/internal/WeakKeySetUtils.java +index b023aa1..bab9e92 100644 +--- a/core/test/com/google/inject/internal/WeakKeySetUtils.java ++++ b/core/test/com/google/inject/internal/WeakKeySetUtils.java +@@ -18,11 +18,15 @@ import static junit.framework.Assert.assertEquals; + import static junit.framework.Assert.assertFalse; + import static junit.framework.Assert.assertNotNull; + import static junit.framework.Assert.assertNull; ++import static junit.framework.Assert.assertSame; + import static junit.framework.Assert.assertTrue; + ++import com.google.common.testing.GcFinalization; + import com.google.inject.Injector; + import com.google.inject.Key; + ++import java.lang.ref.ReferenceQueue; ++import java.lang.ref.WeakReference; + import java.util.Set; + + /** +@@ -34,6 +38,44 @@ public final class WeakKeySetUtils { + + private WeakKeySetUtils() {} + ++ public static void awaitFullGc() { ++ // GcFinalization *should* do it, but doesn't work well in practice... ++ // so we put a second latch and wait for a ReferenceQueue to tell us. ++ ReferenceQueue queue = new ReferenceQueue(); ++ WeakReference ref = new WeakReference(new Object(), queue); ++ GcFinalization.awaitFullGc(); ++ try { ++ assertSame("queue didn't return ref in time", ref, queue.remove(5000)); ++ } catch (IllegalArgumentException e) { ++ throw new RuntimeException(e); ++ } catch (InterruptedException e) { ++ throw new RuntimeException(e); ++ } ++ } ++ ++ public static void awaitClear(WeakReference ref) { ++ // GcFinalization *should* do it, but doesn't work well in practice... ++ // so we put a second latch and wait for a ReferenceQueue to tell us. ++ Object data = ref.get(); ++ ReferenceQueue queue = null; ++ WeakReference extraRef = null; ++ if (data != null) { ++ queue = new ReferenceQueue(); ++ extraRef = new WeakReference(data, queue); ++ data = null; ++ } ++ GcFinalization.awaitClear(ref); ++ if (queue != null) { ++ try { ++ assertSame("queue didn't return ref in time", extraRef, queue.remove(5000)); ++ } catch (IllegalArgumentException e) { ++ throw new RuntimeException(e); ++ } catch (InterruptedException e) { ++ throw new RuntimeException(e); ++ } ++ } ++ } ++ + public static void assertBlacklisted(Injector injector, Key key) { + assertBlacklistState(injector, key, true); + } +diff --git a/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java b/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java +index 4206521..849993f 100644 +--- a/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java ++++ b/extensions/multibindings/test/com/google/inject/multibindings/MapBinderTest.java +@@ -32,7 +32,6 @@ import com.google.common.collect.Iterables; + import com.google.common.collect.Maps; + import com.google.common.collect.Sets; + import com.google.inject.AbstractModule; +-import com.google.inject.Asserts; + import com.google.inject.Binding; + import com.google.inject.BindingAnnotation; + import com.google.inject.ConfigurationException; +@@ -1026,7 +1025,7 @@ public class MapBinderTest extends TestCase { + // Clear the ref, GC, and ensure that we are no longer blacklisting. + childInjector = null; + +- Asserts.awaitClear(weakRef); ++ WeakKeySetUtils.awaitClear(weakRef); + WeakKeySetUtils.assertNotBlacklisted(parentInjector, mapKey); + } + } +diff --git a/extensions/multibindings/test/com/google/inject/multibindings/OptionalBinderTest.java b/extensions/multibindings/test/com/google/inject/multibindings/OptionalBinderTest.java +index f3c9f63..d0a239a 100644 +--- a/extensions/multibindings/test/com/google/inject/multibindings/OptionalBinderTest.java ++++ b/extensions/multibindings/test/com/google/inject/multibindings/OptionalBinderTest.java +@@ -30,7 +30,6 @@ import com.google.common.collect.Iterables; + import com.google.common.collect.Lists; + import com.google.common.collect.Sets; + import com.google.inject.AbstractModule; +-import com.google.inject.Asserts; + import com.google.inject.Binding; + import com.google.inject.BindingAnnotation; + import com.google.inject.CreationException; +@@ -1204,7 +1203,7 @@ public class OptionalBinderTest extends TestCase { + // Clear the ref, GC, and ensure that we are no longer blacklisting. + childInjector = null; + +- Asserts.awaitClear(weakRef); ++ WeakKeySetUtils.awaitClear(weakRef); + WeakKeySetUtils.assertNotBlacklisted(parentInjector, Key.get(Integer.class)); + } + +-- +2.1.0 + diff --git a/SOURCES/GUICE_492_slf4j_logger_injection.patch b/SOURCES/GUICE_492_slf4j_logger_injection.patch new file mode 100644 index 0000000..b6aefa5 --- /dev/null +++ b/SOURCES/GUICE_492_slf4j_logger_injection.patch @@ -0,0 +1,153 @@ +Description: Provide built-in injection of SLF4J loggers +Author: Stuart McCulloch +Bug-Google: http://code.google.com/p/google-guice/issues/detail?id=492 +Last-Update: 2014-11-07 + +diff --git a/common.xml b/common.xml +index a23eb90..2d3d9b3 100644 +--- a/common.xml ++++ b/common.xml +@@ -44,6 +44,10 @@ + + + ++ ++ ++ ++ + + + +diff --git a/core/pom.xml b/core/pom.xml +index 33e6dcc..edfa724 100644 +--- a/core/pom.xml ++++ b/core/pom.xml +@@ -15,6 +15,12 @@ + + + ++ org.slf4j ++ slf4j-api ++ 1.6.4 ++ true ++ ++ + javax.inject + javax.inject + +@@ -91,6 +97,12 @@ + maven-surefire-plugin + + ++ ++ org.slf4j:slf4j-api ++ ++ + +@@ -113,6 +125,7 @@ + ${project.artifactId}$(if;$(classes;NAMED;*.MethodAspect);; (no_aop)) + !net.sf.cglib.*,!org.objectweb.asm.*,!com.google.inject.*,* + true ++ org.slf4j + + + +diff --git a/core/src/com/google/inject/internal/InjectorShell.java b/core/src/com/google/inject/internal/InjectorShell.java +index 6100879..56b13b3 100644 +--- a/core/src/com/google/inject/internal/InjectorShell.java ++++ b/core/src/com/google/inject/internal/InjectorShell.java +@@ -251,6 +251,15 @@ final class InjectorShell { + new ProviderInstanceBindingImpl(injector, key, + SourceProvider.UNKNOWN_SOURCE, loggerFactory, Scoping.UNSCOPED, + loggerFactory, ImmutableSet.of())); ++ ++ try { ++ Key slf4jKey = Key.get(org.slf4j.Logger.class); ++ SLF4JLoggerFactory slf4jLoggerFactory = new SLF4JLoggerFactory(injector); ++ injector.state.putBinding(slf4jKey, ++ new ProviderInstanceBindingImpl(injector, slf4jKey, ++ SourceProvider.UNKNOWN_SOURCE, slf4jLoggerFactory, Scoping.UNSCOPED, ++ slf4jLoggerFactory, ImmutableSet.of())); ++ } catch (Throwable e) {} + } + + private static class LoggerFactory implements InternalFactory, Provider { +@@ -270,6 +279,44 @@ final class InjectorShell { + } + } + ++ private static class SLF4JLoggerFactory implements InternalFactory, Provider { ++ private final Injector injector; ++ ++ private org.slf4j.ILoggerFactory loggerFactory; ++ ++ SLF4JLoggerFactory(Injector injector) { ++ this.injector = injector; ++ } ++ ++ org.slf4j.ILoggerFactory loggerFactory() { ++ if (loggerFactory == null) { ++ try { ++ loggerFactory = injector.getInstance(org.slf4j.ILoggerFactory.class); ++ } catch (Throwable e) {} ++ if (loggerFactory == null) { ++ loggerFactory = org.slf4j.LoggerFactory.getILoggerFactory(); ++ } ++ } ++ return loggerFactory; ++ } ++ ++ public org.slf4j.Logger get(Errors errors, InternalContext context, Dependency dependency, boolean linked) { ++ InjectionPoint injectionPoint = dependency.getInjectionPoint(); ++ if (injectionPoint != null) { ++ return loggerFactory().getLogger(injectionPoint.getMember().getDeclaringClass().getName()); ++ } ++ return loggerFactory().getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME); ++ } ++ ++ public org.slf4j.Logger get() { ++ return loggerFactory().getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME); ++ } ++ ++ public String toString() { ++ return "Provider"; ++ } ++ } ++ + private static void bindStage(InjectorImpl injector, Stage stage) { + Key key = Key.get(Stage.class); + InstanceBindingImpl stageBinding = new InstanceBindingImpl( +diff --git a/extensions/persist/pom.xml b/extensions/persist/pom.xml +index a560f38..e909927 100644 +--- a/extensions/persist/pom.xml ++++ b/extensions/persist/pom.xml +@@ -29,7 +29,7 @@ + + org.slf4j + slf4j-simple +- 1.6.1 ++ 1.6.4 + test + + +diff --git a/lib/build/slf4j-api-1.6.4.jar b/lib/build/slf4j-api-1.6.4.jar +new file mode 100644 +index 0000000..76ef305 +Binary files /dev/null and b/lib/build/slf4j-api-1.6.4.jar differ +diff --git a/pom.xml b/pom.xml +index 37305d0..5834d49 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -283,7 +283,7 @@ See the Apache License Version 2.0 for the specific language governing permissio + + + maven-surefire-plugin +- 2.5 ++ 2.6 + + true + diff --git a/SOURCES/GUICE_618_extensible_filter_pipeline.patch b/SOURCES/GUICE_618_extensible_filter_pipeline.patch new file mode 100644 index 0000000..bbad0e7 --- /dev/null +++ b/SOURCES/GUICE_618_extensible_filter_pipeline.patch @@ -0,0 +1,1053 @@ +Description: Let sub-classes of GuiceFilter customize the servlet filter pipeline +Author: Stuart McCulloch +Bug-Google: http://code.google.com/p/google-guice/issues/detail?id=618 +Last-Update: 2015-01-20 + +diff --git a/extensions/servlet/src/com/google/inject/servlet/AbstractFilterPipeline.java b/extensions/servlet/src/com/google/inject/servlet/AbstractFilterPipeline.java +new file mode 100644 +index 0000000..ab8f746 +--- /dev/null ++++ b/extensions/servlet/src/com/google/inject/servlet/AbstractFilterPipeline.java +@@ -0,0 +1,150 @@ ++/** ++ * Copyright (C) 2008 Google Inc. ++ * ++ * Licensed under the Apache License, Version 2.0 (the "License"); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++package com.google.inject.servlet; ++ ++import com.google.common.collect.Sets; ++import com.google.inject.Injector; ++import com.google.inject.Provider; ++ ++import java.io.IOException; ++import java.util.Set; ++ ++import javax.servlet.Filter; ++import javax.servlet.FilterChain; ++import javax.servlet.RequestDispatcher; ++import javax.servlet.ServletContext; ++import javax.servlet.ServletException; ++import javax.servlet.ServletRequest; ++import javax.servlet.ServletResponse; ++import javax.servlet.http.HttpServletRequest; ++import javax.servlet.http.HttpServletRequestWrapper; ++ ++/** ++ * Skeleton implementation of a central routing/dispatch class which uses a sequence of ++ * {@link FilterDefinition}s to filter requests before delegating to the servlet pipeline. ++ * ++ * @author dhanji@gmail.com (Dhanji R. Prasanna) ++ */ ++public abstract class AbstractFilterPipeline implements FilterPipeline { ++ ++ private final AbstractServletPipeline servletPipeline; ++ private final Provider servletContext; ++ ++ //Unfortunately, we need the injector itself in order to create filters + servlets ++ private final Injector injector; ++ ++ //Guards a DCL, so needs to be volatile ++ private volatile boolean initialized = false; ++ ++ protected AbstractFilterPipeline(Injector injector, AbstractServletPipeline servletPipeline, ++ Provider servletContext) { ++ this.injector = injector; ++ this.servletPipeline = servletPipeline; ++ this.servletContext = servletContext; ++ } ++ ++ /** ++ * @return {@code true} if any filter mappings exist; otherwise {@code false} ++ */ ++ protected abstract boolean hasFiltersMapped(); ++ ++ /** ++ * @return snapshot of the filter mappings currently defined for this pipeline ++ */ ++ protected abstract FilterDefinition[] filterDefinitions(); ++ ++ public synchronized void initPipeline(ServletContext servletContext) ++ throws ServletException { ++ ++ //double-checked lock, prevents duplicate initialization ++ if (initialized) ++ return; ++ ++ // Used to prevent duplicate initialization. ++ Set initializedSoFar = Sets.newIdentityHashSet(); ++ ++ for (FilterDefinition filterDefinition : filterDefinitions()) { ++ filterDefinition.init(servletContext, injector, initializedSoFar); ++ } ++ ++ //next, initialize servlets... ++ servletPipeline.init(servletContext, injector); ++ ++ //everything was ok... ++ initialized = true; ++ } ++ ++ public void dispatch(ServletRequest request, ServletResponse response, ++ FilterChain proceedingFilterChain) throws IOException, ServletException { ++ ++ //lazy init of filter pipeline (OK by the servlet specification). This is needed ++ //in order for us not to force users to create a GuiceServletContextListener subclass. ++ if (!initialized) { ++ initPipeline(servletContext.get()); ++ } ++ ++ //obtain the servlet pipeline to dispatch against ++ new FilterChainInvocation(filterDefinitions(), servletPipeline, proceedingFilterChain) ++ .doFilter(withDispatcher(request, servletPipeline), response); ++ ++ } ++ ++ /** ++ * Used to create an proxy that dispatches either to the guice-servlet pipeline or the regular ++ * pipeline based on uri-path match. This proxy also provides minimal forwarding support. ++ * ++ * We cannot forward from a web.xml Servlet/JSP to a guice-servlet (because the filter pipeline ++ * is not called again). However, we can wrap requests with our own dispatcher to forward the ++ * *other* way. web.xml Servlets/JSPs can forward to themselves as per normal. ++ * ++ * This is not a problem cuz we intend for people to migrate from web.xml to guice-servlet, ++ * incrementally, but not the other way around (which, we should actively discourage). ++ */ ++ @SuppressWarnings({ "JavaDoc", "deprecation" }) ++ private ServletRequest withDispatcher(ServletRequest servletRequest, ++ final AbstractServletPipeline servletPipeline) { ++ ++ // don't wrap the request if there are no servlets mapped. This prevents us from inserting our ++ // wrapper unless it's actually going to be used. This is necessary for compatibility for apps ++ // that downcast their HttpServletRequests to a concrete implementation. ++ if (!servletPipeline.hasServletsMapped()) { ++ return servletRequest; ++ } ++ ++ HttpServletRequest request = (HttpServletRequest) servletRequest; ++ //noinspection OverlyComplexAnonymousInnerClass ++ return new HttpServletRequestWrapper(request) { ++ ++ @Override ++ public RequestDispatcher getRequestDispatcher(String path) { ++ final RequestDispatcher dispatcher = servletPipeline.getRequestDispatcher(path); ++ ++ return (null != dispatcher) ? dispatcher : super.getRequestDispatcher(path); ++ } ++ }; ++ } ++ ++ public void destroyPipeline() { ++ //destroy servlets first ++ servletPipeline.destroy(); ++ ++ //go down chain and destroy all our filters ++ Set destroyedSoFar = Sets.newIdentityHashSet(); ++ for (FilterDefinition filterDefinition : filterDefinitions()) { ++ filterDefinition.destroy(destroyedSoFar); ++ } ++ } ++} +diff --git a/extensions/servlet/src/com/google/inject/servlet/AbstractServletPipeline.java b/extensions/servlet/src/com/google/inject/servlet/AbstractServletPipeline.java +new file mode 100644 +index 0000000..811820a +--- /dev/null ++++ b/extensions/servlet/src/com/google/inject/servlet/AbstractServletPipeline.java +@@ -0,0 +1,187 @@ ++/** ++ * Copyright (C) 2008 Google Inc. ++ * ++ * Licensed under the Apache License, Version 2.0 (the "License"); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++package com.google.inject.servlet; ++ ++import com.google.common.base.Preconditions; ++import com.google.common.collect.Sets; ++import com.google.inject.Injector; ++ ++import java.io.IOException; ++import java.util.Set; ++ ++import javax.servlet.RequestDispatcher; ++import javax.servlet.ServletContext; ++import javax.servlet.ServletException; ++import javax.servlet.ServletRequest; ++import javax.servlet.ServletResponse; ++import javax.servlet.http.HttpServlet; ++import javax.servlet.http.HttpServletRequest; ++import javax.servlet.http.HttpServletRequestWrapper; ++ ++/** ++ * Skeleton implementation of a wrapping dispatcher for servlets based on a sequence of ++ * {@link ServletDefinition}s, much like {@link AbstractFilterPipeline} is for filters. ++ * ++ * @author dhanji@gmail.com (Dhanji R. Prasanna) ++ */ ++public abstract class AbstractServletPipeline { ++ ++ /** ++ * @return {@code true} if any servlet mappings exist; otherwise {@code false} ++ */ ++ protected abstract boolean hasServletsMapped(); ++ ++ /** ++ * @return snapshot of the servlet mappings currently defined for this pipeline ++ */ ++ protected abstract ServletDefinition[] servletDefinitions(); ++ ++ void init(ServletContext servletContext, Injector injector) throws ServletException { ++ Set initializedSoFar = Sets.newIdentityHashSet(); ++ ++ for (ServletDefinition servletDefinition : servletDefinitions()) { ++ servletDefinition.init(servletContext, injector, initializedSoFar); ++ } ++ } ++ ++ boolean service(ServletRequest request, ServletResponse response) ++ throws IOException, ServletException { ++ ++ //stop at the first matching servlet and service ++ for (ServletDefinition servletDefinition : servletDefinitions()) { ++ if (servletDefinition.service(request, response)) { ++ return true; ++ } ++ } ++ ++ //there was no match... ++ return false; ++ } ++ ++ void destroy() { ++ Set destroyedSoFar = Sets.newIdentityHashSet(); ++ for (ServletDefinition servletDefinition : servletDefinitions()) { ++ servletDefinition.destroy(destroyedSoFar); ++ } ++ } ++ ++ /** ++ * @return Returns a request dispatcher wrapped with a servlet mapped to ++ * the given path or null if no mapping was found. ++ */ ++ RequestDispatcher getRequestDispatcher(String path) { ++ final String newRequestUri = path; ++ ++ // TODO(dhanji): check servlet spec to see if the following is legal or not. ++ // Need to strip query string if requested... ++ ++ for (final ServletDefinition servletDefinition : servletDefinitions()) { ++ if (servletDefinition.shouldServe(path)) { ++ return new RequestDispatcher() { ++ public void forward(ServletRequest servletRequest, ServletResponse servletResponse) ++ throws ServletException, IOException { ++ Preconditions.checkState(!servletResponse.isCommitted(), ++ "Response has been committed--you can only call forward before" ++ + " committing the response (hint: don't flush buffers)"); ++ ++ // clear buffer before forwarding ++ servletResponse.resetBuffer(); ++ ++ ServletRequest requestToProcess; ++ if (servletRequest instanceof HttpServletRequest) { ++ requestToProcess = wrapRequest((HttpServletRequest)servletRequest, newRequestUri); ++ } else { ++ // This should never happen, but instead of throwing an exception ++ // we will allow a happy case pass thru for maximum tolerance to ++ // legacy (and internal) code. ++ requestToProcess = servletRequest; ++ } ++ ++ // now dispatch to the servlet ++ doServiceImpl(servletDefinition, requestToProcess, servletResponse); ++ } ++ ++ public void include(ServletRequest servletRequest, ServletResponse servletResponse) ++ throws ServletException, IOException { ++ // route to the target servlet ++ doServiceImpl(servletDefinition, servletRequest, servletResponse); ++ } ++ ++ private void doServiceImpl(ServletDefinition servletDefinition, ServletRequest servletRequest, ++ ServletResponse servletResponse) throws ServletException, IOException { ++ servletRequest.setAttribute(REQUEST_DISPATCHER_REQUEST, Boolean.TRUE); ++ ++ try { ++ servletDefinition.doService(servletRequest, servletResponse); ++ } finally { ++ servletRequest.removeAttribute(REQUEST_DISPATCHER_REQUEST); ++ } ++ } ++ }; ++ } ++ } ++ ++ //otherwise, can't process ++ return null; ++ } ++ ++ // visible for testing ++ static HttpServletRequest wrapRequest(HttpServletRequest request, String newUri) { ++ return new RequestDispatcherRequestWrapper(request, newUri); ++ } ++ ++ /** ++ * A Marker constant attribute that when present in the request indicates to Guice servlet that ++ * this request has been generated by a request dispatcher rather than the servlet pipeline. ++ * In accordance with section 8.4.2 of the Servlet 2.4 specification. ++ */ ++ static final String REQUEST_DISPATCHER_REQUEST = "javax.servlet.forward.servlet_path"; ++ ++ private static class RequestDispatcherRequestWrapper extends HttpServletRequestWrapper { ++ private final String newRequestUri; ++ ++ RequestDispatcherRequestWrapper(HttpServletRequest servletRequest, String newRequestUri) { ++ super(servletRequest); ++ this.newRequestUri = newRequestUri; ++ } ++ ++ @Override ++ public String getRequestURI() { ++ return newRequestUri; ++ } ++ ++ @Override ++ public StringBuffer getRequestURL() { ++ StringBuffer url = new StringBuffer(); ++ String scheme = getScheme(); ++ int port = getServerPort(); ++ ++ url.append(scheme); ++ url.append("://"); ++ url.append(getServerName()); ++ // port might be -1 in some cases (see java.net.URL.getPort) ++ if (port > 0 && ++ (("http".equals(scheme) && (port != 80)) || ++ ("https".equals(scheme) && (port != 443)))) { ++ url.append(':'); ++ url.append(port); ++ } ++ url.append(getRequestURI()); ++ ++ return (url); ++ } ++ } ++} +diff --git a/extensions/servlet/src/com/google/inject/servlet/FilterChainInvocation.java b/extensions/servlet/src/com/google/inject/servlet/FilterChainInvocation.java +index b4112cf..bfe5a83 100644 +--- a/extensions/servlet/src/com/google/inject/servlet/FilterChainInvocation.java ++++ b/extensions/servlet/src/com/google/inject/servlet/FilterChainInvocation.java +@@ -50,7 +50,7 @@ class FilterChainInvocation implements FilterChain { + + private final FilterDefinition[] filterDefinitions; + private final FilterChain proceedingChain; +- private final ManagedServletPipeline servletPipeline; ++ private final AbstractServletPipeline servletPipeline; + + //state variable tracks current link in filterchain + private int index = -1; +@@ -58,7 +58,7 @@ class FilterChainInvocation implements FilterChain { + private boolean cleanedStacks = false; + + public FilterChainInvocation(FilterDefinition[] filterDefinitions, +- ManagedServletPipeline servletPipeline, FilterChain proceedingChain) { ++ AbstractServletPipeline servletPipeline, FilterChain proceedingChain) { + + this.filterDefinitions = filterDefinitions; + this.servletPipeline = servletPipeline; +diff --git a/extensions/servlet/src/com/google/inject/servlet/FilterDefinition.java b/extensions/servlet/src/com/google/inject/servlet/FilterDefinition.java +index ff1e5b6..76ece31 100644 +--- a/extensions/servlet/src/com/google/inject/servlet/FilterDefinition.java ++++ b/extensions/servlet/src/com/google/inject/servlet/FilterDefinition.java +@@ -37,11 +37,11 @@ import javax.servlet.ServletException; + import javax.servlet.http.HttpServletRequest; + + /** +- * An internal representation of a filter definition against a particular URI pattern. ++ * Defines a filter mapped to a URI pattern and performs the request filtering for that filter. + * + * @author dhanji@gmail.com (Dhanji R. Prasanna) + */ +-class FilterDefinition implements ProviderWithExtensionVisitor { ++public class FilterDefinition implements ProviderWithExtensionVisitor { + private final String pattern; + private final Key filterKey; + private final UriPatternMatcher patternMatcher; +@@ -90,7 +90,7 @@ class FilterDefinition implements ProviderWithExtensionVisitor + return uri != null && patternMatcher.matches(uri); + } + +- public void init(final ServletContext servletContext, Injector injector, ++ void init(final ServletContext servletContext, Injector injector, + Set initializedSoFar) throws ServletException { + + // This absolutely must be a singleton, and so is only initialized once. +@@ -130,7 +130,7 @@ class FilterDefinition implements ProviderWithExtensionVisitor + initializedSoFar.add(filter); + } + +- public void destroy(Set destroyedSoFar) { ++ void destroy(Set destroyedSoFar) { + // filters are always singletons + Filter reference = filter.get(); + +@@ -150,7 +150,7 @@ class FilterDefinition implements ProviderWithExtensionVisitor + } + } + +- public Filter getFilterIfMatching(HttpServletRequest request) { ++ Filter getFilterIfMatching(HttpServletRequest request) { + + final String path = ServletUtils.getContextRelativePath(request); + if (shouldFilter(path)) { +diff --git a/extensions/servlet/src/com/google/inject/servlet/FilterPipeline.java b/extensions/servlet/src/com/google/inject/servlet/FilterPipeline.java +index 985064b..c745d20 100644 +--- a/extensions/servlet/src/com/google/inject/servlet/FilterPipeline.java ++++ b/extensions/servlet/src/com/google/inject/servlet/FilterPipeline.java +@@ -26,7 +26,7 @@ import javax.servlet.ServletRequest; + import javax.servlet.ServletResponse; + + /** +- * An internal dispatcher for guice-servlet registered servlets and filters. ++ * A dispatcher abstraction for guice-servlet registered servlets and filters. + * By default, we assume a Guice 1.0 style servlet module is in play. In other + * words, we dispatch directly to the web.xml pipeline after setting up scopes. + * +@@ -39,10 +39,27 @@ import javax.servlet.ServletResponse; + * @author dhanji@gmail.com (Dhanji R. Prasanna) + */ + @ImplementedBy(DefaultFilterPipeline.class) +-interface FilterPipeline { ++public interface FilterPipeline { ++ ++ /** ++ * Initializes the pipeline, putting it into service. ++ * ++ * @param context of the web application ++ */ + void initPipeline(ServletContext context) throws ServletException; ++ ++ /** ++ * Destroys the pipeline, taking it out of service. ++ */ + void destroyPipeline(); + ++ /** ++ * Dispatches a request against the pipeline. ++ * ++ * @param request to dispatch ++ * @param response to populate ++ * @param defaultFilterChain for last resort filtering ++ */ + void dispatch(ServletRequest request, ServletResponse response, + FilterChain defaultFilterChain) throws IOException, ServletException; + } +diff --git a/extensions/servlet/src/com/google/inject/servlet/GuiceFilter.java b/extensions/servlet/src/com/google/inject/servlet/GuiceFilter.java +index ba7a5af..0737b38 100644 +--- a/extensions/servlet/src/com/google/inject/servlet/GuiceFilter.java ++++ b/extensions/servlet/src/com/google/inject/servlet/GuiceFilter.java +@@ -89,7 +89,7 @@ public class GuiceFilter implements Filter { + this(null); + } + +- @Inject GuiceFilter(FilterPipeline filterPipeline) { ++ @Inject protected GuiceFilter(FilterPipeline filterPipeline) { + injectedPipeline = filterPipeline; + } + +diff --git a/extensions/servlet/src/com/google/inject/servlet/ManagedFilterPipeline.java b/extensions/servlet/src/com/google/inject/servlet/ManagedFilterPipeline.java +index 538e10a..76bc269 100644 +--- a/extensions/servlet/src/com/google/inject/servlet/ManagedFilterPipeline.java ++++ b/extensions/servlet/src/com/google/inject/servlet/ManagedFilterPipeline.java +@@ -16,7 +16,6 @@ + package com.google.inject.servlet; + + import com.google.common.collect.Lists; +-import com.google.common.collect.Sets; + import com.google.inject.Binding; + import com.google.inject.Inject; + import com.google.inject.Injector; +@@ -24,50 +23,41 @@ import com.google.inject.Provider; + import com.google.inject.Singleton; + import com.google.inject.TypeLiteral; + +-import java.io.IOException; + import java.util.List; +-import java.util.Set; + +-import javax.servlet.Filter; +-import javax.servlet.FilterChain; +-import javax.servlet.RequestDispatcher; + import javax.servlet.ServletContext; +-import javax.servlet.ServletException; +-import javax.servlet.ServletRequest; +-import javax.servlet.ServletResponse; +-import javax.servlet.http.HttpServletRequest; +-import javax.servlet.http.HttpServletRequestWrapper; + + /** +- * Central routing/dispatch class handles lifecycle of managed filters, and delegates to the servlet +- * pipeline. ++ * Managed implementation of a central routing/dispatch class which handles lifecycle of managed ++ * filters, and delegates to a managed servlet pipeline. + * + * @author dhanji@gmail.com (Dhanji R. Prasanna) + */ + @Singleton +-class ManagedFilterPipeline implements FilterPipeline{ ++class ManagedFilterPipeline extends AbstractFilterPipeline { + private final FilterDefinition[] filterDefinitions; +- private final ManagedServletPipeline servletPipeline; +- private final Provider servletContext; + +- //Unfortunately, we need the injector itself in order to create filters + servlets +- private final Injector injector; +- +- //Guards a DCL, so needs to be volatile +- private volatile boolean initialized = false; + private static final TypeLiteral FILTER_DEFS = + TypeLiteral.get(FilterDefinition.class); + + @Inject + public ManagedFilterPipeline(Injector injector, ManagedServletPipeline servletPipeline, + Provider servletContext) { +- this.injector = injector; +- this.servletPipeline = servletPipeline; +- this.servletContext = servletContext; ++ super(injector, servletPipeline, servletContext); + + this.filterDefinitions = collectFilterDefinitions(injector); + } + ++ @Override ++ protected boolean hasFiltersMapped() { ++ return filterDefinitions.length > 0; ++ } ++ ++ @Override ++ protected FilterDefinition[] filterDefinitions() { ++ return filterDefinitions; ++ } ++ + /** + * Introspects the injector and collects all instances of bound {@code List} + * into a master list. +@@ -84,86 +74,4 @@ class ManagedFilterPipeline implements FilterPipeline{ + // Copy to a fixed-size array for speed of iteration. + return filterDefinitions.toArray(new FilterDefinition[filterDefinitions.size()]); + } +- +- public synchronized void initPipeline(ServletContext servletContext) +- throws ServletException { +- +- //double-checked lock, prevents duplicate initialization +- if (initialized) +- return; +- +- // Used to prevent duplicate initialization. +- Set initializedSoFar = Sets.newIdentityHashSet(); +- +- for (FilterDefinition filterDefinition : filterDefinitions) { +- filterDefinition.init(servletContext, injector, initializedSoFar); +- } +- +- //next, initialize servlets... +- servletPipeline.init(servletContext, injector); +- +- //everything was ok... +- initialized = true; +- } +- +- public void dispatch(ServletRequest request, ServletResponse response, +- FilterChain proceedingFilterChain) throws IOException, ServletException { +- +- //lazy init of filter pipeline (OK by the servlet specification). This is needed +- //in order for us not to force users to create a GuiceServletContextListener subclass. +- if (!initialized) { +- initPipeline(servletContext.get()); +- } +- +- //obtain the servlet pipeline to dispatch against +- new FilterChainInvocation(filterDefinitions, servletPipeline, proceedingFilterChain) +- .doFilter(withDispatcher(request, servletPipeline), response); +- +- } +- +- /** +- * Used to create an proxy that dispatches either to the guice-servlet pipeline or the regular +- * pipeline based on uri-path match. This proxy also provides minimal forwarding support. +- * +- * We cannot forward from a web.xml Servlet/JSP to a guice-servlet (because the filter pipeline +- * is not called again). However, we can wrap requests with our own dispatcher to forward the +- * *other* way. web.xml Servlets/JSPs can forward to themselves as per normal. +- * +- * This is not a problem cuz we intend for people to migrate from web.xml to guice-servlet, +- * incrementally, but not the other way around (which, we should actively discourage). +- */ +- @SuppressWarnings({ "JavaDoc", "deprecation" }) +- private ServletRequest withDispatcher(ServletRequest servletRequest, +- final ManagedServletPipeline servletPipeline) { +- +- // don't wrap the request if there are no servlets mapped. This prevents us from inserting our +- // wrapper unless it's actually going to be used. This is necessary for compatibility for apps +- // that downcast their HttpServletRequests to a concrete implementation. +- if (!servletPipeline.hasServletsMapped()) { +- return servletRequest; +- } +- +- HttpServletRequest request = (HttpServletRequest) servletRequest; +- //noinspection OverlyComplexAnonymousInnerClass +- return new HttpServletRequestWrapper(request) { +- +- @Override +- public RequestDispatcher getRequestDispatcher(String path) { +- final RequestDispatcher dispatcher = servletPipeline.getRequestDispatcher(path); +- +- return (null != dispatcher) ? dispatcher : super.getRequestDispatcher(path); +- } +- }; +- } +- +- public void destroyPipeline() { +- //destroy servlets first +- servletPipeline.destroy(); +- +- //go down chain and destroy all our filters +- Set destroyedSoFar = Sets.newIdentityHashSet(); +- for (FilterDefinition filterDefinition : filterDefinitions) { +- filterDefinition.destroy(destroyedSoFar); +- } +- } + } +diff --git a/extensions/servlet/src/com/google/inject/servlet/ManagedServletPipeline.java b/extensions/servlet/src/com/google/inject/servlet/ManagedServletPipeline.java +index 455551a..ab58a8e 100644 +--- a/extensions/servlet/src/com/google/inject/servlet/ManagedServletPipeline.java ++++ b/extensions/servlet/src/com/google/inject/servlet/ManagedServletPipeline.java +@@ -15,27 +15,14 @@ + */ + package com.google.inject.servlet; + +-import com.google.common.base.Preconditions; + import com.google.common.collect.Lists; +-import com.google.common.collect.Sets; + import com.google.inject.Binding; + import com.google.inject.Inject; + import com.google.inject.Injector; + import com.google.inject.Singleton; + import com.google.inject.TypeLiteral; + +-import java.io.IOException; + import java.util.List; +-import java.util.Set; +- +-import javax.servlet.RequestDispatcher; +-import javax.servlet.ServletContext; +-import javax.servlet.ServletException; +-import javax.servlet.ServletRequest; +-import javax.servlet.ServletResponse; +-import javax.servlet.http.HttpServlet; +-import javax.servlet.http.HttpServletRequest; +-import javax.servlet.http.HttpServletRequestWrapper; + + /** + * A wrapping dispatcher for servlets, in much the same way as {@link ManagedFilterPipeline} is for +@@ -44,7 +31,7 @@ import javax.servlet.http.HttpServletRequestWrapper; + * @author dhanji@gmail.com (Dhanji R. Prasanna) + */ + @Singleton +-class ManagedServletPipeline { ++class ManagedServletPipeline extends AbstractServletPipeline { + private final ServletDefinition[] servletDefinitions; + private static final TypeLiteral SERVLET_DEFS = + TypeLiteral.get(ServletDefinition.class); +@@ -54,10 +41,16 @@ class ManagedServletPipeline { + this.servletDefinitions = collectServletDefinitions(injector); + } + +- boolean hasServletsMapped() { ++ @Override ++ protected boolean hasServletsMapped() { + return servletDefinitions.length > 0; + } + ++ @Override ++ protected ServletDefinition[] servletDefinitions() { ++ return servletDefinitions; ++ } ++ + /** + * Introspects the injector and collects all instances of bound {@code List} + * into a master list. +@@ -74,140 +67,4 @@ class ManagedServletPipeline { + // Copy to a fixed size array for speed. + return servletDefinitions.toArray(new ServletDefinition[servletDefinitions.size()]); + } +- +- public void init(ServletContext servletContext, Injector injector) throws ServletException { +- Set initializedSoFar = Sets.newIdentityHashSet(); +- +- for (ServletDefinition servletDefinition : servletDefinitions) { +- servletDefinition.init(servletContext, injector, initializedSoFar); +- } +- } +- +- public boolean service(ServletRequest request, ServletResponse response) +- throws IOException, ServletException { +- +- //stop at the first matching servlet and service +- for (ServletDefinition servletDefinition : servletDefinitions) { +- if (servletDefinition.service(request, response)) { +- return true; +- } +- } +- +- //there was no match... +- return false; +- } +- +- public void destroy() { +- Set destroyedSoFar = Sets.newIdentityHashSet(); +- for (ServletDefinition servletDefinition : servletDefinitions) { +- servletDefinition.destroy(destroyedSoFar); +- } +- } +- +- /** +- * @return Returns a request dispatcher wrapped with a servlet mapped to +- * the given path or null if no mapping was found. +- */ +- RequestDispatcher getRequestDispatcher(String path) { +- final String newRequestUri = path; +- +- // TODO(dhanji): check servlet spec to see if the following is legal or not. +- // Need to strip query string if requested... +- +- for (final ServletDefinition servletDefinition : servletDefinitions) { +- if (servletDefinition.shouldServe(path)) { +- return new RequestDispatcher() { +- public void forward(ServletRequest servletRequest, ServletResponse servletResponse) +- throws ServletException, IOException { +- Preconditions.checkState(!servletResponse.isCommitted(), +- "Response has been committed--you can only call forward before" +- + " committing the response (hint: don't flush buffers)"); +- +- // clear buffer before forwarding +- servletResponse.resetBuffer(); +- +- ServletRequest requestToProcess; +- if (servletRequest instanceof HttpServletRequest) { +- requestToProcess = wrapRequest((HttpServletRequest)servletRequest, newRequestUri); +- } else { +- // This should never happen, but instead of throwing an exception +- // we will allow a happy case pass thru for maximum tolerance to +- // legacy (and internal) code. +- requestToProcess = servletRequest; +- } +- +- // now dispatch to the servlet +- doServiceImpl(servletDefinition, requestToProcess, servletResponse); +- } +- +- public void include(ServletRequest servletRequest, ServletResponse servletResponse) +- throws ServletException, IOException { +- // route to the target servlet +- doServiceImpl(servletDefinition, servletRequest, servletResponse); +- } +- +- private void doServiceImpl(ServletDefinition servletDefinition, ServletRequest servletRequest, +- ServletResponse servletResponse) throws ServletException, IOException { +- servletRequest.setAttribute(REQUEST_DISPATCHER_REQUEST, Boolean.TRUE); +- +- try { +- servletDefinition.doService(servletRequest, servletResponse); +- } finally { +- servletRequest.removeAttribute(REQUEST_DISPATCHER_REQUEST); +- } +- } +- }; +- } +- } +- +- //otherwise, can't process +- return null; +- } +- +- // visible for testing +- static HttpServletRequest wrapRequest(HttpServletRequest request, String newUri) { +- return new RequestDispatcherRequestWrapper(request, newUri); +- } +- +- /** +- * A Marker constant attribute that when present in the request indicates to Guice servlet that +- * this request has been generated by a request dispatcher rather than the servlet pipeline. +- * In accordance with section 8.4.2 of the Servlet 2.4 specification. +- */ +- public static final String REQUEST_DISPATCHER_REQUEST = "javax.servlet.forward.servlet_path"; +- +- private static class RequestDispatcherRequestWrapper extends HttpServletRequestWrapper { +- private final String newRequestUri; +- +- public RequestDispatcherRequestWrapper(HttpServletRequest servletRequest, String newRequestUri) { +- super(servletRequest); +- this.newRequestUri = newRequestUri; +- } +- +- @Override +- public String getRequestURI() { +- return newRequestUri; +- } +- +- @Override +- public StringBuffer getRequestURL() { +- StringBuffer url = new StringBuffer(); +- String scheme = getScheme(); +- int port = getServerPort(); +- +- url.append(scheme); +- url.append("://"); +- url.append(getServerName()); +- // port might be -1 in some cases (see java.net.URL.getPort) +- if (port > 0 && +- (("http".equals(scheme) && (port != 80)) || +- ("https".equals(scheme) && (port != 443)))) { +- url.append(':'); +- url.append(port); +- } +- url.append(getRequestURI()); +- +- return (url); +- } +- } + } +diff --git a/extensions/servlet/src/com/google/inject/servlet/ServletDefinition.java b/extensions/servlet/src/com/google/inject/servlet/ServletDefinition.java +index 11328ed..285ff31 100644 +--- a/extensions/servlet/src/com/google/inject/servlet/ServletDefinition.java ++++ b/extensions/servlet/src/com/google/inject/servlet/ServletDefinition.java +@@ -46,12 +46,11 @@ import javax.servlet.http.HttpServletRequestWrapper; + import javax.servlet.http.HttpServletResponse; + + /** +- * An internal representation of a servlet definition mapped to a particular URI pattern. Also +- * performs the request dispatch to that servlet. How nice and OO =) ++ * Defines a servlet mapped to a URI pattern and performs the request dispatch to that servlet. + * + * @author dhanji@gmail.com (Dhanji R. Prasanna) + */ +-class ServletDefinition implements ProviderWithExtensionVisitor { ++public class ServletDefinition implements ProviderWithExtensionVisitor { + private final String pattern; + private final Key servletKey; + private final UriPatternMatcher patternMatcher; +@@ -100,7 +99,7 @@ class ServletDefinition implements ProviderWithExtensionVisitor initializedSoFar) throws ServletException { + + // This absolutely must be a singleton, and so is only initialized once. +@@ -140,7 +139,7 @@ class ServletDefinition implements ProviderWithExtensionVisitor destroyedSoFar) { ++ void destroy(Set destroyedSoFar) { + HttpServlet reference = httpServlet.get(); + + // Do nothing if this Servlet was invalid (usually due to not being scoped +@@ -169,7 +168,7 @@ class ServletDefinition implements ProviderWithExtensionVisitor +Date: Tue Jan 20 18:51:01 2015 +0000 + + Enhance logging in filter/servlet definitions + +diff --git a/extensions/servlet/src/com/google/inject/servlet/FilterDefinition.java b/extensions/servlet/src/com/google/inject/servlet/FilterDefinition.java +index 76ece31..6819665 100644 +--- a/extensions/servlet/src/com/google/inject/servlet/FilterDefinition.java ++++ b/extensions/servlet/src/com/google/inject/servlet/FilterDefinition.java +@@ -15,6 +15,7 @@ + */ + package com.google.inject.servlet; + ++import com.google.common.base.Strings; + import com.google.common.collect.Iterators; + import com.google.inject.Injector; + import com.google.inject.Key; +@@ -29,6 +30,8 @@ import java.util.HashMap; + import java.util.Map; + import java.util.Set; + import java.util.concurrent.atomic.AtomicReference; ++import java.util.logging.Level; ++import java.util.logging.Logger; + + import javax.servlet.Filter; + import javax.servlet.FilterConfig; +@@ -42,6 +45,8 @@ import javax.servlet.http.HttpServletRequest; + * @author dhanji@gmail.com (Dhanji R. Prasanna) + */ + public class FilterDefinition implements ProviderWithExtensionVisitor { ++ private static final Logger logger = Logger.getLogger(FilterDefinition.class.getName()); ++ + private final String pattern; + private final Key filterKey; + private final UriPatternMatcher patternMatcher; +@@ -154,7 +159,11 @@ public class FilterDefinition implements ProviderWithExtensionVisitor { ++ private static final Logger logger = Logger.getLogger(ServletDefinition.class.getName()); ++ + private final String pattern; + private final Key servletKey; + private final UriPatternMatcher patternMatcher; +@@ -283,7 +288,14 @@ public class ServletDefinition implements ProviderWithExtensionVisitor../google-guice-${1}.tar.xz diff --git a/SPECS/google-guice.spec b/SPECS/google-guice.spec new file mode 100644 index 0000000..10312f0 --- /dev/null +++ b/SPECS/google-guice.spec @@ -0,0 +1,456 @@ +%global short_name guice +%global pkg_name google-%{short_name} +%{?scl:%scl_package %{pkg_name}} +%{?maven_find_provides_and_requires} + +%if 0%{?fedora} +%bcond_without extensions +%endif + +Name: %{?scl_prefix}%{pkg_name} +Version: 4.0 +Release: 2.7%{?dist} +Summary: Lightweight dependency injection framework for Java 5 and above +License: ASL 2.0 +URL: https://github.com/google/%{short_name} +BuildArch: noarch + +# ./create-tarball.sh %%{version} +Source0: %{pkg_name}-%{version}.tar.xz +Source1: create-tarball.sh + +Patch0: 0001-Revert-Some-work-on-issue-910-ensure-that-anonymous-.patch + +# Rejected upstream: https://github.com/google/guice/issues/492 +Patch100: https://raw.githubusercontent.com/sonatype/sisu-guice/master/PATCHES/GUICE_492_slf4j_logger_injection.patch +# Forwarded upstream: https://github.com/google/guice/issues/618 +Patch101: https://raw.githubusercontent.com/sonatype/sisu-guice/master/PATCHES/GUICE_618_extensible_filter_pipeline.patch + +BuildRequires: %{?scl_prefix}maven-local +BuildRequires: %{?scl_prefix}maven-remote-resources-plugin +BuildRequires: %{?scl_prefix}munge-maven-plugin +BuildRequires: %{?scl_prefix}maven-gpg-plugin +BuildRequires: %{?scl_prefix}apache-resource-bundles +BuildRequires: %{?scl_prefix_java_common}aopalliance +BuildRequires: %{?scl_prefix_java_common}atinject +BuildRequires: %{?scl_prefix_java_common}cglib +BuildRequires: %{?scl_prefix_java_common}guava +BuildRequires: %{?scl_prefix_java_common}slf4j + +%if %{with extensions} +BuildRequires: %{?scl_prefix}hibernate-jpa-2.0-api +BuildRequires: %{?scl_prefix}springframework-beans +%endif + +# Test dependencies: +%if 0 +BuildRequires: %{?scl_prefix}maven-surefire-provider-testng +BuildRequires: %{?scl_prefix}aqute-bnd +BuildRequires: %{?scl_prefix_java_common}atinject-tck +BuildRequires: %{?scl_prefix_java_common}easymock2 +BuildRequires: %{?scl_prefix_java_common}felix-framework +BuildRequires: %{?scl_prefix}hibernate3-entitymanager +BuildRequires: %{?scl_prefix}mvn(org.hsqldb:hsqldb-j5) +BuildRequires: %{?scl_prefix}testng +%endif + +%description +Put simply, Guice alleviates the need for factories and the use of new +in your Java code. Think of Guice's @Inject as the new new. You will +still need to write factories in some cases, but your code will not +depend directly on them. Your code will be easier to change, unit test +and reuse in other contexts. + +Guice embraces Java's type safe nature, especially when it comes to +features introduced in Java 5 such as generics and annotations. You +might think of Guice as filling in missing features for core +Java. Ideally, the language itself would provide most of the same +features, but until such a language comes along, we have Guice. + +Guice helps you design better APIs, and the Guice API itself sets a +good example. Guice is not a kitchen sink. We justify each feature +with at least three use cases. When in doubt, we leave it out. We +build general functionality which enables you to extend Guice rather +than adding every feature to the core framework. + +%package -n %{?scl_prefix}%{short_name}-parent +Summary: Guice parent POM + +%description -n %{?scl_prefix}%{short_name}-parent +Guice is a lightweight dependency injection framework for Java 5 +and above. This package provides parent POM for Guice modules. + +%package -n %{?scl_prefix}%{short_name}-servlet +Summary: Servlet extension module for Guice + +%description -n %{?scl_prefix}%{short_name}-servlet +Guice is a lightweight dependency injection framework for Java 5 +and above. This package provides Servlet module for Guice. + +%if %{with extensions} + +%package -n %{?scl_prefix}%{short_name}-assistedinject +Summary: AssistedInject extension module for Guice + +%description -n %{?scl_prefix}%{short_name}-assistedinject +Guice is a lightweight dependency injection framework for Java 5 +and above. This package provides AssistedInject module for Guice. + +%package -n %{?scl_prefix}%{short_name}-extensions +Summary: Extensions for Guice + +%description -n %{?scl_prefix}%{short_name}-extensions +Guice is a lightweight dependency injection framework for Java 5 +and above. This package provides extensions POM for Guice. + +%package -n %{?scl_prefix}%{short_name}-grapher +Summary: Grapher extension module for Guice + +%description -n %{?scl_prefix}%{short_name}-grapher +Guice is a lightweight dependency injection framework for Java 5 +and above. This package provides Grapher module for Guice. + +%package -n %{?scl_prefix}%{short_name}-jmx +Summary: JMX extension module for Guice + +%description -n %{?scl_prefix}%{short_name}-jmx +Guice is a lightweight dependency injection framework for Java 5 +and above. This package provides JMX module for Guice. + +%package -n %{?scl_prefix}%{short_name}-jndi +Summary: JNDI extension module for Guice + +%description -n %{?scl_prefix}%{short_name}-jndi +Guice is a lightweight dependency injection framework for Java 5 +and above. This package provides JNDI module for Guice. + +%package -n %{?scl_prefix}%{short_name}-multibindings +Summary: MultiBindings extension module for Guice + +%description -n %{?scl_prefix}%{short_name}-multibindings +Guice is a lightweight dependency injection framework for Java 5 +and above. This package provides MultiBindings module for Guice. + +%package -n %{?scl_prefix}%{short_name}-persist +Summary: Persist extension module for Guice + +%description -n %{?scl_prefix}%{short_name}-persist +Guice is a lightweight dependency injection framework for Java 5 +and above. This package provides Persist module for Guice. + +%package -n %{?scl_prefix}%{short_name}-spring +Summary: Spring extension module for Guice + +%description -n %{?scl_prefix}%{short_name}-spring +Guice is a lightweight dependency injection framework for Java 5 +and above. This package provides Spring module for Guice. + +%package -n %{?scl_prefix}%{short_name}-testlib +Summary: TestLib extension module for Guice + +%description -n %{?scl_prefix}%{short_name}-testlib +Guice is a lightweight dependency injection framework for Java 5 +and above. This package provides TestLib module for Guice. + +%package -n %{?scl_prefix}%{short_name}-throwingproviders +Summary: ThrowingProviders extension module for Guice + +%description -n %{?scl_prefix}%{short_name}-throwingproviders +Guice is a lightweight dependency injection framework for Java 5 +and above. This package provides ThrowingProviders module for Guice. + +%endif # with extensions + +%package -n %{?scl_prefix}%{short_name}-bom +Summary: Bill of Materials for Guice + +%description -n %{?scl_prefix}%{short_name}-bom +Guice is a lightweight dependency injection framework for Java 5 +and above. This package provides Bill of Materials module for Guice. + +%package javadoc +Summary: API documentation for Guice + +%description javadoc +This package provides %{summary}. + + +%prep +%setup -q -n %{pkg_name}-%{version} +%patch0 -p1 +%patch100 -p1 +%patch101 -p1 +%{?scl:scl enable %{scl} - <<"EOF"} +set -e -x + +# We don't have struts2 in Fedora yet. +%pom_disable_module struts2 extensions +# Android-specific extension +%pom_disable_module dagger-adapter extensions + +# Remove additional build profiles, which we don't use anyways +# and which are only pulling additional dependencies. +%pom_xpath_remove "pom:profile[pom:id='guice.with.jarjar']" core + +# Animal sniffer is only causing problems. Disable it for now. +%pom_remove_plugin :animal-sniffer-maven-plugin core +%pom_remove_plugin :animal-sniffer-maven-plugin extensions + +# We don't have the custom doclet used by upstream. Remove +# maven-javadoc-plugin to generate javadocs with default style. +%pom_remove_plugin :maven-javadoc-plugin + +# remove test dependency to make sure we don't produce requires +# see #1007498 +%pom_remove_dep :guava-testlib extensions +%pom_xpath_remove "pom:dependency[pom:classifier[text()='tests']]" extensions + +%pom_remove_parent +%pom_set_parent com.google.inject:guice-parent:%{version} jdk8-tests + +# Don't try to build extension modules unless they are needed +%if %{without extensions} +sed -i '//s|extensions|&/servlet|' pom.xml +%endif + +%mvn_package :jdk8-tests __noinstall + +# Don't generate auto-requires for optional dependencies +sed -i "s|true|provided|" core/pom.xml +%{?scl:EOF} + +%build +%{?scl:scl enable %{scl} - <<"EOF"} +set -e -x +%mvn_alias "com.google.inject.extensions:" "org.sonatype.sisu.inject:" + +%mvn_package :::no_aop: guice + +%mvn_file ":guice-{*}" %{short_name}/guice-@1 +%mvn_file ":guice" %{short_name}/%{pkg_name} %{pkg_name} +%mvn_alias ":guice" "org.sonatype.sisu:sisu-guice" +# Skip tests because of missing dependency guice-testlib +%mvn_build -f -s +%{?scl:EOF} + +%install +%{?scl:scl enable %{scl} - <<"EOF"} +set -e -x +%mvn_install +%{?scl:EOF} + +%files -f .mfiles-guice +%dir %{_mavenpomdir}/guice +%dir %{_javadir}/%{short_name} + +%files -n %{?scl_prefix}%{short_name}-parent -f .mfiles-guice-parent +%dir %{_mavenpomdir}/guice +%doc COPYING + +%files -n %{?scl_prefix}%{short_name}-servlet -f .mfiles-guice-servlet + +%if %{with extensions} +%files -n %{?scl_prefix}%{short_name}-assistedinject -f .mfiles-guice-assistedinject +%files -n %{?scl_prefix}%{short_name}-extensions -f .mfiles-extensions-parent +%files -n %{?scl_prefix}%{short_name}-grapher -f .mfiles-guice-grapher +%files -n %{?scl_prefix}%{short_name}-jmx -f .mfiles-guice-jmx +%files -n %{?scl_prefix}%{short_name}-jndi -f .mfiles-guice-jndi +%files -n %{?scl_prefix}%{short_name}-multibindings -f .mfiles-guice-multibindings +%files -n %{?scl_prefix}%{short_name}-persist -f .mfiles-guice-persist +%files -n %{?scl_prefix}%{short_name}-spring -f .mfiles-guice-spring +%files -n %{?scl_prefix}%{short_name}-testlib -f .mfiles-guice-testlib +%files -n %{?scl_prefix}%{short_name}-throwingproviders -f .mfiles-guice-throwingproviders +%endif # with extensions + +%files -n %{?scl_prefix}%{short_name}-bom -f .mfiles-guice-bom + +%files javadoc -f .mfiles-javadoc +%doc COPYING + + +%changelog +* Thu Apr 14 2016 Michal Srb - 4.0-2.7 +- Really fix directory ownership (Resolves: rhbz#1325866) + +* Thu Apr 14 2016 Michal Srb - 4.0-2.6 +- Fix directory ownership (Resolves: rhbz#1325866) + +* Thu Feb 11 2016 Michal Srb - 4.0-2.5 +- Fix FTBFS + +* Mon Feb 08 2016 Michal Srb - 4.0-2.4 +- Fix BR on maven-local & co. + +* Mon Feb 08 2016 Michal Srb - 4.0-2.3 +- BR aopalliance from rh-java-common SCL + +* Mon Jan 18 2016 Michal Srb - 4.0-2.2 +- Do not generate requires on optional dependencies + +* Tue Jan 12 2016 Mikolaj Izdebski - 4.0-2.1 +- SCL-ize package +- Unconditionally enable servlet extension + +* Wed Jun 17 2015 Fedora Release Engineering - 4.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Thu May 14 2015 Mikolaj Izdebski - 4.0-1 +- Update to upstream version 4.0 + +* Mon Apr 27 2015 Mikolaj Izdebski - 3.2.6-1 +- Update to upstream version 3.2.6 + +* Fri Mar 6 2015 Alexander Kurtakov 3.2.5-2 +- Drop gone tomcat-servlet-3.0-api BR, builds fine without it. + +* Fri Jan 23 2015 Michael Simacek - 3.2.5-1 +- Update to upstream version 3.2.5 + +* Mon Sep 29 2014 Mikolaj Izdebski - 3.2.4-1 +- Update to upstream version 3.2.4 + +* Fri Jun 6 2014 Mikolaj Izdebski - 3.2.2-1 +- Update to upstream version 3.2.2 + +* Wed May 28 2014 Mikolaj Izdebski - 3.2.1-2 +- Rebuild to regenerate Maven auto-requires + +* Wed Apr 16 2014 Mikolaj Izdebski - 3.2.1-1 +- Update to upstream version 3.2.1 +- Add testlib subpackage + +* Tue Mar 4 2014 Mikolaj Izdebski - 3.1.10-3 +- Fix directory ownership + +* Tue Mar 04 2014 Stanislav Ochotnicky - 3.1.10-3 +- Use Requires: java-headless rebuild (#1067528) + +* Wed Feb 19 2014 Mikolaj Izdebski - 3.1.10-2 +- Fix unowned directory + +* Tue Feb 18 2014 Mikolaj Izdebski - 3.1.10-1 +- Update to upstream version 3.1.10 + +* Mon Jan 20 2014 Mikolaj Izdebski - 3.1.9-1 +- Update to upstream version 3.1.9 + +* Mon Nov 11 2013 Mikolaj Izdebski - 3.1.8-1 +- Update to upstream version 3.1.8 + +* Wed Oct 23 2013 Mikolaj Izdebski - 3.1.3-10 +- Rebuild to regenerate broken POMs +- Related: rhbz#1021484 + +* Fri Oct 18 2013 Mikolaj Izdebski - 3.1.3-9 +- Don't force generation of pom.properties + +* Wed Sep 25 2013 Mikolaj Izdebski - 3.1.3-8 +- Install no_aop artifact after javapackages update + +* Thu Sep 12 2013 Stanislav Ochotnicky - 3.1.3-7 +- Remove dependency on tests from runtime +- Related: rhbz#1007498 + +* Tue Sep 10 2013 Mikolaj Izdebski - 3.1.3-6 +- Install no_aop artifact +- Resolves: rhbz#1006491 + +* Wed Sep 4 2013 Mikolaj Izdebski - 3.1.3-5 +- Enable pom.properties +- Resolves: rhbz#1004360 + +* Wed Aug 07 2013 Michal Srb - 3.1.3-4 +- Add create-tarball.sh script to SRPM + +* Sat Aug 03 2013 Fedora Release Engineering - 3.1.3-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Fri Aug 02 2013 Michal Srb - 3.1.3-4 +- Add create-tarball.sh script to SRPM + +* Fri Jun 28 2013 Mikolaj Izdebski - 3.1.3-3 +- Rebuild to regenerate API documentation +- Resolves: CVE-2013-1571 + +* Wed Apr 24 2013 Michal Srb - 3.1.3-2 +- Revert update to 3.1.4 (uses asm4) + +* Thu Mar 14 2013 Michal Srb - 3.1.3-1 +- Update to upstream version 3.1.3 +- Remove bundled JARs from tarball + +* Wed Feb 06 2013 Java SIG - 3.1.2-11 +- Update for https://fedoraproject.org/wiki/Fedora_19_Maven_Rebuild +- Replace maven BuildRequires with maven-local + +* Thu Jan 31 2013 Michal Srb - 3.1.2-10 +- Remove all requires +- Correct usage of xmvn's macros + +* Mon Jan 28 2013 Michal Srb - 3.1.2-9 +- Build with xmvn + +* Fri Nov 16 2012 Mikolaj Izdebski - 3.1.2-8 +- Remove README + +* Fri Nov 16 2012 Mikolaj Izdebski - 3.1.2-7 +- Repackage tarball + +* Fri Nov 9 2012 Mikolaj Izdebski - 3.1.2-6 +- Don't try to build extension modules unless they are needed + +* Fri Nov 9 2012 Mikolaj Izdebski - 3.1.2-5 +- Conditionalize %%install section too + +* Fri Nov 9 2012 Mikolaj Izdebski - 3.1.2-4 +- Conditionally disable extensions + +* Thu Nov 1 2012 Mikolaj Izdebski - 3.1.2-3 +- Update to new add_maven_depmap macro + +* Wed Oct 31 2012 Stanislav Ochotnicky - 3.1.2-2 +- Use new generated maven filelist feature from javapackages-tools + +* Fri Oct 5 2012 Mikolaj Izdebski - 3.1.2-1 +- Complete rewrite of the spec file +- New upstream, to ease future maintenance +- Build with maven instead of ant +- Split into multiple subpackages + +* Thu Jul 19 2012 Fedora Release Engineering - 3.0-0.7.rc2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Thu Feb 9 2012 Stanislav Ochotnicky - 3.0-0.6.rc2 +- Temporary fix for maven buildroots + +* Fri Jan 13 2012 Fedora Release Engineering - 3.0-0.5.rc2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Wed Oct 12 2011 Stanislav Ochotnicky - 3.0-0.4.rc2 +- Build with aqute-bnd (#745176) +- Use new maven macros +- Few packaging tweaks + +* Tue May 24 2011 Stanislav Ochotnicky - 3.0-0.3.rc2 +- Add cglib and atinject to R + +* Thu May 12 2011 Stanislav Ochotnicky - 3.0-0.2.rc2 +- Remove test and missing deps from pom.xml + +* Tue Mar 1 2011 Stanislav Ochotnicky - 3.0-0.1.rc2 +- Update to 3.0rc2 +- Changes according to new guidelines (versionless jars & javadocs) + +* Tue Feb 08 2011 Fedora Release Engineering - 2.0-4.1219svn +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Thu Oct 14 2010 Stanislav Ochotnicky - 2.0-3.1219svn +- Add java-devel >= 1:1.6.0 to BR + +* Wed Oct 13 2010 Stanislav Ochotnicky - 2.0-2.1219svn +- Moved munge repacking to prep +- Added -Dversion to change generated manifest version +- Removed http part of URL + +* Thu Oct 7 2010 Stanislav Ochotnicky - 2.0-1.1219svn +- Initial version of the package