This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 248782 - Null Pointer in org.netbeans.core.NotifyExcPanel$ExceptionFlasher.notify
Summary: Null Pointer in org.netbeans.core.NotifyExcPanel$ExceptionFlasher.notify
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Notifications (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Jan Peska
URL:
Keywords:
: 250716 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-11-20 16:00 UTC by SirIntellegence
Modified: 2015-03-23 14:40 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description SirIntellegence 2014-11-20 16:00:40 UTC
Sometimes, in my platform application, someone seems to keep triggering this:
java.lang.NullPointerException
at org.netbeans.core.NotifyExcPanel$ExceptionFlasher.notify(NotifyExcPanel.java:637)
at org.netbeans.core.NotifyExcPanel$ExceptionFlasher.access$600(NotifyExcPanel.java:628)
at org.netbeans.core.NotifyExcPanel$2.run(NotifyExcPanel.java:359)
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$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
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) 

Which occurs continuously. Since we send a crash report everytime a severe log entry with an exception comes through (this is a beta), it spams the crash report system.

I don't know how they are doing it, but after looking at the source code:
        private static synchronized ExceptionFlasher notify(String summary, ImageIcon icon) {
            if (flash == null) {
                flash = new ExceptionFlasher();
            } else {
                flash.timer.restart();
                flash.note.clear();
            }
            JComponent detailsPanel = getDetailsPanel(summary);
            JComponent bubblePanel = getDetailsPanel(summary);

            flash.note = NotificationDisplayer.getDefault().notify(
                    NbBundle.getMessage(NotifyExcPanel.class, "NTF_ExceptionalExceptionTitle"),
                    icon, bubblePanel, detailsPanel,
                    NotificationDisplayer.Priority.SILENT, NotificationDisplayer.Category.ERROR);
            return flash;
        }

It seems like an easy fix, replace
                flash.note.clear();
with
                if (flash.note != null)
                    flash.note.clear();
Could you get this fixed please?
Comment 1 Tomas Hurka 2014-11-20 16:07:58 UTC
Wrong component, reassigning.
Comment 2 SirIntellegence 2014-12-01 18:06:35 UTC

*** This bug has been marked as a duplicate of bug 247817 ***
Comment 3 SirIntellegence 2014-12-01 18:08:14 UTC
Hmmm... My bad, it looks like it isn't a dup....
Comment 4 Ondrej Vrabec 2015-03-04 16:25:32 UTC
fixed. however i am not certain how this can happen. flash.note should never be null while flash is instantiated. Unless there is an exception thrown from here:
JComponent detailsPanel = getDetailsPanel(summary);
JComponent bubblePanel = getDetailsPanel(summary);

Fix: core-main #ae356fd2a5c5
Changeset: ae356fd2a5c5
Message:
Comment 5 Quality Engineering 2015-03-06 04:11:52 UTC
Integrated into 'main-silver', will be available in build *201503060001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/ae356fd2a5c5
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: #248782 - Null Pointer in org.netbeans.core.NotifyExcPanel$ExceptionFlasher.notify
Comment 6 Ondrej Vrabec 2015-03-23 14:40:26 UTC
*** Bug 250716 has been marked as a duplicate of this bug. ***