I'm using the asm library for java instrumentation and I want t开发者_如何学JAVAo instrument an "import" instruction. so that by using visitMethodInsn and INVOKEVIRTUAL i would be able to call a function from my package. I'm aware that when I have a bytecode the linkage stage is over so I might have trouble doing so. any solution/detour?
byte code uses full package.class names. There is no "import" equivelents at the byte code level. If you want to import a class, just use its fully qualified name.
精彩评论