If the SysML v2 model contains attributes with initial values, e.g.,
attribute count : ScalarValues::Integer := 0;
and the type of the corresponding attribute is retrieved programatically, e.g.,
AttributeUsage countAttribute = ...
...
countAttribute.getType()
then the code throws a nullptr exception. This is because the FeatureAdapter.getTypes(List<Type> types, Set<Feature> visitedFeatures) method makes the types attribute null as a result of calling the computeImplicitGeneralTypes() method, which (indirectly) calls the clearCache() method making the types attribute null.
I am attaching a small SysML v2 model to facilitate the reproduction of the bug.
ExampleUsageExtension2.txt