Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 316475 - NPE in EMF2DOMAdapterImpl
Summary: NPE in EMF2DOMAdapterImpl
Status: RESOLVED INVALID
Alias: None
Product: WTP Common Tools
Classification: WebTools
Component: wst.common (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: 3.2.3   Edit
Assignee: Roberto Sanchez Herrera CLA
QA Contact: Carl Anderson CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-10 10:55 EDT by Dimitar Giormov CLA
Modified: 2011-01-21 11:35 EST (History)
2 users (show)

See Also:


Attachments
junit test (11.02 KB, application/zip)
2010-06-10 10:55 EDT, Dimitar Giormov CLA
no flags Details
NPE stacktrace. (4.56 KB, application/octet-stream)
2010-06-10 10:56 EDT, Dimitar Giormov CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitar Giormov CLA 2010-06-10 10:55:03 EDT
We are testing our functionality on Helios, and a NPE showed up in EMF2DOMAdapterImpl.
I have managed to create a junit test for it.
Note that there are 2 test classes one is trying to modify the emf model directly and it passes. The other one creates Ejb Project and a method permission artifact. Adds and removes a security role from it. During removal the attached NPE is thrown.

I will attach the junit as well.
Comment 1 Dimitar Giormov CLA 2010-06-10 10:55:28 EDT
Created attachment 171643 [details]
junit test
Comment 2 Dimitar Giormov CLA 2010-06-10 10:56:24 EDT
Created attachment 171644 [details]
NPE stacktrace.
Comment 3 Carl Anderson CLA 2010-06-10 16:36:59 EDT
Assigning to Chuck for initial investigation.  Looks like the SecurityRole wouldn't have an Adapter, so adapter.getNode() would cause an NPE.
Comment 4 Kaloyan Raev CLA 2010-06-23 04:08:26 EDT
Raising priority. This bug causes a set of our adopter unit test to fail.
Comment 5 Dimo Stoilov CLA 2011-01-21 11:17:39 EST
It turns out the test is not quite correct. It creates security roles but doesn't attach them to the ejb assembly descriptor. 
After correcting this by adding the following line right after roles creation:
methodPerm.getAssemblyDescriptor().getSecurityRoles().add(roles[i]); 
then the test passed.
Comment 6 Dimitar Giormov CLA 2011-01-21 11:33:04 EST
Roberto you can close the bug report.
Comment 7 Roberto Sanchez Herrera CLA 2011-01-21 11:35:34 EST
Resolving this defect based on comment 5 and comment 6. Thank you.