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 120879 - NullPointerException at javax.swing.JList$1.getSize
Summary: NullPointerException at javax.swing.JList$1.getSize
Status: RESOLVED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Search (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@utilities
URL: http://statistics.netbeans.org/except...
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-01 18:46 UTC by jtanium
Modified: 2008-03-21 17:30 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 9702


Attachments
stacktrace (2.51 KB, text/plain)
2007-11-01 18:46 UTC, jtanium
Details
Call stack for JList(Object []) constructor with null input (1.24 KB, text/plain)
2007-11-07 07:18 UTC, mslama
Details
stacktrace (3.16 KB, text/plain)
2007-12-20 19:41 UTC, marano
Details
stacktrace (2.13 KB, text/plain)
2007-12-20 19:43 UTC, marano
Details
stacktrace (2.59 KB, text/plain)
2007-12-24 02:36 UTC, yangyanghe_ty83
Details
stacktrace (2.59 KB, text/plain)
2007-12-24 02:37 UTC, yangyanghe_ty83
Details
stacktrace (1.73 KB, text/plain)
2007-12-24 23:17 UTC, herric
Details
stacktrace (3.42 KB, text/plain)
2007-12-24 23:17 UTC, herric
Details
stacktrace (2.59 KB, text/plain)
2008-01-09 00:55 UTC, strivedi
Details
stacktrace (2.59 KB, text/plain)
2008-01-09 00:56 UTC, strivedi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jtanium 2007-11-01 18:46:16 UTC
Build: NetBeans IDE 6.0 Beta 2 (Build 200710212201)
VM: Java HotSpot(TM) Client VM, 1.5.0_07-87
OS: Mac OS X, 10.4.10, i386

User Comments: 
I was doing a search and replace in all files in a Ruby on Rails project.  After I clicked "Replace" the "Search Results" pane said: "The following issues were encountered while replacing:" but nothing else.
Comment 1 jtanium 2007-11-01 18:46:22 UTC
Created attachment 52301 [details]
stacktrace
Comment 2 David Simonek 2007-11-01 21:25:43 UTC
Marku can you evaluate for me? Thanks...
Comment 3 mslama 2007-11-05 11:44:00 UTC
It looks like race condition. Unfortunately it is not possible to say what JList instance it is ie. who/what module is
its owner. NPE comes from null ListModel. It can be caused either by creating JList with null input data or reseting
ListModel to null later. Please is there any steps/situation how to reproduce this problem? This way we could identify
responsible JList instance and its owner.
Comment 4 mslama 2007-11-05 11:53:40 UTC
Was it action Edit -> Replace in Projects? Is it reproducible? What was filed in combo boxes? What project? Some nb
project or your own?
Comment 5 jtanium 2007-11-05 15:25:10 UTC
It was actually "Edit" -> "Replace in Projects..."

I was doing a search for 'potential_merchant' and replacing it with 'contact' (without the quotes, of course).  File
Name Patterns was blank (all files), none of the options (Whole Words, Case Sensitive, Regular Expression) were
selected, and the scope was set to "Open Projects," though I only have one project open.

It was reproducible at the time, and I was able to get it to work by entering a file pattern.

Hope that helps.
Comment 6 jtanium 2007-11-05 15:30:04 UTC
Sorry that last statement wasn't very clear.

The problem occurred consistently when I didn't use a file pattern.  I was able to get the search and replace to work
properly when I entered a file pattern.  Note: I did a search for one file pattern at a time.

Also, if it matters, there were some really large log files in my project (5MB+), though I don't think they were causing
the problem.
Comment 7 mslama 2007-11-06 11:37:12 UTC
Passing to utilities for evaluation if there is any JList used in Replace in Projects dialog.
Comment 8 mslama 2007-11-06 12:37:50 UTC
I tried to patch JList to see who calls this JList constructor but I did not get any log ie. I did not go through this
code even if I called Replace in Projects. So it seems it is not caused by this project? Can I ask you to patch JList
compile it and run it with your IDE? I will send you detailed description is separate email. I do not see any other
chance how we could find corresponding code which creates this JList.
Comment 9 jtanium 2007-11-06 15:24:35 UTC
Yes, I can still reproduce the problem, so go ahead and send me the info to patch JList.
Comment 10 mslama 2007-11-07 07:17:14 UTC
With patched JList we was able to find out that utilities/search call JList(Object []) constructor with null input
parameter. Read javadoc it is not allowed and results in this behavior. I attach call stack.
Comment 11 mslama 2007-11-07 07:18:23 UTC
Created attachment 52635 [details]
Call stack for JList(Object []) constructor with null input
Comment 12 marano 2007-12-20 19:41:50 UTC
Build: NetBeans IDE 6.0 (Build 200711261600)
VM: Java HotSpot(TM) Client VM, 1.6.0_03-b05
OS: Linux, 2.6.22-14-generic, i386

User Comments: 
Comment 13 marano 2007-12-20 19:41:54 UTC
Created attachment 54428 [details]
stacktrace
Comment 14 marano 2007-12-20 19:42:46 UTC
Build: NetBeans IDE 6.0 (Build 200711261600)
VM: Java HotSpot(TM) Client VM, 1.6.0_03-b05
OS: Linux, 2.6.22-14-generic, i386

User Comments: 
Comment 15 marano 2007-12-20 19:43:04 UTC
Created attachment 54429 [details]
stacktrace
Comment 16 yangyanghe_ty83 2007-12-24 02:36:12 UTC
Build: NetBeans IDE 6.0 (Build 200711261600)
VM: Java HotSpot(TM) Client VM, 1.6.0_01-b06
OS: Windows XP, 5.1, x86

User Comments: 
Comment 17 yangyanghe_ty83 2007-12-24 02:36:20 UTC
Created attachment 54479 [details]
stacktrace
Comment 18 yangyanghe_ty83 2007-12-24 02:37:01 UTC
Build: NetBeans IDE 6.0 (Build 200711261600)
VM: Java HotSpot(TM) Client VM, 1.6.0_01-b06
OS: Windows XP, 5.1, x86

User Comments: 
Comment 19 yangyanghe_ty83 2007-12-24 02:37:09 UTC
Created attachment 54480 [details]
stacktrace
Comment 20 herric 2007-12-24 23:16:56 UTC
Build: NetBeans IDE 6.0 (Build 200711261600)
VM: Java HotSpot(TM) Client VM, 1.5.0_06-b05
OS: Windows XP, 5.1, x86

User Comments: 
Comment 21 herric 2007-12-24 23:17:04 UTC
Created attachment 54491 [details]
stacktrace
Comment 22 herric 2007-12-24 23:17:25 UTC
Build: NetBeans IDE 6.0 (Build 200711261600)
VM: Java HotSpot(TM) Client VM, 1.5.0_06-b05
OS: Windows XP, 5.1, x86

User Comments: 
Comment 23 herric 2007-12-24 23:17:32 UTC
Created attachment 54492 [details]
stacktrace
Comment 24 strivedi 2008-01-09 00:55:39 UTC
Build: NetBeans IDE 6.0 (Build 200711261600)
VM: Java HotSpot(TM) Client VM, 1.6.0_03-b05
OS: Windows XP, 5.1, x86

User Comments: 
error ocurred while replacing text in project.
Comment 25 strivedi 2008-01-09 00:55:43 UTC
Created attachment 54846 [details]
stacktrace
Comment 26 strivedi 2008-01-09 00:56:36 UTC
Build: NetBeans IDE 6.0 (Build 200711261600)
VM: Java HotSpot(TM) Client VM, 1.6.0_03-b05
OS: Windows XP, 5.1, x86

User Comments: 
Comment 27 strivedi 2008-01-09 00:56:44 UTC
Created attachment 54847 [details]
stacktrace
Comment 28 Tomas Pavek 2008-03-21 17:30:05 UTC
Is anybody able to reproduce this reliably? Possibly describe the steps or send IDE log?

Looking at the code, it seems the only way the JList with null data can be created is that the replace task is
interrupted with an uncaught exception (i.e. ReplaceTask ends up with null 'resultStatus' and empty 'problems' which
Manager.notifyReplaceFinished treats as finished with issues - a theory).

We can easily avoid the problem with JList, but would be good to find the causing problem as well (which would remain
ther otherwise). Meanwhile I've implemented a quick fix to avoid the JList problem.

http://hg.netbeans.org/main/rev/41cbe8f7d532