-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
fix java8 lambda #68
fix java8 lambda #68
Conversation
Current coverage is 84.39%@@ master #68 diff @@
==========================================
Files 7 7
Lines 173 173
Methods 0 0
Messages 0 0
Branches 27 27
==========================================
Hits 146 146
Misses 17 17
Partials 10 10
|
@wuwen5 非常感谢 问题汇报和解决。 我看一下 ,如果OK,我就发一个新版本出来 😄 |
能给一下 『使用含有lambda语法』的代码, 方便复现问题后确认方案是有效解决的。 |
这是本地验证的时候的测试代码. public class Demo {
public static void main(String[] args) throws InterruptedException {
ExecutorService executorService = Executors.newFixedThreadPool(1);
executorService.execute(() -> System.out.println("++++"));
}
} 同样是 executorService.execute(new Runnable() {
@Override
public void run() {
System.out.println("---run test----")
}
}); |
Merge pull request #68 from wuwen5/fix-java8-lambda
Merge pull request #68 from wuwen5/fix-java8-lambda
Merge pull request #68 from wuwen5/fix-java8-lambda
@oldratlee 有个疑问请教下,我看代码transform的返回值改了,将不需要转换的class改成返回空数组了。 但是我很好奇ClassFileTransformer API的注释写的 不转换是返回 null,jvm这块处理空数组和null会是一样么?
|
Lambda是运行时生成的字节码, new Runnable是编译期的. |
@haogrgr 因为运行时生成字节码所以没class file。Got! |
在
java8
中,如果使用含有lambda
语法会有异常:分析发现仅在环境中使用了
lambda
的时候,classFile
是空的,导致空指针异常。我把classFileBuffer 写到文件然后查看发现是这样的: