You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have verified that I am running the latest version of the EcoreNetto
I have searched open and closed issues to ensure it has not already been reported
Description
Summary: Several SetProperties implementations cast the result of Resource.GetEObject(...) directly to a concrete type. GetEObject can fail to resolve (e.g. incomplete/cross-resource models), producing a NullReferenceException or InvalidCastException with no actionable message.
Proposed solution: Resolve into the base type, null-check, and either record a diagnostic (see B3) or throw a descriptive exception naming the unresolved fragment. Consider a small helper on Resource/EObject that resolves-and-validates a typed reference.
Acceptance criteria:
Unresolved references produce a clear, message-bearing error (or recorded diagnostic) rather than NullReference/InvalidCast.
Tests cover the unresolved and wrong-type cases for each site.
Prerequisites
Description
SetPropertiesimplementations cast the result ofResource.GetEObject(...)directly to a concrete type.GetEObjectcan fail to resolve (e.g. incomplete/cross-resource models), producing aNullReferenceExceptionorInvalidCastExceptionwith no actionable message.ECoreNetto/ModelElement/NamedElement/Classifier/EClass.cs:186,ECoreNetto/ModelElement/NamedElement/ETypedElement.cs:139,ECoreNetto/ModelElement/NamedElement/TypedElement/StructuralFeature/EReference.cs:122Resource/EObjectthat resolves-and-validates a typed reference.NullReference/InvalidCast.