views:

38

answers:

1

Is it possible to do a structural search on instances of a certain class in IDEA? I want to search usages of == on two instances of a given class. The instantiation is not part of my search. E.g.

Currency lhs = new Currency("CHF");
Currency rhs = new Currency("USD");

...
...


if (lhs == rhs) {
}

Here I'm looking for the lhs == rhs, not the other parts of the code. At the same time I'm looking for exactly the case where lhs and rhs are instances of Currency.

What I also want to achieve is to find occurencies of this pattern where rhs is a result of method calls:

lhs == foo.getSomething().getCurrency()
A: 

I got the answer myself:

In the Edit Variables frame it is possible to specify the "Text / reqular expression for java expression type".

lewap