Exception throws when initialValue is null during EMF transaction commit #71
Unanswered
Orangewithsugar
asked this question in
Q&A
Replies: 1 comment
-
|
This is provided by https://github.com/eclipse-emfservices/emf-transaction but given they have no discussions, I suggest opening an issue with your question: https://github.com/eclipse-emfservices/emf-transaction/issues I also suggest to them that they enable discussions on their repositories, which they can do via otterdog like EMF has done here: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello EMF Team!
Description:
While working with the SysML v2 Pilot, I encountered an issue when setting the direction of a Usage element in a model.
Although the command setting the direction property executes successfully inside TransactionalCommandStack#doExecute(), an exception is thrown after the command completes—during the EMF transaction commit phase. Specifically, during the consolidation of recorded model changes, EMF internally attempts to resolve feature values via createFromString(...).
The generated factory method createFeatureDirectionKindFromString(...) is invoked with a null value for initialValue, which results in an unhandled exception:

Since initialValue == null, FeatureDirectionKind.get(null) returns null, which then triggers the IllegalArgumentException.
Root Cause:
During transaction commit, EMF uses ChangeRecorder to analyze and consolidate changes. As part of this, it tries to resolve feature values via EFactory.createFromString(...). When it encounters a null string for an enum value (FeatureDirectionKind in this case), the generated method fails due to missing null-check logic.
This situation is common in EMF when model attributes are optional or unset.
Environment:
JDK version: [17.0.1]
SysML version: [0.48.0]
Let me know if there is a workaround or if this can be addressed in a future update. Thank you for your support!
Beta Was this translation helpful? Give feedback.
All reactions