문제

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()
도움이 되었습니까?

해결책

I got the answer myself:

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top