Java interop with finagle 7 emits "malformed variable arity method: addGauge$"
See original GitHub issueIn working to update finagle zipkin to finagle 7 (https://github.com/openzipkin/zipkin-finagle/pull/35) we are seeing that the compiler complains about a malformed variable arity method: addGauge$
Expected behavior
Compilation succeeds
Actual behavior
Compilation fails
Steps to reproduce the behavior
The project in the PR easily reproduces the issue by just accessing import com.twitter.finagle.stats.StatsReceiver;
in java. The full compilation error is:
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/devshorts/src/zipkin-finagle/core/src/main/java/zipkin/finagle/ReporterMetricsAdapter.java:[18,33] cannot access com.twitter.finagle.stats.StatsReceiver
bad class file: /Users/devshorts/.m2/repository/com/twitter/util-stats_2.12/7.0.0/util-stats_2.12-7.0.0.jar(/com/twitter/finagle/stats/StatsReceiver.class)
class file contains malformed variable arity method: addGauge$(com.twitter.finagle.stats.StatsReceiver,java.lang.String[],scala.Function0)
Please remove or make sure it appears in the correct subdirectory of the classpath.
[INFO] 1 error
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
class file contains malformed variable arity method for vararg ...
JDK11 compiler can't process a class file produced by kotlin compiler for a vararg constructor of a sealed class. See the following example....
Read more >Java Interop与FinAGLE 7发出“格式错误的变量ARINE方法 ...
标题: Java Interop与FinAGLE 7发出“格式错误的变量ARINE方法:Addgauge $”. Java interop with finagle 7 emits "malformed variable arity method: addGauge$".
Read more >Javadoc complains about bad class file, while compile and ...
(com.sun.tools.javac.code.ClassFinder$BadClassFile: bad class file: ./example/Foo$1.class class file contains malformed variable arity method: (java.lang.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks @devshorts!
I downloaded the util-stats-7.0.0 package for 2.12 and checked it against
javap
. Indeed there is a staticaddGauge$
method there: https://gist.github.com/vkostyukov/1ac96e29684c7345bd16d2db59c1d732I honestly have no idea why
Will keep digging.
I’m getting somewhere. These
$
-prefixed methods are coming from Scala 2.12. Here is the relevant piece of SR compiled against 2.11.11:Here is the same, but for Scala 2.12.1:
@kevinoliver pointed out that this could be related to 58c1d00679d23d6210be3f71e20739192545552b so var-arg isn’t in the final position now. yet we have a Java compilation test that compiles perfectly with both 2.11 and 2.12.