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

Bug 353176

Summary: [DB] NPE in GMF notation caused by CoreTypeMappings$TMCustom.getDefaultValue
Product: [Modeling] EMF Reporter: Eike Stepper <stepper>
Component: cdo.dbAssignee: Eike Stepper <stepper>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: normal    
Priority: P3    
Version: 4.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Fix none

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.