Exception when invoking a helper method [message #915025] |
Sun, 16 September 2012 03:35  |
Eclipse User |
|
|
|
Hi,
I've added a new helper method to the existing file xpt/diagram/editparts/Utils.qvto:
helper getLabelText(classbody : String, key : String) : String {
var s : String := classbody;
...
return newStr;
}
Then i call this method from a template file
«DEFINE figureText(key : String) FOR gmfgen::InnerClassViewmap»
«getLabelText(self.classBody,key)»
«ENDDEFINE»
While generating the diagram code I get the following exception:
Problems while generating code
Exception (Cannot find operation (getLabelText(String, String)) for the type (null):in aspects::impl::diagram::editparts::NodeEditPart, line 34) while generating code
I can rule out that neither 'self.classbody' nor 'key' is null, because when I use the arguments in the template itself, everything works fine. What could be the reason for that problem?
Regards,
Rami
|
|
|
Re: Exception when invoking a helper method [message #915036 is a reply to message #915025] |
Sun, 16 September 2012 04:27   |
Eclipse User |
|
|
|
Hi
It is very likely that an error message complaining about 'null' is
because at the point the error is generated the problem context is
indeed null.
You rule out 'self.classbody' nor 'key' being null but
- are they the correct contexts to rule out
- is your observation an observation of the actual state at the actual time
In the absence of anyone recognising the problem, you need to debug why
the Exception arises.
You may have more luck on the GMF newsgroup since this is unlikely to be
a QVTo problem.
Regards
Ed Willink
On 16/09/2012 08:35, Rami D. wrote:
> Hi,
>
> I've added a new helper method to the existing file
> xpt/diagram/editparts/Utils.qvto:
>
>
> helper getLabelText(classbody : String, key : String) : String {
>
> var s : String := classbody;
> ...
>
> return newStr;
> }
>
>
> Then i call this method from a template file
> «DEFINE figureText(key : String) FOR gmfgen::InnerClassViewmap»
> «getLabelText(self.classBody,key)»
> «ENDDEFINE»
>
>
> While generating the diagram code I get the following exception:
>
>
> Problems while generating code
> Exception (Cannot find operation (getLabelText(String, String)) for
> the type (null):in aspects::impl::diagram::editparts::NodeEditPart,
> line 34) while generating code
>
>
> I can rule out that neither 'self.classbody' nor 'key' is null,
> because when I use the arguments in the template itself, everything
> works fine. What could be the reason for that problem?
>
> Regards,
> Rami
|
|
|
|
|
Re: Exception when invoking a helper method [message #915382 is a reply to message #915119] |
Mon, 17 September 2012 03:11  |
Eclipse User |
|
|
|
Hi Ed,
i still didn't get it how to debug. I copied my eclipse instance and started the first eclipse with the given parameters. Then I've started the second eclipse instance and created a remote application using port 14143 with the gmf project as the source application. I've set a breakpoint at the beginning of my helper method in the Utils.qvto but when I generate the diagram code it doesn't stop there.
Did I miss something or what's going wrong?
Regards,
Rami
|
|
|
Powered by
FUDForum. Page generated in 0.25282 seconds