Skip to content
New issue

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

如果目标方法中抛异常了,插入,替换等操作就无效了 #40

Open
fengyuwuzu526 opened this issue May 10, 2023 · 0 comments

Comments

@fengyuwuzu526
Copy link

如果我需要替换的方法是抛异常的,那么就无法替换,或者插入log等。
比如我想创建文件方法前后添加log
方法如下
public boolean createNewFile() throws IOException {
SecurityManager security = System.getSecurityManager();
if (security != null) security.checkWrite(path);
if (isInvalid()) {
throw new IOException("Invalid file path");
}
return fs.createFileExclusively(path);
}

此时xml配置这样写


void java.io.File.createNewFile()


android.util.Log.e("@@@@@","java.io.FilecreateNewFile");

发现无效。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant