Skip to content

在 addTransformer 时,不设置 canRetransform 为 true,会有一部分类不经过 ClassFileTransformer 处理 #35

@hengyunabc

Description

@hengyunabc

正常来说,一个普通的 java agent,如果是以 -javaagent: 方式启动,注册 ClassFileTransformer 之后,后续加载的类都会经过注册的 ClassFileTransformer 处理。

但实际发现,有部分类并不会被处理。只有注册时设置canRetransform为true时,才会被处理。

比如这个类:org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory

Instrumentation#addTransformer(ClassFileTransformer transformer, boolean canRetransform);

记录一下现象。

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