Michael Rimov
2010-12-16 16:32:43 UTC
Test case:
Reader script = new StringReader("" +
"importClass(Packages.org.picocontainer.NameBinding);\n" +
"var pico = parent.makeChildContainer() \n" +
"pico.addComponent(Packages.org.picocontainer.script.testmodel.A)\n" +
"var ca =
pico.getComponentAdapter(Packages.org.picocontainer.script.testmodel.A,
null);\n" +
"");
PicoContainer parent = new
PicoBuilder().withLifecycle().withCaching().build();
ContainerBuilder containerBuilder = new
JavascriptContainerBuilder(script, getClass().getClassLoader());
PicoContainer pico = buildContainer(containerBuilder, parent,
"SOME_SCOPE"); //Failure here
Fails with compilation exception since there are more than one
getComponentAdapter two-arg calls.
Is there a way to cast the null value so rhino knows which method to call,
or should I implement something like NameBinding.NULL as an alternative to a
null argument? (I'm mainly interested in a Pico 3 fix).
Thanks!
-Mike
-Mike
Reader script = new StringReader("" +
"importClass(Packages.org.picocontainer.NameBinding);\n" +
"var pico = parent.makeChildContainer() \n" +
"pico.addComponent(Packages.org.picocontainer.script.testmodel.A)\n" +
"var ca =
pico.getComponentAdapter(Packages.org.picocontainer.script.testmodel.A,
null);\n" +
"");
PicoContainer parent = new
PicoBuilder().withLifecycle().withCaching().build();
ContainerBuilder containerBuilder = new
JavascriptContainerBuilder(script, getClass().getClassLoader());
PicoContainer pico = buildContainer(containerBuilder, parent,
"SOME_SCOPE"); //Failure here
Fails with compilation exception since there are more than one
getComponentAdapter two-arg calls.
Is there a way to cast the null value so rhino knows which method to call,
or should I implement something like NameBinding.NULL as an alternative to a
null argument? (I'm mainly interested in a Pico 3 fix).
Thanks!
-Mike
-Mike