2024-05-31 15:00:18 +02:00
|
|
|
--- sisu-inject/org.eclipse.sisu.inject/src/main/java/org/eclipse/sisu/inject/Implementations.java 2024-04-09 19:53:29.797479006 +0200
|
|
|
|
+++ sisu-inject/org.eclipse.sisu.inject/src/main/java/org/eclipse/sisu/inject/Implementations.java 2024-04-09 19:59:23.506494426 +0200
|
|
|
|
@@ -39,17 +39,6 @@
|
2024-05-04 00:39:47 +02:00
|
|
|
|
|
|
|
static
|
|
|
|
{
|
|
|
|
- boolean hasGuiceServlet;
|
|
|
|
- try
|
|
|
|
- {
|
|
|
|
- hasGuiceServlet = BindingTargetVisitor.class.isInstance( ServletFinder.THIS );
|
|
|
|
- }
|
|
|
|
- catch ( final LinkageError e )
|
|
|
|
- {
|
|
|
|
- hasGuiceServlet = false;
|
|
|
|
- }
|
|
|
|
- HAS_GUICE_SERVLET = hasGuiceServlet;
|
|
|
|
-
|
|
|
|
boolean hasJsr250Priority;
|
|
|
|
try
|
|
|
|
{
|
2024-05-31 15:00:18 +02:00
|
|
|
@@ -66,8 +55,6 @@
|
2024-05-04 00:39:47 +02:00
|
|
|
// Constants
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
|
|
|
|
- private static final boolean HAS_GUICE_SERVLET;
|
|
|
|
-
|
|
|
|
private static final boolean HAS_JSR250_PRIORITY;
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------
|
2024-05-31 15:00:18 +02:00
|
|
|
@@ -107,8 +94,7 @@
|
2024-05-04 00:39:47 +02:00
|
|
|
|
2024-05-31 15:00:18 +02:00
|
|
|
final Class<?> annotationSource =
|
|
|
|
// when looking for @Priority also consider annotations on providers (and servlets/filters if available)
|
|
|
|
- binding.acceptTargetVisitor( isPriority ? ( HAS_GUICE_SERVLET ? ServletFinder.THIS : ProviderFinder.THIS )
|
|
|
|
- : ClassFinder.THIS );
|
|
|
|
+ binding.acceptTargetVisitor( isPriority ? ProviderFinder.THIS : ClassFinder.THIS );
|
2024-05-04 00:39:47 +02:00
|
|
|
|
|
|
|
T annotation = null;
|
2024-05-31 15:00:18 +02:00
|
|
|
if ( null != annotationSource )
|
|
|
|
@@ -253,45 +239,4 @@
|
|
|
|
return binding.getProviderKey().getTypeLiteral().getRawType();
|
2024-05-04 00:39:47 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
-
|
|
|
|
- /**
|
2024-05-31 15:00:18 +02:00
|
|
|
- * {@link ProviderFinder} that also returns servlet/filter implementations.
|
2024-05-04 00:39:47 +02:00
|
|
|
- */
|
|
|
|
- static final class ServletFinder
|
2024-05-31 15:00:18 +02:00
|
|
|
- extends ProviderFinder
|
2024-05-04 00:39:47 +02:00
|
|
|
- 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();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
}
|