Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Does ATL handle long number type ?
[ATL] Does ATL handle long number type ? [message #10692] Fri, 19 January 2007 14:05
Delphin Lecucq is currently offline Delphin LecucqFriend
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
Previous Topic:Empty Stack Exception
Next Topic:[ATL] collection assignment
Goto Forum:
  


Current Time: Tue Mar 19 02:34:30 GMT 2024

Powered by FUDForum. Page generated in 0.02551 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top