Skip to content

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

@fengyuwuzu526

Description

@fengyuwuzu526

如果我需要替换的方法是抛异常的,那么就无法替换,或者插入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");

发现无效。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions