Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Null pointer exception while parsing file
Null pointer exception while parsing file [message #16998] Thu, 12 April 2007 09:08 Go to next message
Youmm P. is currently offline Youmm P.Friend
Messages: 140
Registered: July 2009
Senior Member
Hello,

I was trying to parse this file

"context Fruit::myMethod() : MyObject
pre
cond1: true = true
"

but in a method class context (in fact I'm not sure if it's possible...):

"context myMethod() : MyObject
pre
cond1: true = true
"

however with the last file I get a null pointer exception. A parser
exception would be nicer :)

Perhaps I made some mistakes in the source code, you can find it here :

http://rafb.net/p/K29acM86.html
Re: Null pointer exception while parsing file [message #17090 is a reply to message #16998] Thu, 12 April 2007 16:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Youmm,

Comments in-line, below.

HTH,

Christian


Youmm P. wrote:

> Hello,
>
> I was trying to parse this file
>
> "context Fruit::myMethod() : MyObject
> pre
> cond1: true = true
> "

This is the correct form of an operation precondition constraint.


> but in a method class context (in fact I'm not sure if it's possible...):
>
> "context myMethod() : MyObject
> pre
> cond1: true = true
> "

This is not a valid operation context; the operation must be qualified with
a classifier name as in your first example.


> however with the last file I get a null pointer exception. A parser
> exception would be nicer :)

Yes, a parse exception would be nicer than an NPE. Would you mind raising a
bug with the details? (OCL text and stack trace)

https://bugs.eclipse.org/bugs/enter_bug.cgi?product=MDT& version=1.1.0&component=OCL


> Perhaps I made some mistakes in the source code, you can find it here :
>
> http://rafb.net/p/K29acM86.html
Re: Null pointer exception while parsing file [message #17206 is a reply to message #17090] Fri, 13 April 2007 09:22 Go to previous message
Youmm P. is currently offline Youmm P.Friend
Messages: 140
Registered: July 2009
Senior Member
> Yes, a parse exception would be nicer than an NPE. Would you mind raising a
> bug with the details? (OCL text and stack trace)
>
> https://bugs.eclipse.org/bugs/enter_bug.cgi?product=MDT& version=1.1.0&component=OCL
>
>

Bug submitted here :

https://bugs.eclipse.org/bugs/show_bug.cgi?id=182286
Previous Topic:[Announce] MDT OCL 1.1.0 I200704121504 is available
Next Topic:[Announce] MDT OCL 1.1.0 I200704131044 is available
Goto Forum:
  


Current Time: Wed Apr 24 20:59:21 GMT 2024

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

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

Back to the top