I have an example where I apply a set operation to property values that are lists and then calculate the length of the result. I use as_set to convert from the list to the set.
Resolute gets a class cast exception,when I do a clean build. You can find it in the Errorlog (stack trace is also shown below).
The attached example has 'let set1 ..' with the error, while the second line 'let list2 ..' works fine.
Peter
Example:
property set SecurityProps is
security_levels : list of aadlinteger => (100) applies to (all);
end SecurityProps;
and in a separate file:
package myresolutelib
public
annex Resolute {**
same_security (comp1 : aadl, comp2 : aadl) <=
** "Element " comp1 " and " comp2 " have the same security level(s)" **
let set1 : {int}= as_set(property (comp1, SecurityProps::security_levels)); -- class cast exception in validation of as_set
-- com.rockwellcollins.atc.resolute.validation.BaseType cannot be cast to com.rockwellcollins.atc.resolute.validation.ListType
let list2 :[int]= property (comp2, SecurityProps::security_levels); let set2: {int}=as_set(list2); -- validation works fine
length(intersect (set1,set2)) = 1
**};
end myresolutelib;
!STACK 0
java.lang.ClassCastException: com.rockwellcollins.atc.resolute.validation.BaseType cannot be cast to com.rockwellcollins.atc.resolute.validation.ListType
at com.rockwellcollins.atc.resolute.validation.ResoluteJavaValidator.getListFnElementType(ResoluteJavaValidator.java:1356)
at com.rockwellcollins.atc.resolute.validation.ResoluteJavaValidator.getBuiltInFnCallType(ResoluteJavaValidator.java:1257)
at com.rockwellcollins.atc.resolute.validation.ResoluteJavaValidator.getExprType(ResoluteJavaValidator.java:1025)
at com.rockwellcollins.atc.resolute.validation.ResoluteJavaValidator.checkLetExpr(ResoluteJavaValidator.java:255)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
The text was updated successfully, but these errors were encountered:
I have an example where I apply a set operation to property values that are lists and then calculate the length of the result. I use as_set to convert from the list to the set.
Resolute gets a class cast exception,when I do a clean build. You can find it in the Errorlog (stack trace is also shown below).
The attached example has 'let set1 ..' with the error, while the second line 'let list2 ..' works fine.
Peter
Example:
property set SecurityProps is
end SecurityProps;
and in a separate file:
package myresolutelib
public
annex Resolute {**
same_security (comp1 : aadl, comp2 : aadl) <=
** "Element " comp1 " and " comp2 " have the same security level(s)" **
let set1 : {int}= as_set(property (comp1, SecurityProps::security_levels)); -- class cast exception in validation of as_set
-- com.rockwellcollins.atc.resolute.validation.BaseType cannot be cast to com.rockwellcollins.atc.resolute.validation.ListType
let list2 :[int]= property (comp2, SecurityProps::security_levels); let set2: {int}=as_set(list2); -- validation works fine
length(intersect (set1,set2)) = 1
**};
end myresolutelib;
!STACK 0
java.lang.ClassCastException: com.rockwellcollins.atc.resolute.validation.BaseType cannot be cast to com.rockwellcollins.atc.resolute.validation.ListType
at com.rockwellcollins.atc.resolute.validation.ResoluteJavaValidator.getListFnElementType(ResoluteJavaValidator.java:1356)
at com.rockwellcollins.atc.resolute.validation.ResoluteJavaValidator.getBuiltInFnCallType(ResoluteJavaValidator.java:1257)
at com.rockwellcollins.atc.resolute.validation.ResoluteJavaValidator.getExprType(ResoluteJavaValidator.java:1025)
at com.rockwellcollins.atc.resolute.validation.ResoluteJavaValidator.checkLetExpr(ResoluteJavaValidator.java:255)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
The text was updated successfully, but these errors were encountered: