Details
-
Type: Bug
-
Status: Resolved
-
Priority: Critical
-
Resolution: Fixed
-
Affects Version/s: 2.7
-
Fix Version/s: 2.8
-
Component/s: None
-
Labels:None
-
Testcase included:yes
-
Number of attachments :
Description
public static class ConstantParameterTestClass { public ConstantParameterTestClass(Class<String> type) { assert type != null; } } @Test public void testConstantParameterReferenceClass() { MutablePicoContainer container = createPicoContainer(null); container.addComponent(ConstantParameterTestClass.class, ConstantParameterTestClass.class, new ConstantParameter(String.class)); assertNotNull(container.getComponent(ConstantParameterTestClass.class)); }
Result:
org.picocontainer.injectors.AbstractInjector$UnsatisfiableDependenciesException: org.picocontainer.DefaultPicoContainerTestCase$ConstantParameterTestClass has unsatisfied dependency: java.lang.Class<java.lang.String> among unsatisfiable dependencies: [[java.lang.Class<java.lang.String>]] where org.picocontainer.DefaultPicoContainer@ba4211:1<| was the leaf container being asked for dependencies.
at org.picocontainer.injectors.ConstructorInjector.getGreediestSatisfiableConstructor(ConstructorInjector.java:156)
at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:184)
at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:289)
at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:229)
at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:607)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:572)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:580)
at org.picocontainer.DefaultPicoContainerTestCase.testConstantParameterReferenceClass(DefaultPicoContainerTestCase.java:839)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)
at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Completed: At revision: 5259