Skip to content

Commit

Permalink
WICKET-7086: Fix the build for wicket-9.x
Browse files Browse the repository at this point in the history
Replace jakarta.* with javax.*
Implement ApplicationContextMock#getBeanNamesForType(ResolvableType, ...) methods

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
  • Loading branch information
martin-g committed Dec 4, 2023
1 parent 262cf30 commit 694c95c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
Expand Down Expand Up @@ -291,13 +292,23 @@ public <T> ObjectProvider<T> getBeanProvider(final ResolvableType resolvableType
@Override
public String[] getBeanNamesForType(ResolvableType resolvableType)
{
return new String[0];
return getBeanNamesForType(resolvableType, true, true);
}

@Override
public String[] getBeanNamesForType(ResolvableType resolvableType, boolean includeNonSingletons, boolean allowEagerInit)
{
return new String[0];
List<String> names = new ArrayList<>();
for (Entry<String, Object> entry : beans.entrySet())
{
Object bean = entry.getValue();

if (resolvableType.isAssignableFrom(bean.getClass()))
{
names.add(entry.getKey());
}
}
return names.toArray(new String[0]);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
package org.apache.wicket.spring.injection.annot;

import jakarta.inject.Inject;
import javax.inject.Inject;
import org.apache.wicket.injection.Injector;
import org.apache.wicket.spring.BeanWithGeneric;
import org.apache.wicket.util.tester.DummyHomePage;
Expand Down

0 comments on commit 694c95c

Please sign in to comment.