comparing MethodInvocation with a Statement [message #152174] |
Sat, 03 April 2004 10:36  |
Eclipse User |
|
|
|
Hi,
I'd like to compare a MethodInvocation with a Statement.
I know that they are equal but
statement.subtreeMatch(new ASTMatcher(), methodInvocation)
returns false.
example:
methodInvocation.toString() = 'System.out.println()'
statement.toString() = 'System.out.println();'
(notice the trailing ';')
Thanks in advance.
Cheers,
Jan.
|
|
|
Re: comparing MethodInvocation with a Statement [message #152672 is a reply to message #152174] |
Tue, 06 April 2004 08:12  |
Eclipse User |
|
|
|
Originally posted by: scheglov_ke.nlmk.ru
Jan-Friedrich Mutter <krabatz@gmx.net> wrote:
IMHO equal is fully equal, not "almost same, except ';'". :-)
So, subtreeMatch even checks that ASTNode's have same class.
You can check for example that Statement is ExpressionStatement with
equal MethodInvocation as expression.
> I'd like to compare a MethodInvocation with a Statement.
> I know that they are equal but
> statement.subtreeMatch(new ASTMatcher(), methodInvocation)
> returns false.
> example:
> methodInvocation.toString() = 'System.out.println()'
> statement.toString() = 'System.out.println();'
> (notice the trailing ';')
> Thanks in advance.
> Cheers,
> Jan.
--
SY, Konstantin.
Advanced Eclipse SWT Designer (http://www.swt-designer.com)
|
|
|
Powered by
FUDForum. Page generated in 0.03553 seconds