Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 264564 - [Xtend] Expressions cannot represent large ordinal numbers
Summary: [Xtend] Expressions cannot represent large ordinal numbers
Status: CLOSED FIXED
Alias: None
Product: M2T
Classification: Modeling
Component: Xpand (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-11 13:22 EST by Heiko Behrens CLA
Modified: 2013-02-21 08:12 EST (History)
0 users

See Also:


Attachments
Long->BigInteger, Implicit type conversion for java extensions, minor fixes (49.82 KB, patch)
2009-02-11 13:43 EST, Heiko Behrens CLA
sven.efftinge: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Heiko Behrens CLA 2009-02-11 13:22:19 EST
The current implementation for ordinal numbers relies on java.lang.Long. Even though Ecore offers an unbound integer type EBigInteger and the expression engine works quite well with this to some degree (e.g. printing in Xpand) there a some pitfalls, though. Arithmetic  operations lead to overflows and comparisons are simply wrong.

I will attach a patch that changes the internal representation of expression.Integer to java.math.BigInteger and do some further improvements to comparisons between expresssion.Real and expression.Integer.
Since this change would cause incompatibilities with existing java extensions that expect parameters to be of the type java.lang.Long I will also introduce an automatic type conversion for these cases. This will not only work for this specific case but leverages the expression's convert method to be more general. Therefore, it is suitable to pass an Int to a java method that accepts only bytes or to pass a string of length 1 to a java method that accepts only characters.
Comment 1 Heiko Behrens CLA 2009-02-11 13:43:39 EST
Created attachment 125427 [details]
Long->BigInteger, Implicit type conversion for java extensions, minor fixes
Comment 2 Jan Koehnlein CLA 2009-02-12 05:27:14 EST
patch applied.
Comment 3 Karsten Thoms CLA 2013-02-21 08:12:08 EST
Bug resolved before Xpand 1.2 release date => Closing