We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
文档中给出的第一个Java示例,查询未使用方法
// script use coref::java::* fn default_java_db() -> JavaDB { return JavaDB::load("coref_java_src.db") } // find unused methods fn unused_method(unused: string) -> bool { for(c in Callable(default_java_db()), method in Callable(default_java_db()), caller in method.getCaller()) { if (c != caller && unused = method.getSignature()) { return true } } } fn main() { output(unused_method()) }
这里的判断逻辑中method的caller非空,得到的应该是被使用过的方法。 可以做类似这样的修正
method
caller
fn unused_method(unused: string) -> bool { for(method in Callable(default_java_db())){ if(0 = method.getCaller().len() && unused = method.getSignature()){ return true } } }
使之返回未使用方法。
The text was updated successfully, but these errors were encountered:
应该是文档之前没更新,example 脚本之前有修复过 example/java/UnusedMethod.gdl
Sorry, something went wrong.
No branches or pull requests
文档中给出的第一个Java示例,查询未使用方法
这里的判断逻辑中
method
的caller
非空,得到的应该是被使用过的方法。可以做类似这样的修正
使之返回未使用方法。
The text was updated successfully, but these errors were encountered: