Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Long exceptions
Long exceptions [message #60417] Mon, 11 August 2008 18:20 Go to next message
Eclipse User
Originally posted by: birar01.ca.com

I'm having problems with ELong. It sounds like there could be a bug. I had
posted this as a reply to a 2007 message but I thought I should post again
so that it appears on the top of the newsreaders. My ocl version is 1.1.2

thanks,
-Arvinder Birdi

In ocl I specify a maximum value for a ELong field using a value which EInt
cannot store but
then get a parse error:

java.lang.NumberFormatException: For input string: "4294967295"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.valueOf(Unknown Source)
at
org.eclipse.ocl.internal.parser.OCLLPGParser.createIntegerLi teralExpCS(OCLLPGParser.java:477)
at
org.eclipse.ocl.internal.parser.OCLLPGParser.ruleAction(OCLL PGParser.java:2018)
at
lpg.lpgjavaruntime.DeterministicParser.processReductions(Det erministicParser.java:55)
at
lpg.lpgjavaruntime.DeterministicParser.parse(DeterministicPa rser.java:115)
at
org.eclipse.ocl.internal.parser.OCLLPGParser.parser(OCLLPGPa rser.java:178)
at
org.eclipse.ocl.internal.parser.OCLLPGParser.parser(OCLLPGPa rser.java:150)
at
org.eclipse.ocl.internal.parser.OCLParser.parseConcreteSynta x(OCLParser.java:743)
at
org.eclipse.ocl.internal.parser.OCLParser.parsePackageDeclar ationCS(OCLParser.java:801)
at org.eclipse.ocl.OCL.parse(OCL.java:243)


When I specify a value which EInt can store I get the following exception at
runtime:

java.lang.ClassCastException: java.lang.Integer cannot be cast to
java.lang.Long
at java.lang.Long.compareTo(Unknown Source)
at
org.eclipse.ocl.internal.evaluation.EvaluationVisitorImpl.vi sitOperationCallExp(EvaluationVisitorImpl.java:1067)
at
org.eclipse.ocl.ecore.impl.OperationCallExpImpl.accept(Opera tionCallExpImpl.java:336)
at
org.eclipse.ocl.AbstractEvaluationVisitor.visitExpression(Ab stractEvaluationVisitor.java:223)
at
org.eclipse.ocl.internal.evaluation.QueryImpl.evaluate(Query Impl.java:120)
at
org.eclipse.ocl.internal.evaluation.QueryImpl.check(QueryImp l.java:151)
at org.eclipse.ocl.ecore.QueryImpl.check(QueryImpl.java:54)
at
org.eclipse.emf.validation.ocl.AbstractOCLModelConstraint$Qu eryManager.check(AbstractOCLModelConstraint.java:261)
at
org.eclipse.emf.validation.ocl.AbstractOCLModelConstraint.va lidate(AbstractOCLModelConstraint.java:205)
Re: Long exceptions [message #60441 is a reply to message #60417] Mon, 11 August 2008 18:40 Go to previous message
Eclipse User
Originally posted by: cdamus.zeligsoft.com

Hi, Arvinder,

A bug involving problems with handling long precision values was
addressed in the 1.2 release:

https://bugs.eclipse.org/198451

Does this look like your problem? Are you able to reproduce your
problem with the 1.2 release? It's worth the upgrade ;-)

HTH,

Christian


arvinder birdi wrote:
> I'm having problems with ELong. It sounds like there could be a bug. I had
> posted this as a reply to a 2007 message but I thought I should post again
> so that it appears on the top of the newsreaders. My ocl version is 1.1.2
>
> thanks,
> -Arvinder Birdi
>
> In ocl I specify a maximum value for a ELong field using a value which EInt
> cannot store but
> then get a parse error:
>
> java.lang.NumberFormatException: For input string: "4294967295"
> at java.lang.NumberFormatException.forInputString(Unknown Source)
> at java.lang.Integer.parseInt(Unknown Source)
> at java.lang.Integer.valueOf(Unknown Source)
> at
> org.eclipse.ocl.internal.parser.OCLLPGParser.createIntegerLi teralExpCS(OCLLPGParser.java:477)
> at
> org.eclipse.ocl.internal.parser.OCLLPGParser.ruleAction(OCLL PGParser.java:2018)
> at
> lpg.lpgjavaruntime.DeterministicParser.processReductions(Det erministicParser.java:55)
> at
> lpg.lpgjavaruntime.DeterministicParser.parse(DeterministicPa rser.java:115)
> at
> org.eclipse.ocl.internal.parser.OCLLPGParser.parser(OCLLPGPa rser.java:178)
> at
> org.eclipse.ocl.internal.parser.OCLLPGParser.parser(OCLLPGPa rser.java:150)
> at
> org.eclipse.ocl.internal.parser.OCLParser.parseConcreteSynta x(OCLParser.java:743)
> at
> org.eclipse.ocl.internal.parser.OCLParser.parsePackageDeclar ationCS(OCLParser.java:801)
> at org.eclipse.ocl.OCL.parse(OCL.java:243)
>
>
> When I specify a value which EInt can store I get the following exception at
> runtime:
>
> java.lang.ClassCastException: java.lang.Integer cannot be cast to
> java.lang.Long
> at java.lang.Long.compareTo(Unknown Source)
> at
> org.eclipse.ocl.internal.evaluation.EvaluationVisitorImpl.vi sitOperationCallExp(EvaluationVisitorImpl.java:1067)
> at
> org.eclipse.ocl.ecore.impl.OperationCallExpImpl.accept(Opera tionCallExpImpl.java:336)
> at
> org.eclipse.ocl.AbstractEvaluationVisitor.visitExpression(Ab stractEvaluationVisitor.java:223)
> at
> org.eclipse.ocl.internal.evaluation.QueryImpl.evaluate(Query Impl.java:120)
> at
> org.eclipse.ocl.internal.evaluation.QueryImpl.check(QueryImp l.java:151)
> at org.eclipse.ocl.ecore.QueryImpl.check(QueryImpl.java:54)
> at
> org.eclipse.emf.validation.ocl.AbstractOCLModelConstraint$Qu eryManager.check(AbstractOCLModelConstraint.java:261)
> at
> org.eclipse.emf.validation.ocl.AbstractOCLModelConstraint.va lidate(AbstractOCLModelConstraint.java:205)
>
>
>
Previous Topic:EDataType support in OCL
Next Topic:[Announce] MDT OCL 1.2.1 is available
Goto Forum:
  


Current Time: Wed Aug 27 23:16:41 EDT 2014

Powered by FUDForum. Page generated in 0.02169 seconds