-
Notifications
You must be signed in to change notification settings - Fork 111
Add ClassLoader support for ASM ClassWriter #472
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
Conversation
For bigger and more complicated classes org.objectweb.asm.ClassWriter requires access to classloader where can found classes used in transformed class. Also add a warning when a class cannot be transformed.
|
Looks good to me, tests fine, but I did not thoroughtly review the code. Just some quick feedback here. BTW, I ran my test with these changes in place, which I also found useful when debugging the issue before, being curious about the root cause. Not sure if you would like to add something like this for debug logging (I am logging on INFO for my private use case, just change it to DEBUG if necessary). |
|
Besides, in order to test that public class Foo {
static {
System.exit(0);
}
public Foo() {
System.exit(0);
}
public static void main(String[] args) {
System.exit(0);
}
public void foo() {
System.exit(0);
}
}As you can see below, those cases are indeed handled correctly, but of course a Please consider adding a class like this to your test bed. <execution>
<id>dummy</id>
<phase>verify</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>Foo</mainClass>
<blockSystemExit>true</blockSystemExit>
</configuration>
</execution> |
|
@slawekjaranowski, maybe like this to handle the Or, if you use |
|
@kriegaex thanks for review ... first proposition - I would like to log in debug level info about replace exit method second - with next test it is ok for me |
|
@slawekjaranowski, so are you taking it from here or waiting for me to do anything else? Something like another PR piggy-backing on top of this one? I am just asking to avoid a stalemate of two people waiting for the other one to move first. |
simply lack of time .... I will merge it as is, without additional not related changes. It will be great if you prepare separate PRs with your proposition. |


For bigger and more complicated classes org.objectweb.asm.ClassWriter requires access to classloader where can found classes used in transformed class.
Also add a warning when a class cannot be transformed.