question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Runtime error: java.lang.VerifyError: Constructor must call super() or this() before return

See original GitHub issue

Compiler version

3.2.0-RC1

It was working on version 3.1.3

Minimized code

package json.value.spec.parser

import java.math.MathContext
import com.github.plokhotnyuk.jsoniter_scala.core.JsonReader
case class DecimalConf(mathContext: MathContext, scaleLimit: Int, digitsLimit: Int)


object DecimalConf extends DecimalConf(MathContext.UNLIMITED, 6178, 308)

link to reproducer

You can download the repo (branch v5.0.0) and execute

sbt compile test

Output (click arrow to expand)

[error] java.lang.VerifyError: Constructor must call super() or this() before return
[error] Exception Details:
[error]   Location:
[error]     json/value/spec/parser/DecimalConf$.<init>()V @0: return
[error]   Reason:
[error]     Error exists in the bytecode
[error]   Bytecode:
[error]     0000000: b1                                     
[error] 
[error]         at json.value.spec.parser.JsObjParser$.<clinit>(Parser.scala:130)
[error]         at json.value.JsObj$.<clinit>(JsValue.scala:789)
[error]         at json.value.gen.JsObjGen$.apply(JsObjGen.scala:26)
[error]         at tests.JsObjSpecProperties$.<clinit>(JsObjSpecProperties.scala:21)
[error]         at java.base/java.lang.Class.forName0(Native Method)
[error]         at java.base/java.lang.Class.forName(Class.java:467)
[error]         at org.scalacheck.Platform$.loadModule(Platform.scala:69)
[error]         at org.scalacheck.ScalaCheckRunner$BaseTask.<init>(ScalaCheckFramework.scala:55)
[error]         at org.scalacheck.ScalaCheckRunner$$anon$2.<init>(ScalaCheckFramework.scala:93)
[error]         at org.scalacheck.ScalaCheckRunner.rootTask(ScalaCheckFramework.scala:93)
[error]         at org.scalacheck.ScalaCheckRunner.$anonfun$tasks$2(ScalaCheckFramework.scala:44)
[error]         at scala.collection.ArrayOps$.map$extension(ArrayOps.scala:929)
[error]         at org.scalacheck.ScalaCheckRunner.tasks(ScalaCheckFramework.scala:44)
[error]         at sbt.TestRunner.tasks(TestFramework.scala:114)
[error]         at sbt.TestFramework$.$anonfun$createTestTasks$4(TestFramework.scala:275)
[error]         at sbt.TestFramework$.sbt$TestFramework$$withContextLoader(TestFramework.scala:289)
[error]         at sbt.TestFramework$.$anonfun$createTestTasks$3(TestFramework.scala:275)
[error]         at sbt.TestFramework$.$anonfun$createTestTasks$3$adapted(TestFramework.scala:272)
[error]         at scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:293)
[error]         at scala.collection.Iterator.foreach(Iterator.scala:943)
[error]         at scala.collection.Iterator.foreach$(Iterator.scala:943)
[error]         at scala.collection.AbstractIterator.foreach(Iterator.scala:1431)
[error]         at scala.collection.IterableLike.foreach(IterableLike.scala:74)
[error]         at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
[error]         at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
[error]         at scala.collection.TraversableLike.flatMap(TraversableLike.scala:293)
[error]         at scala.collection.TraversableLike.flatMap$(TraversableLike.scala:290)
[error]         at scala.collection.AbstractTraversable.flatMap(Traversable.scala:108)
[error]         at sbt.TestFramework$.createTestTasks(TestFramework.scala:272)
[error]         at sbt.TestFramework$.testTasks(TestFramework.scala:225)
[error]         at sbt.Tests$.testTask(Tests.scala:357)
[error]         at sbt.Tests$.apply(Tests.scala:324)
[error]         at sbt.Defaults$.$anonfun$allTestGroupsTask$6(Defaults.scala:1572)
[error]         at scala.collection.immutable.List.map(List.scala:293)
[error]         at sbt.Defaults$.allTestGroupsTask(Defaults.scala:1547)
[error]         at sbt.Defaults$.$anonfun$testTasks$10(Defaults.scala:1253)
[error]         at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error]         at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error]         at sbt.std.Transform$$anon$4.work(Transform.scala:68)
[error]         at sbt.Execute.$anonfun$submit$2(Execute.scala:282)
[error]         at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
[error]         at sbt.Execute.work(Execute.scala:291)
[error]         at sbt.Execute.$anonfun$submit$1(Execute.scala:282)
[error]         at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error]         at sbt.CompletionService$$anon$2.call(CompletionService.scala:64)
[error]         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error]         at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
[error]         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error]         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[error]         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[error]         at java.base/java.lang.Thread.run(Thread.java:833)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
ckipp01commented, Aug 9, 2022

To clarify a bit, you can also reproduce this without using sbt-scoverage. In your example repo just remove sbt-scoverage, add -coverage-out:foo to your scalacOptions and run test. You’ll get the same issue. Just wanted to show that this isn’t due to the integration or to scoverage, but rather the instrumentation here.

0reactions
sergewarcommented, Aug 9, 2022

Also confirm that on my project have this error with option -coverage-out:foo

Read more comments on GitHub >

github_iconTop Results From Across the Web

Constructor must call super() or this() before return in method
Why am I getting that error, and how can I get rid of it? The big clue is that this is a VerifyError...
Read more >
Why java.lang.VerifyError Occurs in Java and How to Solve this?
Now if we execute the class B (class that contains main() method) then an error message like below will be thrown at run-time....
Read more >
5.3.2 to 6.2.0. JNI error: Constructor must call super() or this ...
Error : A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.VerifyError: Constructor ...
Read more >
Java.lang.VerifyError: (class: ea/Individual, method: signature: (I)V ...
Java.lang.VerifyError: (class: ea/Individual, method: signature: (I)V) Constructor must call super() or this() ... The code is compiling but getting runtime error ...
Read more >
How to solve VerifyError - Examples Java Code Geeks - 2022
In this tutorial we will discuss about the VerifyError in Java. This error indicates that the verifier, included in the Java Virtual Machine ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found