Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » comparing MethodInvocation with a Statement
comparing MethodInvocation with a Statement [message #152174] Sat, 03 April 2004 10:36 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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)
Previous Topic:Where is the "Format" API action
Next Topic:Listening to Tab Activations in Java Editor
Goto Forum:
  


Current Time: Sun Jul 27 06:22:13 EDT 2025

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

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

Back to the top