[ATL] Does ATL handle long number type ? [message #10692] |
Fri, 19 January 2007 14:05 |
Delphin Lecucq Messages: 4 Registered: July 2009 |
Junior Member |
|
|
Hi,
I'm wondering if ATL can handle long integer values since it uses 2 OCL
number types, Integer which Java type is int, and Real which Java type
is double.
I have an AADL metamodel with a metaclass IntegerValue that holds 2
attributes:
value: ELong
base: EInt
I have to produce several constants that have important values such as
the following one:
<propertyConstant name="Max_Base_Address">
<propertyType xsi:type="property:Aadlinteger"/>
<constantValue xsi:type="property:IntegerValue"
valueString="2#1#e32" value="4294967296" base="2"/>
</propertyConstant>
4294967296 does not fit in 'int' datatype. the maximum is 2147483647
(2^31 - 1)
If I write 4294967296 in my ATL file, an error is raised at compilation
time (java.lang.NumberFormatException)
There may be something weird in my ATL environment, ELong seems to be
bound to <java.lang.Integer> type. I think that some one has voluntarily
modified AADL.ecore metamodel to be compatible with ATL.
In my AADL modeling environment (OSATE), properties with such big values
are loaded without any problem. Indeed, OSATE's AADL ecore metamodel
uses <long> for ELong datatype.
I tried to use OSATE's AADL ecore files in my ATL environment, I had
sereval warnings and a ClassCastException at runtime:
Warning: metamodel contains several classifiers with same name: AadlSpec
Warning: metamodel contains several classifiers with same name:
core::AadlSpec
Warning: metamodel contains several classifiers with same name: AadlPackage
Warning: metamodel contains several classifiers with same name:
core::AadlPackage
....
....
****** BEGIN Stack Trace
message: cannot set feature AADL!IntegerValue.value to value 10
exception:
java.lang.ClassCastException: The value of type 'class
java.lang.Integer' must be of type 'class java.lang.Long'
Can someone help me ?
Thanks in advance,
Delphin Lecucq
TNI-Software
|
|
|
Powered by
FUDForum. Page generated in 0.03082 seconds