Skip to content

Commit

Permalink
Issue #5032 - Using BaseHolder template T vs C
Browse files Browse the repository at this point in the history
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
  • Loading branch information
joakime committed Sep 16, 2020
1 parent aee8b93 commit c569c87
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -186,9 +186,9 @@ public synchronized boolean isInstance()
return _instance != null;
}

protected <C, W> C wrap(final C component, final Class<W> wrapperFunctionType, final BiFunction<W, C, C> function)
protected <W> T wrap(final T component, final Class<W> wrapperFunctionType, final BiFunction<W, T, T> function)
{
C ret = component;
T ret = component;
ServletContextHandler contextHandler = getServletHandler().getServletContextHandler();
if (contextHandler != null)
{
Expand All @@ -200,14 +200,14 @@ protected <C, W> C wrap(final C component, final Class<W> wrapperFunctionType, f
return ret;
}

protected <C> C unwrap(final C component)
protected T unwrap(final T component)
{
C ret = component;
T ret = component;

while (ret instanceof Wrapped)
{
// noinspection unchecked,rawtypes
ret = (C)((Wrapped)ret).getWrapped();
ret = (T)((Wrapped)ret).getWrapped();
}
return ret;
}
Expand Down

0 comments on commit c569c87

Please sign in to comment.