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 33142 - NullPointerException when editing with suggestions view enabled
Summary: NullPointerException when editing with suggestions view enabled
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Action Items (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: tasklist-issues@contrib
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-22 22:01 UTC by gthb
Modified: 2004-01-14 13:05 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
ide.log where the data loss occurred at the end (19.61 KB, text/plain)
2003-04-22 22:01 UTC, gthb
Details
ide.log where the hang occurred at the end (14.67 KB, text/plain)
2003-04-22 22:02 UTC, gthb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gthb 2003-04-22 22:01:06 UTC
I have been experiencing a series of exceptions, the first 
of which is clearly within tasklist. After these exceptions 
the IDE hangs. I can't be sure that the rest of the 
exceptions and the hang are related to the tasklist NPE, but 
I wasn't experiencing them before installing tasklist (and, 
admittedly, several other modules at the same time).
Furthermore, in attempting to reproduce the problem for this 
bug report, I experienced the file I was working on being 
erased! I.e. made empty, and saved that way. I was lucky to 
have just committed my changes. Again, can't be sure that 
this was tasklist's doing though. The hang did not occur in 
this case.
I will attach the ide.log from these two runs: where the 
hang occurred, and where the data loss occurred. In both 
cases, the first exception is in SuggestionManagerImpl. 
Please judge for yourself which of the other stuff, if any, 
is directly related to tasklist.
This was in NB 3.5 beta 1, after installing tasklist and 
some other modules, and also with my own unreleased build of 
pmd-netbeans 0.71 from the PMD project, which I was going to 
test; we are about to release that. I do not think the PMD 
version update is related, but again can't be sure; in any 
case it was perfectly stable before I installed these other 
modules including tasklist.
Comment 1 gthb 2003-04-22 22:01:38 UTC
Created attachment 10090 [details]
ide.log where the data loss occurred at the end
Comment 2 gthb 2003-04-22 22:02:07 UTC
Created attachment 10091 [details]
ide.log where the hang occurred at the end
Comment 3 gthb 2003-04-22 22:15:41 UTC
I have not succeeded in pinpointing what I'm doing when
this happens. I can reproduce the NPE itself just by
editing with the tasklist suggestions output window open,
but I haven't been able to get the hang again. Will report
here with a thread dump if I manage to get it.
Comment 4 Torbjorn Norbye 2003-04-22 22:31:45 UTC
The tasklist exception should be innocuous; it's saying that you have
selected the "Show" action in the suggestion window's context menu,
and it ran into an error while trying to disable or enable a
suggestion provider.

This will not cause the second exception, which is the cause for your
data loss - in the middle of updating a document it throws an
exception. That looks like an editor bug to me. I think you should
file a bug against the editor as well, using the same stack trace.  I
don't want to transfer this bug since I want to find out why you're
getting an NPE when changing the filter.

You said you could reproduce the exception - by editing with the
window open. Is it that simple? Did you not select the Show action?
Can you restart the IDE and tell me exactly what steps you take until
you hit the exception?

By the way, it looks like your document may have read only regions -
is that true?
Comment 5 Torbjorn Norbye 2003-04-22 22:34:04 UTC
Hm, I took a look at your second log file, which shows some other
exceptions. It looks like something is corrupt in the editor.
Comment 6 gthb 2003-04-22 22:44:05 UTC
You are quite possibly right that I did select the Show
action when I got the SuggestionManager NPE (presumably
the exceptions I reproduced with just general editing
were the ones in the editor).

The project I was in has no GUI code, so I'm fairly sure
there were no read-only regions (unless something *really*
fishy was going on! :)

I'll file the editor bugs now. Thanks!
Comment 7 Torbjorn Norbye 2003-04-24 06:55:35 UTC
I've fixed the problem pin pointed by your second log file attachment
(might also have caused the first, but I'm not sure about that).

I've committed the fix to the trunk and I've also backported it to the
release35 branch. I updated the tasklist webpage download, and sent an
 updated .nbm bundle to the update center maintainer, so hopefully the
fix should be available soon. (Look for version 1.0.3 (stable) or
version 1.6 (unstable) of the tasklist/suggestions module).

I'm renaming the summary since I don't believe the data loss (the gap
buffer exception) is related to this.

The root problem was that fixing an action (double clicking it) is a
slow process - it creates a confirmation dialog, highlights the editor
line, etc. If a rescan (which can also be slow) is occurring in the
interval between double clicking and confirming the dialog (not at all
unlikely), then the action being fixed will get removed during the
rescan, and its suggestion-list field nulled out. This was then
"dereferenced" which caused the NPE.   I've modified the code such
that tasks that are removed are marked as zombies, and in the fix
code, I look to see if the candidate is a zombie, and if so, search
for its reincarnation in the rescanned list. I could reproduce your
exception and this fix solved my testcase. Let me know if you see
further problems in this area after getting the updated version of the
modules. I will close this bug as fixed; if you find additional
exceptions file them as a new separate bug (since it must have a
separate root cause). And thanks for your help!
Comment 8 _ pkuzel 2004-01-14 13:05:47 UTC
It was resolved in 3.6 time or earlier.