Syntax helper for OCL undefined type [message #31734] |
Mon, 02 July 2007 12:17 |
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 15:23 |
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.
>
|
|
|
Powered by
FUDForum. Page generated in 0.03282 seconds