Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 319015 - [Model Browser] Null Pointer after deleting a field in a model
Summary: [Model Browser] Null Pointer after deleting a field in a model
Status: CLOSED FIXED
Alias: None
Product: MoDisco
Classification: Modeling
Component: Technologies (show other bugs)
Version: 0.9.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 0.9.0 M1   Edit
Assignee: Nicolas Bros CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-06 10:43 EDT by Nicolas Guyomar CLA
Modified: 2010-10-18 08:32 EDT (History)
5 users (show)

See Also:
nicolas.bros: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Guyomar CLA 2010-07-06 10:43:21 EDT
Hi,

Using the MoDisco Java Discoverer, I encountered a null pointer exception after deleting a field in the java model.

To reproduce, simply create an "Hello World" java project, discover the source code with the MoDisco Java Discoverer.
Once the MoDisco Model Browser is opened, delete a field in a method declaration for example. The field dissapears, according to the correct behaviour.
Close the browser and try to open it again, you got the NullPointerException

Once the exception is raised, it is impossible to open the javaxmi, even after discovering it again, which led to the same exception

Regards
Comment 1 Nicolas Bros CLA 2010-07-07 09:15:13 EDT
I cannot reproduce the error.
Could you please attach a model on which it happens, and tell me exactly which steps lead to the error? A stacktrace could be helpful too.
Comment 2 Nicolas Bros CLA 2010-07-07 09:21:00 EDT
Scratch that! I misunderstood you, I thought you meant the error happened when you deleted a FieldDeclaration. But it in fact happens when you delete an attribute.
Comment 3 Nicolas Bros CLA 2010-07-07 09:59:53 EDT
What happened is that when you deleted an attribute in the model browser, it in fact deleted the EAttribute from the metamodel (in the EPackage.Registry). This of course causes problems (both this bug and bug 319016).

I fixed it in revision 2667 by making sure elements from the EPackage.Registry cannot be deleted.
Comment 4 Hugo Bruneliere CLA 2010-10-04 13:55:27 EDT
Bug fixed.