Yet another structural search question

Hello,

I have used the structural search and replace a few times in the past and have greatly impressed my eclipse-based colleagues with it. Lately I have tried to do a search that does not really look too complex to me, but so far I have not been successful with it. Here's the task:

Scan the code base to find all methods that have a parameter of type java.sql.ResultSet and that invoke next() on that parameter.

Is it possible to do this with structural search?

Thanks in advance and best regards,
Jens

2 comments
Comment actions Permalink

Yes, in two steps: search for methods and then search for 'next'
invokation in search results

Jens Voss wrote:

Hello,

I have used the structural search and replace a few times in the past and have greatly impressed my eclipse-based colleagues with it. Lately I have tried to do a search that does not really look too complex to me, but so far I have not been successful with it. Here's the task:

Scan the code base to find all methods that have a parameter of type java.sql.ResultSet and that invoke next() on that parameter.

Is it possible to do this with structural search?

Thanks in advance and best regards,
Jens



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

Thanks Maxim, I had not yet noticed the "Previous Search Results" scope; that seems to be quite valuable.

However, I am still having trouble with the first part. If I use the "method declaration" template


I can find all methods that have exactly one parameter and where that parameter is of type ResultSet. But that is only part of what I am searching: I want for instance to find a method declaration with one or two or three or four ... parameter of which the first or the second or the third ... is of type ResultSet. So far, I have not been able to do that with SSR. Could you give me another hint?

Thanks again and best regards,
Jens

0

Please sign in to leave a comment.