[sip-comm-dev] [PATCH] Fix for NPE in Notifications configuration panel


#1

Hi, when I go in the Notifications configuration panel I always get this
exception (at the end of my mail).
The reason is that some sound is activated but the sound file is null.
I fixed that in NotificationsTableEntry :
when setting a soundFile, if the file is null, I disable the sound and
replace it by "".
But I'm not sure it is the best fix for that, maybe it should be done
somewhere else.
And if it happens with sound it may happens with a program too

Matthieu

     [java] java.lang.NullPointerException
     [java] at
net.java.sip.communicator.plugin.notificationconfiguration.ListMulti.addLine(ListMulti.java:248)
     [java] at
net.java.sip.communicator.plugin.notificationconfiguration.NotificationConfigurationPanel.updateTable(NotificationConfigurationPanel.java:1058)
     [java] at
net.java.sip.communicator.plugin.notificationconfiguration.NotificationConfigurationPanel.<init>(NotificationConfigurationPanel.java:361)
     [java] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
     [java] at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
     [java] at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
     [java] at
java.lang.reflect.Constructor.newInstance(Constructor.java:513)
     [java] at java.lang.Class.newInstance0(Class.java:355)
     [java] at java.lang.Class.newInstance(Class.java:308)
     [java] at
net.java.sip.communicator.service.gui.LazyConfigurationForm.getForm(LazyConfigurationForm.java:61)
     [java] at
net.java.sip.communicator.impl.gui.main.configforms.ConfigFormDescriptor.getConfigFormPanel(ConfigFormDescriptor.java:81)
     [java] at
net.java.sip.communicator.impl.gui.main.configforms.ConfigurationFrame.showFormContent(ConfigurationFrame.java:133)
     [java] at
net.java.sip.communicator.impl.gui.main.configforms.ConfigFormList.valueChanged(ConfigFormList.java:106)
     [java] at javax.swing.JList.fireSelectionValueChanged(JList.java:1765)
     [java] at
javax.swing.JList$ListSelectionHandler.valueChanged(JList.java:1779)
     [java] at
javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:167)
     [java] at
javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:137)
     [java] at
javax.swing.DefaultListSelectionModel.setValueIsAdjusting(DefaultListSelectionModel.java:668)
     [java] at javax.swing.JList.setValueIsAdjusting(JList.java:2110)
     [java] at
javax.swing.plaf.basic.BasicListUI$Handler.mouseReleased(BasicListUI.java:2788)
     [java] at
java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:273)
     [java] at java.awt.Component.processMouseEvent(Component.java:6263)
     [java] at
javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
     [java] at java.awt.Component.processEvent(Component.java:6028)
     [java] at java.awt.Container.processEvent(Container.java:2041)
     [java] at java.awt.Component.dispatchEventImpl(Component.java:4630)
     [java] at java.awt.Container.dispatchEventImpl(Container.java:2099)
     [java] at java.awt.Component.dispatchEvent(Component.java:4460)
     [java] at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
     [java] at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
     [java] at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
     [java] at java.awt.Container.dispatchEventImpl(Container.java:2085)
     [java] at java.awt.Window.dispatchEventImpl(Window.java:2475)
     [java] at java.awt.Component.dispatchEvent(Component.java:4460)
     [java] at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
     [java] at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
     [java] at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
     [java] at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
     [java] at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
     [java] at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
     [java] at
java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Fix_NPE_in_NotificationConfigurationPanel.patch (815 Bytes)


#2

Hi, in fact I'm really not sure this fix is good because I get a lot of
exceptions like this one :
     [java] 15:17:51.060 GRAVE:
service.protocol.AbstractOperationSetBasicInstantMessaging.fireMessageEvent().199
Error delivering message
     [java] java.lang.NullPointerException
     [java] at
org.apache.felix.framework.ModuleImpl.getResourceLocal(ModuleImpl.java:762)
     [java] at
org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:688)
     [java] at
org.apache.felix.framework.ModuleImpl.getResourceByDelegation(ModuleImpl.java:611)
     [java] at
org.apache.felix.framework.ModuleImpl$ModuleClassLoader.getResource(ModuleImpl.java:1906)
     [java] at
net.java.sip.communicator.impl.resources.ResourceManagementServiceImpl.getSoundURLForPath(ResourceManagementServiceImpl.java:621)
     [java] at
net.java.sip.communicator.impl.neomedia.notify.AudioNotifierServiceImpl.createAudio(AudioNotifierServiceImpl.java:64)
     [java] at
net.java.sip.communicator.impl.neomedia.notify.AudioNotifierServiceImpl.createAudio(AudioNotifierServiceImpl.java:22)
     [java] at
net.java.sip.communicator.impl.notification.SoundNotificationHandlerImpl.start(SoundNotificationHandlerImpl.java:80)
     [java] at
net.java.sip.communicator.impl.notification.NotificationServiceImpl.fireNotification(NotificationServiceImpl.java:420)
     [java] at
net.java.sip.communicator.impl.gui.utils.NotificationManager.fireChatNotification(NotificationManager.java:217)
     [java] at
