Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Syntax helper for OCL undefined type
Syntax helper for OCL undefined type [message #31734] Mon, 02 July 2007 08:17 Go to next message
Eclipse User
Originally posted by: firstname.name.gmail.com

Hello,

I get a NullPointerException with the syntax helper when one of the typed
element has a undefined type.

For example, my class A has a property p. The type of p is not defined. I
select the class A, use the console OCL interpreter, ask a completion with
'self.' It triggers:

Caused by: java.lang.NullPointerException
at org.eclipse.ocl.uml.UMLReflectionImpl.getDescription(UMLRefl ectionImpl.java:92)

A quick look at the source gives:
org.eclipse.ocl.uml UMLReflectionImpl
//...
public String getDescription(Object namedElement) {
if (namedElement instanceof TypedElement) {
return ((TypedElement) namedElement).getType().getName();
}
//...
}

Now I am not able to state if its a bug or not, because I don't know how to deal
with a undefined type.

--
F. Lagarde
Re: Syntax helper for OCL undefined type [message #31875 is a reply to message #31734] Wed, 04 July 2007 11:23 Go to previous message
Eclipse User
Originally posted by: cdamus.ca.ibm.com

Hi, Fran├žois,

In UML, TypedElements can be well-formed without having a type. The syntax
helper should handle this more gracefully, probably by showing some kind of
"(untyped)" string or such.

This is a bug.

Cheers,

Christian


Fran├žois Lagarde wrote:

>
> Hello,
>
> I get a NullPointerException with the syntax helper when one of the typed
> element has a undefined type.
>
> For example, my class A has a property p. The type of p is not defined. I
> select the class A, use the console OCL interpreter, ask a completion with
> 'self.' It triggers:
>
> Caused by: java.lang.NullPointerException
> at
>
org.eclipse.ocl.uml.UMLReflectionImpl.getDescription(UMLRefl ectionImpl.java:92)
>
> A quick look at the source gives:
> org.eclipse.ocl.uml UMLReflectionImpl
> //...
> public String getDescription(Object namedElement) {
> if (namedElement instanceof TypedElement) {
> return ((TypedElement) namedElement).getType().getName();
> }
> //...
> }
>
> Now I am not able to state if its a bug or not, because I don't know how
> to deal with a undefined type.
>
Previous Topic:About adding new predefined propertys
Next Topic:problem with multiStatus
Goto Forum:
  


Current Time: Tue Jul 22 17:39:53 EDT 2014

Powered by FUDForum. Page generated in 0.02598 seconds