本文介绍了如何使用结构化搜索来查找给定类型的子类的构造函数调用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个名为"com.foo.BaseFoo"的抽象类

I have an abstract class called "com.foo.BaseFoo"

我想找到在BaseFoo扩展的任何东西上调用new()的人

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.

推荐答案

您快到了.使用如下模板:

You were almost there. Use a template like the following:

new $BaseFoo$($argument$)

$ BaseFoo $
文字/正则表达式:com\.foo\.BaseFoo
检查在类型层次结构中应用约束

Where $BaseFoo$
Text/regexp: com\.foo\.BaseFoo
check Apply constraint within type hierarchy

和$ argument $
最小数量:0最大数量:无限制

and $argument$
minimum count: 0maximum count: unlimited

这篇关于如何使用结构化搜索来查找给定类型的子类的构造函数调用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 03:12