-
Notifications
You must be signed in to change notification settings - Fork 8
Closed
Description
If a classifier member has the same name as an inherited member, an error is not reported when also inheriting an unnamed mode transition. The following model should produce an error, but it doesn't:
package duplicate_name
public
system s
features
e: in event port;
modes
m1: initial mode;
m2: mode;
m1 -[e]-> m2;
end s;
system implementation s.i1
subcomponents
sub: abstract;
end s.i1;
system implementation s.i2 extends s.i1
subcomponents
sub: system;
end s.i2;
end duplicate_name;
Giving the mode transition a name will cause an error to be reported on sub in s.i2. The problem is that the validator assumes that all NamedElements have a non-null name. This results in a NullPointerException which aborts that validation. A null check needs to be added here:
osate2/core/org.osate.xtext.aadl2/src/org/osate/xtext/aadl2/validation/Aadl2JavaValidator.java
Line 2812 in ec6e246
| && ((NamedElement) ownedElement).getName().equalsIgnoreCase(ne.getName())) { |