Conversation
|
I encountered this issue during Xtext editing, but I do not remember any concrete steps to reproduce that NullPointerException. Do you know anything about it? So far, it works quite well without NPE :). |
I have not been able to reliably reproduce the exception, so I have no been able to track down its cause, which does bother me. I am not even sure how it is possible for |
himi
left a comment
There was a problem hiding this comment.
Thank you. I tried many patterns and could not get any NPEs so far. In my experience, analysis and subject edit has had caused an NPE often, but I could not reproduce such problems in this version.
This PR fixes bugs in
TypeAdapterandAssignmentUsageAdapter.TypeAdapterTypeAdapter::removeUnnecessaryImplicitGeneralTypescould throw anNullPointerExceptionifimplicitEClassGeneralswas null for a certain specializationEClass(which can happen during processing of an ill-formed model).implicitEClassGeneralsis non-null before processing it further.AssignmentUsageAdapterPreviously,
AssignmentActionUsageAdapter::addTargetRedefinitioncalledFeatureAdapter::addFeatureWriteTypesto satisfy redefinition constraints ontarget::StartingAtandtarget::startingAt::accessedFeaturenested in anAssignmentActionUsage. However, placing this withinAssignmentActionUsageAdaptermeans that the transformation is not done ifFeature::computeImplicitGeneralTypesis called directly on these features, which can happen during Xtext editor reconciliation of text changes. The result can be spurious validation errors.Moved the implementation satisfying these constraints to
FeatureAdapter, called fromaddComputedRedefinitions.Note. This change results in the KerML-level
FeatureAdapterdepending on SysMLAssignmentActionUsage. However, in general, "on-demand" calls tocomputeImplicitGeneralTypescan only be properly handled if the satisfaction of all semantic constrains effecting a metaclass are implemented in the adapter for that metaclass.