Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Epsilon ETL/EOL String to Double using isReal conversion gives Float Cast exception
Epsilon ETL/EOL String to Double using isReal conversion gives Float Cast exception [message #1791173] Mon, 25 June 2018 13:09 Go to next message
Bas Har is currently offline Bas HarFriend
Messages: 18
Registered: May 2017
Junior Member
I am trying to save a string defined value in a SysML model into to a Real value an a new metamodel using
element.someAttribute = "0.00007d".asReal();

then I get an exception:
[color=red]Internal error: java.lang.ClassCastException: java.lang.Float cannot be cast to java.lang.Double[/color]


Then I tried this just for PoC:
var temp:Any = 0.0000007d;
element.someAttribute = temp;

And it worked just fine.

Any assistance on this matter is highly appreciated.
Thank you.
Re: Epsilon ETL/EOL String to Double using isReal conversion gives Float Cast exception [message #1791184 is a reply to message #1791173] Mon, 25 June 2018 15:18 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2162
Registered: July 2009
Location: York, UK
Senior Member

Is there an asDouble() by any chance?

Cheers,
Dimitris
Re: Epsilon ETL/EOL String to Double using isReal conversion gives Float Cast exception [message #1791186 is a reply to message #1791184] Mon, 25 June 2018 16:01 Go to previous messageGo to next message
Bas Har is currently offline Bas HarFriend
Messages: 18
Registered: May 2017
Junior Member
It does.

You are a life saver.

Appreciate it.

This is not in the Epsilon book, where can I find the source code for this method? or is their any other documentation for this? and maybe similar utils that can be useful in such cases?

Thank you.
Re: Epsilon ETL/EOL String to Double using isReal conversion gives Float Cast exception [message #1791213 is a reply to message #1791186] Tue, 26 June 2018 05:40 Go to previous message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2162
Registered: July 2009
Location: York, UK
Senior Member

Hi,

The asDouble() method is in org.eclipse.epsilon.eol.execute.operations.contributors.AnyOperationContributor and I've just added it to the book.

Cheers,
Dimitris
Previous Topic:EGL template operations error
Next Topic:EVL live in reflective editor
Goto Forum:
  


Current Time: Fri Apr 19 03:59:39 GMT 2024

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

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

Back to the top