[icedtea-web] Regression after refactoring for XDG specification

Jiri Vanek jvanek at redhat.com
Mon Jul 29 05:05:16 PDT 2013


On 07/27/2013 02:43 PM, Jiri Vanek wrote:
> On 07/27/2013 01:49 AM, Jacob Wisor wrote:
>> Hello,
>>
>> I get the following regression since the code has been refactored to conform to the XDG specification, at least on Windows, but it should apply to Un*x systems too.
>>
>> Exception occurred during event dispatching:
>> java.lang.NullPointerException
>>           at net.sourceforge.jnlp.cache.CacheDirectory.getDirStructure(CacheDirect
>> ory.java:56)
>>           at net.sourceforge.jnlp.controlpanel.CachePane.generateData(CachePane.ja
>> va:360)
>>           at net.sourceforge.jnlp.controlpanel.CachePane.populateTable(CachePane.j
>> ava:343)
>>           at net.sourceforge.jnlp.controlpanel.CachePane.access$500(CachePane.java
>> :66)
>>           at net.sourceforge.jnlp.controlpanel.CachePane$8.run(CachePane.java:312)
>>
>>           at java.awt.event.InvocationEvent.dispatch(Unknown Source)
>>           at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
>>           at java.awt.EventQueue.access$400(Unknown Source)
>>           at java.awt.EventQueue$2.run(Unknown Source)
>>           at java.awt.EventQueue$2.run(Unknown Source)
>>           at java.security.AccessController.doPrivileged(Native Method)
>>           at java.security.AccessControlContext$1.doIntersectionPrivilege(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 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 net.sourceforge.jnlp.controlpanel.CacheViewer.showCacheDialog(CacheVi
>> ewer.java:149)
>>           at net.sourceforge.jnlp.controlpanel.TemporaryInternetFilesPanel$4.actio
>> nPerformed(TemporaryInternetFilesPanel.java:206)
>>           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 Sour
>> ce)
>>           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.dispatchEventImpl(Unknown Source)
>>           at java.awt.EventQueue.access$400(Unknown Source)
>>           at java.awt.EventQueue$2.run(Unknown Source)
>>           at java.awt.EventQueue$2.run(Unknown Source)
>>           at java.security.AccessController.doPrivileged(Native Method)
>>           at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown
>> Source)
>>           at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown
>> Source)
>>           at java.awt.EventQueue$3.run(Unknown Source)
>>           at java.awt.EventQueue$3.run(Unknown Source)
>>           at java.security.AccessController.doPrivileged(Native Method)
>>           at java.security.AccessControlContext$1.doIntersectionPrivilege(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.pumpEventsForHierarchy(Unknown Source)
>>           at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
>>           at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
>>           at java.awt.EventDispatchThread.run(Unknown Source)
>>
>> The cause of this NullPointerException is a missing %USERPROFILE%\.cache\icedtea-web\cache or ~/.cache/icedtea-web/cache folder. There should be check for existance before trying to list files in this folder, if non-existent it should be created. Btw. since net.sourceforge.jnlp.cache.CacheDirectory.getDirStructure(DirectoryNode) is public, it should check the root parameter for null.
>> I would have fixed this myself, but because I have not refactored the code to conform to the XDG specification, I did not want to touch it, while not knowing what to possibly touch as well and hence add perhaps even more damage.
>>
>> To reproduce: Delete %USERPROFILE%\.cache\icedtea-web\cache or ~/.cache/icedtea-web/cache and then open the cache viewer (perhaps refresh).
> 
> Thenx for report. Gave sense. I think I will "force" the creation of  ~/.cache/icedtea-web and ~/.config/icedtea-web at startup.

Hm. this is strange. If you delete cache  when running itw, then probably fault is moreover correct
behaviour.


How Are you starting cache viewer? When itw-settings are started, all the directories are created.
(double ensured) I'm not a big fan of adding

 File f1 = new File(Defaults.USER_CONFIG_HOME);
f1.mkdirs()
File f2 = new File(Defaults.USER_CACHE_HOME);
f2.mkdirs()

on more places then this already is.

When you are starting itw-settings (or javaws) what is output of console? Or is tehre any more ways
how to run cache viwer?

> 
> 
> J.
> 




More information about the distro-pkg-dev mailing list