FolderChooserSelectionListener NPE collapsing tree

This is the forum for JIDE Common Layer which is open sourced at https://github.com/jidesoft/jide-oss. Please note, JIDE technical support doesn't monitor this forum as often as other forums. Please consider subscribe for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Moderator: JIDE Support

Forum rules
Community driven forum for open source JIDE Common Layer. JIDE technical support doesn't monitor this forum as often as other forums. If you only use JIDE Common Layer, please consider subscribing for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

FolderChooserSelectionListener NPE collapsing tree

Postby ericam33 » Wed Jan 21, 2009 10:34 am

Hi,

When i use FolderChooser to select some paths to add to a project, and while navigating the available directories, i then collapse the top level directory in my folderchooser i get this exception. I'm using version 2.2.6 of the jide-components jar.

int result = folderChooser.showDialog(parent, folderChooser.getApproveButtonText());
java.lang.NullPointerException
at com.jidesoft.plaf.basic.BasicFolderChooserUI$FolderChooserSelectionListener.valueChanged(Unknown Source)
at javax.swing.JTree.fireValueChanged(Unknown Source)
at javax.swing.JTree$TreeSelectionRedirector.valueChanged(Unknown Source)
at javax.swing.tree.DefaultTreeSelectionModel.fireValueChanged(Unknown Source)
at javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(Unknown Source)
at javax.swing.tree.DefaultTreeSelectionModel.removeSelectionPaths(Unknown Source)
at javax.swing.JTree.removeDescendantSelectedPaths(Unknown Source)
at javax.swing.JTree.setExpandedState(Unknown Source)
at javax.swing.JTree.collapsePath(Unknown Source)
at javax.swing.plaf.basic.BasicTreeUI.toggleExpandState(Unknown Source)
at javax.swing.plaf.basic.BasicTreeUI.handleExpandControlClick(Unknown Source)
at javax.swing.plaf.basic.BasicTreeUI.checkForClickInExpandControl(Unknown Source)
at javax.swing.plaf.basic.BasicTreeUI$Handler.handleSelection(Unknown Source)
at javax.swing.plaf.basic.BasicTreeUI$Handler.mousePressed(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.Dialog$1.run(Unknown Source)
at java.awt.Dialog$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Unknown Source)
at javax.swing.JFileChooser.showDialog(Unknown Source)
at com.iona.artix.ds.FolderChooserHelper.showDialog(FolderChooserHelper.java:108)
at com.iona.artix.ds.designer.dialog.settings.ProjectPathsPanel.actionPerformed(ProjectPathsPanel.java:113)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.Dialog$1.run(Unknown Source)
at java.awt.Dialog$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Unknown Source)
at com.jidesoft.dialog.StandardDialog.show(Unknown Source)
at java.awt.Component.show(Unknown Source)
at java.awt.Component.setVisible(Unknown Source)
at java.awt.Window.setVisible(Unknown Source)
at java.awt.Dialog.setVisible(Unknown Source)
at com.iona.artix.ds.designer.action.project.ProjectPropertiesAction.openProperties(ProjectPropertiesAction.java:40)
at com.iona.artix.ds.designer.action.project.ProjectPropertiesAction.actionPerformed(ProjectPropertiesAction.java:33)


ProjectPropertiesAction is simply calling

ProjectPropertiesDialog d = new ProjectPropertiesDialog(getParent(), getParent().getProject());
d.setVisible(true);

I cannot upgrade the version of the jar without having to address numerous other bugs so the only option i see is to override BasicFolderChooserUI and try to fix the NPE.

Any suggestions?
Thanks
erica
ericam33
 
Posts: 14
Joined: Tue Jul 22, 2008 8:26 am

Re: FolderChooserSelectionListener NPE collapsing tree

Postby JIDE Support » Wed Jan 21, 2009 10:52 am

Could you please create a test case for it? I need to know exactly which line causes the NPE so that I can think of a solution without upgrading, if possible at all.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: FolderChooserSelectionListener NPE collapsing tree

Postby ericam33 » Fri Jan 23, 2009 5:28 am

My test case wasnt throwing the exception so it must be something i'm doing with updating the recent file list.
I did check out the 2.2.6 branch and attach the code to trace the NPE from within my application to this line in FolderChooserSelectionListener.valueChanged()

String folderPath = (e.getNewLeadSelectionPath().getLastPathComponent()).toString();

e.getNewLeadSelectionPath is null.
ericam33
 
Posts: 14
Joined: Tue Jul 22, 2008 8:26 am

Re: FolderChooserSelectionListener NPE collapsing tree

Postby ericam33 » Fri Jan 23, 2009 5:35 am

I see that in the trunk version of the same file, it does a check first to make sure something is selected
if (_fileSystemTree.getSelectionCount() > 0) {
String folderPath = (e.getNewLeadSelectionPath().getLastPathComponent()).toString();
ericam33
 
Posts: 14
Joined: Tue Jul 22, 2008 8:26 am

Re: FolderChooserSelectionListener NPE collapsing tree

Postby JIDE Support » Fri Jan 23, 2009 10:27 am

I just added an NPE check for getNewLeadSelectionPath() to make sure.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: FolderChooserSelectionListener NPE collapsing tree

Postby JIDE Support » Fri Jan 23, 2009 11:15 pm

Just so you know, 2.5.0 release should fix this NPE.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am


Return to JIDE Common Layer Open Source Project Discussion (Community Driven)

Who is online

Users browsing this forum: No registered users and 11 guests