We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
版本:framework-bom 4.0.0 注解:@ Named、@ Inject 方法:AbstractResourceConfigurator:A(Class clazz)
异常:
单测例子: `` public class ComponentsConfiguratorTest {
@Test public void testA() { TestComponentsConfigurator testComponentsConfigurator = new TestComponentsConfigurator(); List<Component> components = testComponentsConfigurator.defineComponents(); String content = Configurators.forPlexus().generateXmlConfiguration(testComponentsConfigurator, components); System.out.println(content); } class TestComponentsConfigurator extends AbstractJdbcResourceConfigurator { @Override public List<Component> defineComponents() { List<Component> components = new ArrayList<>(); // method1 components.add(A(TestComponent.class)); // method2 // components.add(A(TestImpl.class)); // components.add(C(TestComponent.class).req(TestImpl.class)); return components; } } interface ITest<T> { void test(T t); } @Named(type = ITest.class, value = "test") class TestImpl implements ITest<List<String>> { @Override public void test(List<String> strings) { } } @Named class TestComponent { @Inject("test") private ITest<List<String>> t; }
} ``
原因: @ Inject修饰的范型类型为范型时,会抛这个异常
解决方式: 通过单测例子注释中的method2可以绕过去
疑惑: 但是,在foudation-service 2.7.6版本中,上述单测是没问题的,这种升级导致的异常,属于正常feature吗?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
版本:framework-bom 4.0.0
注解:@ Named、@ Inject
方法:AbstractResourceConfigurator:A(Class clazz)
异常:
单测例子:
``
public class ComponentsConfiguratorTest {
}
``
原因:
@ Inject修饰的范型类型为范型时,会抛这个异常
解决方式:
通过单测例子注释中的method2可以绕过去
疑惑:
但是,在foudation-service 2.7.6版本中,上述单测是没问题的,这种升级导致的异常,属于正常feature吗?
The text was updated successfully, but these errors were encountered: