|
|
db4fc0 |
From b14ee1ef509d9717eaa29e672282901847f2f735 Mon Sep 17 00:00:00 2001
|
|
|
db4fc0 |
From: Marian Koncek <mkoncek@redhat.com>
|
|
|
db4fc0 |
Date: Mon, 16 Sep 2019 10:48:10 +0200
|
|
|
db4fc0 |
Subject: [PATCH] Remove dependency on glassfish-servlet-api
|
|
|
db4fc0 |
|
|
|
db4fc0 |
---
|
|
|
db4fc0 |
.../eclipse/sisu/inject/Implementations.java | 56 +------------------
|
|
|
db4fc0 |
1 file changed, 1 insertion(+), 55 deletions(-)
|
|
|
db4fc0 |
|
|
|
db4fc0 |
diff --git a/sisu-inject/org.eclipse.sisu.inject/src/org/eclipse/sisu/inject/Implementations.java b/sisu-inject/org.eclipse.sisu.inject/src/org/eclipse/sisu/inject/Implementations.java
|
|
|
db4fc0 |
index 523c9b2..89db5da 100644
|
|
|
db4fc0 |
--- a/sisu-inject/org.eclipse.sisu.inject/src/org/eclipse/sisu/inject/Implementations.java
|
|
|
db4fc0 |
+++ b/sisu-inject/org.eclipse.sisu.inject/src/org/eclipse/sisu/inject/Implementations.java
|
|
|
db4fc0 |
@@ -38,17 +38,6 @@ final class Implementations
|
|
|
db4fc0 |
|
|
|
db4fc0 |
static
|
|
|
db4fc0 |
{
|
|
|
db4fc0 |
- boolean hasGuiceServlet;
|
|
|
db4fc0 |
- try
|
|
|
db4fc0 |
- {
|
|
|
db4fc0 |
- hasGuiceServlet = BindingTargetVisitor.class.isInstance( ServletFinder.THIS );
|
|
|
db4fc0 |
- }
|
|
|
db4fc0 |
- catch ( final LinkageError e )
|
|
|
db4fc0 |
- {
|
|
|
db4fc0 |
- hasGuiceServlet = false;
|
|
|
db4fc0 |
- }
|
|
|
db4fc0 |
- HAS_GUICE_SERVLET = hasGuiceServlet;
|
|
|
db4fc0 |
-
|
|
|
db4fc0 |
boolean hasJsr250Priority;
|
|
|
db4fc0 |
try
|
|
|
db4fc0 |
{
|
|
|
db4fc0 |
@@ -65,8 +54,6 @@ final class Implementations
|
|
|
db4fc0 |
// Constants
|
|
|
db4fc0 |
// ----------------------------------------------------------------------
|
|
|
db4fc0 |
|
|
|
db4fc0 |
- private static final boolean HAS_GUICE_SERVLET;
|
|
|
db4fc0 |
-
|
|
|
db4fc0 |
private static final boolean HAS_JSR250_PRIORITY;
|
|
|
db4fc0 |
|
|
|
db4fc0 |
// ----------------------------------------------------------------------
|
|
|
db4fc0 |
@@ -106,7 +93,7 @@ final class Implementations
|
|
|
db4fc0 |
|
|
|
db4fc0 |
// peek behind servlet/filter extension bindings when checking priority, so we can order them by rank
|
|
|
db4fc0 |
final Class implementation =
|
|
|
db4fc0 |
- binding.acceptTargetVisitor( HAS_GUICE_SERVLET && isPriority ? ServletFinder.THIS : ClassFinder.THIS );
|
|
|
db4fc0 |
+ binding.acceptTargetVisitor( ClassFinder.THIS );
|
|
|
db4fc0 |
|
|
|
db4fc0 |
T annotation = null;
|
|
|
db4fc0 |
if ( null != implementation )
|
|
|
db4fc0 |
@@ -215,45 +202,4 @@ final class Implementations
|
|
|
db4fc0 |
return binding.getPrivateElements().getInjector().getBinding( binding.getKey() ).acceptTargetVisitor( this );
|
|
|
db4fc0 |
}
|
|
|
db4fc0 |
}
|
|
|
db4fc0 |
-
|
|
|
db4fc0 |
- /**
|
|
|
db4fc0 |
- * {@link ClassFinder} that can also peek behind servlet/filter bindings.
|
|
|
db4fc0 |
- */
|
|
|
db4fc0 |
- static final class ServletFinder
|
|
|
db4fc0 |
- extends ClassFinder
|
|
|
db4fc0 |
- implements com.google.inject.servlet.ServletModuleTargetVisitor<Object, Class<?>>
|
|
|
db4fc0 |
- {
|
|
|
db4fc0 |
- // ----------------------------------------------------------------------
|
|
|
db4fc0 |
- // Constants
|
|
|
db4fc0 |
- // ----------------------------------------------------------------------
|
|
|
db4fc0 |
-
|
|
|
db4fc0 |
- @SuppressWarnings( "hiding" )
|
|
|
db4fc0 |
- static final BindingTargetVisitor<Object, Class<?>> THIS = new ServletFinder();
|
|
|
db4fc0 |
-
|
|
|
db4fc0 |
- // ----------------------------------------------------------------------
|
|
|
db4fc0 |
- // Public methods
|
|
|
db4fc0 |
- // ----------------------------------------------------------------------
|
|
|
db4fc0 |
-
|
|
|
db4fc0 |
- public Class visit( final com.google.inject.servlet.InstanceFilterBinding binding )
|
|
|
db4fc0 |
- {
|
|
|
db4fc0 |
- return binding.getFilterInstance().getClass();
|
|
|
db4fc0 |
- }
|
|
|
db4fc0 |
-
|
|
|
db4fc0 |
- public Class visit( final com.google.inject.servlet.InstanceServletBinding binding )
|
|
|
db4fc0 |
- {
|
|
|
db4fc0 |
- return binding.getServletInstance().getClass();
|
|
|
db4fc0 |
- }
|
|
|
db4fc0 |
-
|
|
|
db4fc0 |
- public Class visit( final com.google.inject.servlet.LinkedFilterBinding binding )
|
|
|
db4fc0 |
- {
|
|
|
db4fc0 |
- // this assumes only one level of indirection: api-->impl
|
|
|
db4fc0 |
- return binding.getLinkedKey().getTypeLiteral().getRawType();
|
|
|
db4fc0 |
- }
|
|
|
db4fc0 |
-
|
|
|
db4fc0 |
- public Class visit( final com.google.inject.servlet.LinkedServletBinding binding )
|
|
|
db4fc0 |
- {
|
|
|
db4fc0 |
- // this assumes only one level of indirection: api-->impl
|
|
|
db4fc0 |
- return binding.getLinkedKey().getTypeLiteral().getRawType();
|
|
|
db4fc0 |
- }
|
|
|
db4fc0 |
- }
|
|
|
db4fc0 |
}
|
|
|
db4fc0 |
--
|
|
|
db4fc0 |
2.21.0
|
|
|
db4fc0 |
|