问题
I have an abstract class called "com.foo.BaseFoo"
I want to find anyone that calls new() on anything that extends from BaseFoo
I've tried doing a search template of:
new $BaseFoo$()
and then edited the variables to have an expression constraint on the type of the object to be
com.foo.BaseFoo
and clicked on the "Apply constraint within type hierarchy" but this hasn't worked.
回答1:
You were almost there. Use a template like the following:
new $BaseFoo$($argument$)
Where $BaseFoo$
Text/regexp: com\.foo\.BaseFoo
check Apply constraint within type hierarchy
and $argument$
minimum count: 0
maximum count: unlimited
来源:https://stackoverflow.com/questions/17861540/how-can-you-use-structural-search-to-find-constructor-calls-for-subclasses-of-a