Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 328320

Summary: NPE in EarUtilities.getReferencingEARProjects()
Product: [WebTools] WTP Java EE Tools Reporter: Szymon Ptaszkiewicz <sptaszkiewicz>
Component: jst.j2eeAssignee: Carl Anderson <ccc>
Status: RESOLVED FIXED QA Contact: Chuck Bridgham <cbridgha>
Severity: normal    
Priority: P3 CC: ccc, christopher.paul
Version: 3.0.5Flags: cbridgha: review+
Target Milestone: 3.0.5 P   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Stack traces
none
Ensure null entries are not added to the list none

Description Szymon Ptaszkiewicz CLA 2010-10-21 03:42:22 EDT
Created attachment 181366 [details]
Stack traces

After (or even during event broadcasting) PSF import there is NPE thrown while trying to call EarUtilities.getReferencingEARProjects() in line 187. Stack traces attached. Starting at some point all stack traces look exactly the same. After the PSF import there are also unwanted changes in file org.eclipse.wst.common.component. The bug came out while working on bug 301223.
Comment 1 Carl Anderson CLA 2010-10-21 14:50:25 EDT
Szymon, what version of Eclipse are you using?  It looks like the original bug was opened against Eclipse 3.5.1 (which corresponds to WTP 3.1.1).
Comment 2 Szymon Ptaszkiewicz CLA 2010-10-25 08:33:27 EDT
(In reply to comment #1)
> Szymon, what version of Eclipse are you using?  It looks like the original bug
> was opened against Eclipse 3.5.1 (which corresponds to WTP 3.1.1).

Yes, the original bug was opened against 3.5.1 but one of the duplicates was against 3.4.2. I updated the version of Eclipse accordingly there. The version of WTP is 3.0.5.
Comment 3 Szymon Ptaszkiewicz CLA 2010-10-27 09:12:10 EDT
Carl, could you tell what the root cause of this exception may be?
Comment 4 Paul Christopher CLA 2010-10-27 14:06:57 EDT
Adding myself to CC list
Comment 5 Carl Anderson CLA 2010-10-29 14:18:28 EDT
Created attachment 182071 [details]
Ensure null entries are not added to the list

The cause of the NPE is the fact that the list of referencing components returned from VirtualComponent.getReferencingComponents() could contain a null.  The patch will prevent the null entry from being added to the list.
Comment 6 Chuck Bridgham CLA 2010-11-08 10:54:52 EST
approve
Comment 7 Carl Anderson CLA 2010-11-17 16:18:06 EST
Committed to R3_0_5_patches