Skip to main content


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 12:17 Go to next message
Eclipse UserFriend
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 15:23 Go to previous message
Eclipse UserFriend
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: Fri Apr 26 03:49:29 GMT 2024

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

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

Back to the top