net.java.sip.communicator.impl.gui.main.contactlist.ContactListPane.messageReceived(ContactListPane.java:304)
     [java] at
net.java.sip.communicator.service.protocol.AbstractOperationSetBasicInstantMessaging.fireMessageEvent(AbstractOperationSetBasicInstantMessaging.java:193)
     [java] at
net.java.sip.communicator.impl.protocol.msn.OperationSetBasicInstantMessagingMsnImpl.access$600(OperationSetBasicInstantMessagingMsnImpl.java:25)
     [java] at
net.java.sip.communicator.impl.protocol.msn.OperationSetBasicInstantMessagingMsnImpl$MsnMessageListener.instantMessageReceived(OperationSetBasicInstantMessagingMsnImpl.java:229)
     [java] at
net.sf.jml.impl.AbstractMessenger.fireInstantMessageReceived(AbstractMessenger.java:346)
     [java] at
net.sf.jml.message.MsnInstantMessage.messageReceived(MsnInstantMessage.java:255)
     [java] at
net.sf.jml.message.IncomingMimeMessage.messageReceived(IncomingMimeMessage.java:56)
     [java] at
net.sf.jml.protocol.MsnSession$1.messageReceived(MsnSession.java:107)
     [java] at net.sf.jml.net.Session.fireMessageReceived(Session.java:301)
     [java] at net.sf.jml.net.Session.access$1200(Session.java:30)
     [java] at net.sf.jml.net.Session$MsgDispatcher.run(Session.java:283)
     [java] at java.lang.Thread.run(Thread.java:619)

and it seems the reason is that the audiofile is null

···

2010/2/22 Matthieu Casanova <chocolat.mou@gmail.com>

Hi, when I go in the Notifications configuration panel I always get this
exception (at the end of my mail).
The reason is that some sound is activated but the sound file is null.
I fixed that in NotificationsTableEntry :
when setting a soundFile, if the file is null, I disable the sound and
replace it by "".
But I'm not sure it is the best fix for that, maybe it should be done
somewhere else.
And if it happens with sound it may happens with a program too

Matthieu

     [java] java.lang.NullPointerException
     [java] at
net.java.sip.communicator.plugin.notificationconfiguration.ListMulti.addLine(ListMulti.java:248)
     [java] at
net.java.sip.communicator.plugin.notificationconfiguration.NotificationConfigurationPanel.updateTable(NotificationConfigurationPanel.java:1058)
     [java] at
net.java.sip.communicator.plugin.notificationconfiguration.NotificationConfigurationPanel.<init>(NotificationConfigurationPanel.java:361)
     [java] at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
     [java] at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
     [java] at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
     [java] at
java.lang.reflect.Constructor.newInstance(Constructor.java:513)
     [java] at java.lang.Class.newInstance0(Class.java:355)
     [java] at java.lang.Class.newInstance(Class.java:308)
     [java] at
net.java.sip.communicator.service.gui.LazyConfigurationForm.getForm(LazyConfigurationForm.java:61)
     [java] at
net.java.sip.communicator.impl.gui.main.configforms.ConfigFormDescriptor.getConfigFormPanel(ConfigFormDescriptor.java:81)
     [java] at
net.java.sip.communicator.impl.gui.main.configforms.ConfigurationFrame.showFormContent(ConfigurationFrame.java:133)
     [java] at
net.java.sip.communicator.impl.gui.main.configforms.ConfigFormList.valueChanged(ConfigFormList.java:106)
     [java] at
javax.swing.JList.fireSelectionValueChanged(JList.java:1765)
     [java] at
javax.swing.JList$ListSelectionHandler.valueChanged(JList.java:1779)
     [java] at
javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:167)
     [java] at
javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:137)
     [java] at
javax.swing.DefaultListSelectionModel.setValueIsAdjusting(DefaultListSelectionModel.java:668)
     [java] at javax.swing.JList.setValueIsAdjusting(JList.java:2110)
     [java] at
javax.swing.plaf.basic.BasicListUI$Handler.mouseReleased(BasicListUI.java:2788)
     [java] at
java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:273)
     [java] at java.awt.Component.processMouseEvent(Component.java:6263)
     [java] at
javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
     [java] at java.awt.Component.processEvent(Component.java:6028)
     [java] at java.awt.Container.processEvent(Container.java:2041)
     [java] at java.awt.Component.dispatchEventImpl(Component.java:4630)
     [java] at java.awt.Container.dispatchEventImpl(Container.java:2099)
     [java] at java.awt.Component.dispatchEvent(Component.java:4460)
     [java] at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
     [java] at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
     [java] at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
     [java] at java.awt.Container.dispatchEventImpl(Container.java:2085)
     [java] at java.awt.Window.dispatchEventImpl(Window.java:2475)
     [java] at java.awt.Component.dispatchEvent(Component.java:4460)
     [java] at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
     [java] at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
     [java] at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
     [java] at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
     [java] at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
     [java] at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
     [java] at
java.awt.EventDispatchThread.run(EventDispatchThread.java:122)