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 134280 - NullPointerException at org.netbeans.modules.java.source.classpath.CacheClassPath.<init>
Summary: NullPointerException at org.netbeans.modules.java.source.classpath.CacheClass...
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Tomas Zezula
URL: http://statistics.netbeans.org/except...
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-30 18:06 UTC by sid21177
Modified: 2008-11-04 07:48 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 36596


Attachments
stacktrace (3.40 KB, text/plain)
2008-04-30 18:06 UTC, sid21177
Details
stacktrace (3.40 KB, text/plain)
2008-04-30 18:07 UTC, sid21177
Details
stacktrace (3.30 KB, text/plain)
2008-05-03 05:15 UTC, tommyjian
Details
stacktrace (3.40 KB, text/plain)
2008-05-09 13:12 UTC, myriapodes
Details
stacktrace (3.30 KB, text/plain)
2008-05-10 19:06 UTC, mortoza
Details
AssertionError throw when assertions are enabled. (3.04 KB, text/plain)
2008-05-12 13:25 UTC, Jan Lahoda
Details
NPE when assertions are disabled. (3.46 KB, text/plain)
2008-05-12 13:25 UTC, Jan Lahoda
Details
stacktrace (3.40 KB, text/plain)
2008-05-16 17:24 UTC, 191
Details
stacktrace (3.32 KB, text/plain)
2008-05-27 10:24 UTC, m_potociar
Details
stacktrace (3.59 KB, text/plain)
2008-06-11 20:38 UTC, Unknown
Details
stacktrace (3.40 KB, text/plain)
2008-06-12 18:05 UTC, krahe
Details
stacktrace (3.40 KB, text/plain)
2008-06-19 05:47 UTC, dbcurtis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sid21177 2008-04-30 18:06:33 UTC
Build: NetBeans IDE 6.1 (Build 200804211638)
VM: Java HotSpot(TM) Client VM, 1.6.0_03-b05, Java(TM) SE Runtime Environment, 1.6.0_03-b05
OS: Windows XP, 5.1, x86

User Comments: 
clicked run button
Comment 1 sid21177 2008-04-30 18:06:37 UTC
Created attachment 60890 [details]
stacktrace
Comment 2 sid21177 2008-04-30 18:07:48 UTC
Build: NetBeans IDE 6.1 (Build 200804211638)
VM: Java HotSpot(TM) Client VM, 1.6.0_03-b05, Java(TM) SE Runtime Environment, 1.6.0_03-b05
OS: Windows XP, 5.1, x86

User Comments: 
Comment 3 sid21177 2008-04-30 18:07:56 UTC
Created attachment 60891 [details]
stacktrace
Comment 4 Exceptions Reporter 2008-04-30 21:44:18 UTC
This issue has already 10 duplicates 
Comment 5 tommyjian 2008-05-03 05:15:24 UTC
Build: NetBeans IDE 6.1 (Build 200804211638)
VM: Java HotSpot(TM) Client VM, 10.0-b19, Java(TM) SE Runtime Environment, 1.6.0_05-b13
OS: Windows XP, 5.1, x86

User Comments: 
When I run a Swing application, this exception is raised.
Comment 6 tommyjian 2008-05-03 05:15:27 UTC
Created attachment 61001 [details]
stacktrace
Comment 7 Exceptions Reporter 2008-05-06 17:43:37 UTC
This issue has already 20 duplicates 
Comment 8 myriapodes 2008-05-09 13:11:54 UTC
Build: NetBeans IDE 6.1 (Build 200804211638)
VM: Java HotSpot(TM) Client VM, 10.0-b22, Java(TM) SE Runtime Environment, 1.6.0_06-b02
OS: Linux, 2.6.22.17-0.1-default, i386

User Comments: 
after copy/paste a project when i run it
Comment 9 myriapodes 2008-05-09 13:12:02 UTC
Created attachment 61183 [details]
stacktrace
Comment 10 mortoza 2008-05-10 19:06:26 UTC
Build: NetBeans IDE 6.1 (Build 200804211638)
VM: Java HotSpot(TM) Client VM, 11.0-b11, Java(TM) SE Runtime Environment, 1.6.0_10-beta-b14
OS: Windows XP, 5.1, x86

User Comments: 
Comment 11 mortoza 2008-05-10 19:06:29 UTC
Created attachment 61218 [details]
stacktrace
Comment 12 Jan Lahoda 2008-05-12 13:24:38 UTC
To reproduce:
-create a new J2SE project
-remove all source roots from the project
-make sure the main class *is* set
-try to run the project

An AssertionError is thrown when assertion are enabled, NPE when disabled (both attached, from a recent trunk build).

Unless there is a reason allow null values (I do not see any, esp. considering the null values did not work till now)
for ClasspathInfo.create(...), I propose to:
-explicitly document that null values are not allowed+use Parameters to enforce non-null values - I can do this
-fix the J2SE project not to throw the AE and not to pass null co ClasspathInfo
Comment 13 Jan Lahoda 2008-05-12 13:25:22 UTC
Created attachment 61257 [details]
AssertionError throw when assertions are enabled.
Comment 14 Jan Lahoda 2008-05-12 13:25:50 UTC
Created attachment 61258 [details]
NPE when assertions are disabled.
Comment 15 191 2008-05-16 17:24:58 UTC
Created attachment 61492 [details]
stacktrace
Comment 16 m_potociar 2008-05-27 10:24:55 UTC
Created attachment 61962 [details]
stacktrace
Comment 17 Unknown 2008-06-11 20:38:17 UTC
Created attachment 62694 [details]
stacktrace
Comment 18 krahe 2008-06-12 18:05:30 UTC
Created attachment 62765 [details]
stacktrace
Comment 19 dbcurtis 2008-06-19 05:47:04 UTC
Created attachment 63051 [details]
stacktrace
Comment 20 Tomas Zezula 2008-06-19 12:46:09 UTC
Fixed: 0e2b5e9fcc63
Comment 21 Jiri Prox 2008-06-19 13:04:24 UTC
This issue has lots of duplicates, so it would be useful to include the fix in patch.

Can someone from reporters verify the fix, please?
Comment 22 Tomas Zezula 2008-06-19 13:27:56 UTC
It's not so easy to reproduce it.
You have to have a jar file with main class on the classpath and set the main from the jar as a project class path. You also need to remove all source roots 
from project.
Comment 23 Quality Engineering 2008-06-20 15:57:30 UTC
Integrated into 'main-golden', available in NB_Trunk_Production #271 build
Changeset: http://hg.netbeans.org/main/rev/0e2b5e9fcc63
User: Tomas Zezula <tzezula@netbeans.org>
Log: #134280:NullPointerException at org.netbeans.modules.java.source.classpath.CacheClassPath.<init>
Comment 24 rbalada 2008-08-04 15:46:00 UTC
As the nomination process goes forward with NetBeans 6.1 Patch 3 and beyond, low priority defects from P3 to P5 should
include a justification and a safety assessment when nominated for patch inclusion. Could QE provide that info?

Also please note that the nomination cut-off is on COB of Aug 5. Unverified bugfixes don't get into patch.
Comment 25 Jiri Prox 2008-08-05 09:12:38 UTC
cannot reproduce in trunk build, no reports after the fix -> verified

justification for including in path: over 100 duplicates
Comment 26 rbalada 2008-08-05 12:18:44 UTC
I've transplanted the changeset http://hg.netbeans.org/main/rev/0e2b5e9fcc63 into release61_fixes repository as
http://hg.netbeans.org/release61_fixes/rev/9f7418fb410d