Can't use lambda in custom panel because of old picocontainer dependency

Description

I had a strange issue when implementing a custom panel, and find out it was due to using a lambda expression inside a custom panel.

com.izforge.izpack.api.exception.IzPackException: com.izforge.izpack.api.exception.IzPackException: java.lang.reflect.InvocationTargetException
at com.izforge.izpack.installer.bootstrap.InstallerGui.run(InstallerGui.java:155)
at com.izforge.izpack.installer.bootstrap.Installer.launchInstall(Installer.java:294)
at com.izforge.izpack.installer.bootstrap.Installer.start(Installer.java:238)
at com.izforge.izpack.installer.bootstrap.Installer.main(Installer.java:78)
Caused by: com.izforge.izpack.api.exception.IzPackException: java.lang.reflect.InvocationTargetException
at com.izforge.izpack.installer.gui.InstallerController.run(InstallerController.java:74)
at com.izforge.izpack.installer.gui.InstallerController.buildInstallation(InstallerController.java:30)
at com.izforge.izpack.installer.bootstrap.InstallerGui.run(InstallerGui.java:151)
... 3 more
Caused by: java.lang.reflect.InvocationTargetException
at java.awt.EventQueue.invokeAndWait(EventQueue.java:1349)
at java.awt.EventQueue.invokeAndWait(EventQueue.java:1324)
at javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1353)
at com.izforge.izpack.installer.gui.InstallerController.run(InstallerController.java:70)
... 5 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 31489
at org.picocontainer.paranamer.BytecodeReadingParanamer$ClassReader.accept(BytecodeReadingParanamer.java:562)
at org.picocontainer.paranamer.BytecodeReadingParanamer$ClassReader.access$200(BytecodeReadingParanamer.java:337)
at org.picocontainer.paranamer.BytecodeReadingParanamer.lookupParameterNames(BytecodeReadingParanamer.java:102)
at org.picocontainer.paranamer.AdaptiveParanamer.lookupParameterNames(AdaptiveParanamer.java:75)
at org.picocontainer.paranamer.AnnotationParanamer.lookupParameterNames(AnnotationParanamer.java:110)
at org.picocontainer.paranamer.CachingParanamer.lookupParameterNames(CachingParanamer.java:75)
at org.picocontainer.injectors.ParameterNameBinding.getName(ParameterNameBinding.java:38)
at org.picocontainer.injectors.ConstructorInjector.getGreediestSatisfiableConstructor(ConstructorInjector.java:149)
at org.picocontainer.injectors.ConstructorInjector.getGreediestSatisfiableConstructor(ConstructorInjector.java:110)
at org.picocontainer.injectors.ConstructorInjector.access$100(ConstructorInjector.java:51)
at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:331)
at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:678)
at com.izforge.izpack.core.container.AbstractContainer.getComponent(AbstractContainer.java:131)
at com.izforge.izpack.core.factory.DefaultObjectFactory.create(DefaultObjectFactory.java:74)
at com.izforge.izpack.core.factory.DefaultObjectFactory.create(DefaultObjectFactory.java:102)
at com.izforge.izpack.installer.panel.AbstractPanelView.createView(AbstractPanelView.java:372)
at com.izforge.izpack.installer.panel.AbstractPanelView.getView(AbstractPanelView.java:185)
at com.izforge.izpack.installer.gui.IzPanels.initialise(IzPanels.java:80)
at com.izforge.izpack.installer.gui.InstallerFrame.buildGUI(InstallerFrame.java:374)
at com.izforge.izpack.installer.gui.InstallerController$1.run(InstallerController.java:35)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:301)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

When a replace the following code with an old school anonymous class, it just work.

checkBox.addItemListener(e -> {
ServicePanel.this.installData.setVariable("SNA_SERVICE_ENABLED", String.valueOf(checkBox.isSelected()));
argumentsTextArea.setEnabled(checkBox.isSelected());
});

Some issues on github can be found related to this error, like this one : https://github.com/six2six/fixture-factory/issues/90

picocontainer seems to be unmaintained, maybe it's time to switch to another dependency injection container ?

Environment

Windows

Assignee

Unassigned

Reporter

Rémi Alvergnat

Impact

None

Components

Affects versions

Priority

Medium