Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 353176 - [DB] NPE in GMF notation caused by CoreTypeMappings$TMCustom.getDefaultValue
Summary: [DB] NPE in GMF notation caused by CoreTypeMappings$TMCustom.getDefaultValue
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.db (show other bugs)
Version: 4.0   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Eike Stepper CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-27 03:40 EDT by Eike Stepper CLA
Modified: 2012-09-21 06:51 EDT (History)
0 users

See Also:


Attachments
Fix (5.20 KB, patch)
2011-07-27 03:55 EDT, Eike Stepper CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eike Stepper CLA 2011-07-27 03:40:02 EDT
Cloned from: 351921: [DB] NPE in GMF notation caused by CoreTypeMappings$TMCustom.getDefaultValue
https://bugs.eclipse.org/bugs/show_bug.cgi?id=351921

Build Identifier: 

Hello,

I have a GMF diagram stored in my repository that causes the following stack trace (on commit after modification on a connection):

org.eclipse.emf.cdo.util.CommitException: Rollback in DBStore: java.lang.NullPointerException
at org.eclipse.gmf.runtime.notation.impl.NotationFactoryImpl.convertRelativeBendpointListToString(NotationFactoryImpl.java:1221)
at org.eclipse.gmf.runtime.notation.impl.NotationFactoryImpl.convertToString(NotationFactoryImpl.java:288)
at org.eclipse.emf.cdo.server.internal.db.mapping.CoreTypeMappings$TMCustom.getDefaultValue(CoreTypeMappings.java:847)
at org.eclipse.emf.cdo.server.db.mapping.AbstractTypeMapping.setDefaultValue(AbstractTypeMapping.java:99)
at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalBranchingClassMapping.detachAttributes(HorizontalBranchingClassMapping.java:691)
...

It appears that in CoreTypeMappings$TMCustom.getDefaultValue() the expression getFeature().getDefaultValue(); returns a null value. Is it possible to test if it is null? It seems to be tested in CoreTypeMappings$TMEnum.getDefaultValue().

Note that this exception happens on the server side, not on a client.

Thanks,
Steve

Reproducible: Always
Comment 1 Eike Stepper CLA 2011-07-27 03:55:23 EDT
Created attachment 200428 [details]
Fix
Comment 2 Eike Stepper CLA 2011-07-27 04:00:58 EDT
Committed revision 8826:
- branches/4.0-maintenance/plugins/org.eclipse.emf.cdo.server.db
- branches/4.0-maintenance/plugins/org.eclipse.emf.cdo.tests
Comment 3 Eike Stepper CLA 2011-07-27 04:01:13 EDT
Resolved.
Comment 4 Eike Stepper CLA 2012-09-21 06:51:22 EDT
Closing.