-
Notifications
You must be signed in to change notification settings - Fork 17
Closed
Labels
Milestone
Description
When attempting to use long[]::new as a method reference for java.util.function.IntFunction<long[]> causes an Instrumentation error.
It does not matter if the method reference is being used directly in a method call or in a variable declaration. The easiest way to recreate is to simply declare a class level constant: static final IntFunction<long[]> NEW_LONG_ARRAY = long[]::new;
This will result in following failure:
[INFO] Processing files at 1.8 source level. [INFO] C:\workspaces...\Util.java:21:5:unexpected token: static [INFO] Instrumentation error com.atlassian.clover.api.CloverException: C:\workspaces...\Util.java:21:5:unexpected token: static at com.atlassian.clover.instr.java.Instrumenter.instrument(Instrumenter.java:161) at com.atlassian.clover.CloverInstr.execute(CloverInstr.java:76) at com.atlassian.clover.CloverInstr.mainImpl(CloverInstr.java:54) at com.atlassian.maven.plugin.clover.internal.instrumentation.AbstractInstrumenter.instrumentSources(AbstractInstrumenter.java:197) at com.atlassian.maven.plugin.clover.internal.instrumentation.AbstractInstrumenter.instrument(AbstractInstrumenter.java:72) at com.atlassian.maven.plugin.clover.CloverInstrumentInternalMojo.execute(CloverInstrumentInternalMojo.java:289)