方法代码太大的方法代码失败了。
我有两个代码基础合并,我进行了此练习。但是,汇编失败了,以下错误。我已经经历了几个链接,似乎没有具体的解决方案。
我的问题是: 我如何确定哪个Groovy类将此错误作为其通用错误,而没有任何信息。我有成千上万的课程,其中很少有我已经纠正了,但仍在发生问题。我想迷失其中并寻求帮助。
错误:
java.lang.RuntimeException: Method code too large!
at groovyjarjarasm.asm.MethodWriter.a(Unknown Source)
at groovyjarjarasm.asm.ClassWriter.toByteArray(Unknown Source)
at org.codehaus.groovy.control.CompilationUnit$16.call(CompilationUnit.java:815)
at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1055)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:591)
at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:569)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:546)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:525)
at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:122)
at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:47)
at org.gradle.api.internal.tasks.compile.daemon.CompilerDaemonServer.execute(CompilerDaemonServer.java:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:360)
at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)
1 error
FAILED
我已经经历的链接很少,但没有帮助 方法代码在Groovy中太大& Grails?
根据Oracle文档,方法大小不应超过64K尺寸,我正在Ubuntu中运行此代码,并尝试了所有可能的类,该类别大于64K,并开始一个一个校正一个,但我正在获得100多个类,并且每个人都像无聊和忙碌一样。
是否有任何工具或库,我可以知道哪个类都有问题。
注意:我尝试通过Sonar/codenarc/Clover进行扫描,但对我来说没有什么效果。
I have got two code base to merge in one, I did this exercise. However, compilation is failing with below error. I have already gone through few links and it seems no concrete solution is available.
My Issue is:
How I can identify which Groovy class is throwing this error as its generic error without any information. I have thousands of classes and few of them I have already corrected but still issues are happening. I am like to lost into it and seeking help.
Error:
java.lang.RuntimeException: Method code too large!
at groovyjarjarasm.asm.MethodWriter.a(Unknown Source)
at groovyjarjarasm.asm.ClassWriter.toByteArray(Unknown Source)
at org.codehaus.groovy.control.CompilationUnit$16.call(CompilationUnit.java:815)
at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1055)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:591)
at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:569)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:546)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:525)
at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:122)
at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:47)
at org.gradle.api.internal.tasks.compile.daemon.CompilerDaemonServer.execute(CompilerDaemonServer.java:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:360)
at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)
1 error
FAILED
Few links which I have already gone through but it didn't help out
Method code too large in Groovy & Grails?
As per oracle documentation a method size should not exceed 64K size and I am running this code in Ubuntu and tried all possible classes which is greater than 64K and started correcting one by one but I am getting 100+ classes and going through each is like boring and hectic as well.
Is there any tool or library through which I can get to know which class is having issues.
Note: I tried scanning through sonar/codenarc/clover but nothing worked out for me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简单的尝试/捕捉会有所帮助。也可以沿呼叫流进行打印,以查看呼叫中的流量停止的位置(即滤波器 - interceptor - > controller - > interceptor)
Simple try/catch helps. Also do println along the callflow to see where flow stops in call (ie filter -> interceptor -> controller -> interceptor )