sisu/sisu-no-dependency-on-glassfish-servlet-api.patch

85 lines
3.2 KiB
Diff

--- sisu-inject/org.eclipse.sisu.inject/src/org/eclipse/sisu/inject/Implementations.java
+++ sisu-inject/org.eclipse.sisu.inject/src/org/eclipse/sisu/inject/Implementations.java
@@ -38,17 +38,6 @@ final class Implementations
static
{
- boolean hasGuiceServlet;
- try
- {
- hasGuiceServlet = BindingTargetVisitor.class.isInstance( ServletFinder.THIS );
- }
- catch ( final LinkageError e )
- {
- hasGuiceServlet = false;
- }
- HAS_GUICE_SERVLET = hasGuiceServlet;
-
boolean hasJsr250Priority;
try
{
@@ -65,8 +54,6 @@ final class Implementations
// Constants
// ----------------------------------------------------------------------
- private static final boolean HAS_GUICE_SERVLET;
-
private static final boolean HAS_JSR250_PRIORITY;
// ----------------------------------------------------------------------
@@ -106,7 +93,7 @@ final class Implementations
// peek behind servlet/filter extension bindings when checking priority, so we can order them by rank
final Class<?> implementation =
- binding.acceptTargetVisitor( HAS_GUICE_SERVLET && isPriority ? ServletFinder.THIS : ClassFinder.THIS );
+ binding.acceptTargetVisitor( ClassFinder.THIS );
T annotation = null;
if ( null != implementation )
@@ -215,45 +202,4 @@ final class Implementations
return binding.getPrivateElements().getInjector().getBinding( binding.getKey() ).acceptTargetVisitor( this );
}
}
-
- /**
- * {@link ClassFinder} that can also peek behind servlet/filter bindings.
- */
- static final class ServletFinder
- extends ClassFinder
- implements com.google.inject.servlet.ServletModuleTargetVisitor<Object, Class<?>>
- {
- // ----------------------------------------------------------------------
- // Constants
- // ----------------------------------------------------------------------
-
- @SuppressWarnings( "hiding" )
- static final BindingTargetVisitor<Object, Class<?>> THIS = new ServletFinder();
-
- // ----------------------------------------------------------------------
- // Public methods
- // ----------------------------------------------------------------------
-
- public Class<?> visit( final com.google.inject.servlet.InstanceFilterBinding binding )
- {
- return binding.getFilterInstance().getClass();
- }
-
- public Class<?> visit( final com.google.inject.servlet.InstanceServletBinding binding )
- {
- return binding.getServletInstance().getClass();
- }
-
- public Class<?> visit( final com.google.inject.servlet.LinkedFilterBinding binding )
- {
- // this assumes only one level of indirection: api-->impl
- return binding.getLinkedKey().getTypeLiteral().getRawType();
- }
-
- public Class<?> visit( final com.google.inject.servlet.LinkedServletBinding binding )
- {
- // this assumes only one level of indirection: api-->impl
- return binding.getLinkedKey().getTypeLiteral().getRawType();
- }
- }
}