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

Summary: NullPointerException at org.netbeans.modules.java.source.classpath.CacheClassPath.<init>
Product: java Reporter: sid21177 <sid21177>
Component: ProjectAssignee: Tomas Zezula <tzezula>
Status: VERIFIED FIXED    
Severity: blocker CC: ensiketu, sustaining
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
URL: http://statistics.netbeans.org/exceptions/detail.do?id=36596
Issue Type: DEFECT Exception Reporter: 36596
Attachments: stacktrace
stacktrace
stacktrace
stacktrace
stacktrace
AssertionError throw when assertions are enabled.
NPE when assertions are disabled.
stacktrace
stacktrace
stacktrace
stacktrace
stacktrace

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