Intellij "Evaluate Expression" 导致 NoSuchMethodException
Intellij "Evaluate Expression" results in NoSuchMethodException
我正在尝试在调试应用程序时检查 IntelliJ 中一个中等大小的 Scala 对象映射的内容。我在 "Evaluate" 对话框中输入以下内容:prices.get.keys.toList.filter(k => k.startsWith("GC"))
,其中 prices
是 Future[Map[String, SomeObject]]
。我在没有 toList
集合的情况下直接在 Iterable 上进行了尝试,结果相同。
我得到以下异常:
生成的代码调用期间出错:
com.intellij.debugger.engine.evaluation.EvaluateException: Method threw 'java.lang.NoSuchMethodError' exception.
堆栈跟踪的顶部就是我设置断点的行。
还有其他人 运行 参与其中吗?如果是这样,是否有解决方法?
堆栈跟踪如下:
c.p.p.e.u.ClassUnderTest$$anonfun$GeneratedEvaluatorClass.invoke(FileToCompile1993.scala:85)
c.p.p.e.u.ClassUnderTest$$anonfun.apply(ClassUnderTest.scala:81)
c.p.p.e.u.ClassUnderTest$$anonfun.apply(ClassUnderTest.scala:76)
scala.collection.immutable.HashSet$HashSet1.filter0(HashSet.scala:313)
scala.collection.immutable.HashSet$HashTrieSet.filter0(HashSet.scala:929)
scala.collection.immutable.HashSet$HashTrieSet.filter0(HashSet.scala:929)
scala.collection.immutable.HashSet.filter(HashSet.scala:167)
scala.collection.immutable.HashSet.filter(HashSet.scala:35)
c.p.p.e.u.ClassTest.get(ClassTest.scala:76)
c.p.p.e.u.ClassTest.$$anonfun.apply$mcV$sp(ClassTest.scala:35)
c.p.p.e.u.ClassTest$$anonfun.apply(ClassTest.scala:22)
c.p.p.e.u.ClassTest$$anonfun.apply(ClassTest.scala:22)
org.scalatest.Transformer$$anonfun$apply.apply$mcV$sp(Transformer.scala:22)
org.scalatest.OutcomeOf$class.outcomeOf(OutcomeOf.scala:85)
org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)
org.scalatest.Transformer.apply(Transformer.scala:22)
org.scalatest.Transformer.apply(Transformer.scala:20)
org.scalatest.FlatSpecLike$$anon.apply(FlatSpecLike.scala:1647)
org.scalatest.Suite$class.withFixture(Suite.scala:1122)
org.scalatest.FlatSpec.withFixture(FlatSpec.scala:1683)
org.scalatest.FlatSpecLike$class.invokeWithFixture(FlatSpecLike.scala:1644)
org.scalatest.FlatSpecLike$$anonfun$runTest.apply(FlatSpecLike.scala:1656)
org.scalatest.FlatSpecLike$$anonfun$runTest.apply(FlatSpecLike.scala:1656)
org.scalatest.SuperEngine.runTestImpl(Engine.scala:306)
org.scalatest.FlatSpecLike$class.runTest(FlatSpecLike.scala:1656)
org.scalatest.FlatSpec.runTest(FlatSpec.scala:1683)
org.scalatest.FlatSpecLike$$anonfun$runTests.apply(FlatSpecLike.scala:1714)
org.scalatest.FlatSpecLike$$anonfun$runTests.apply(FlatSpecLike.scala:1714)
org.scalatest.SuperEngine$$anonfun$traverseSubNodes.apply(Engine.scala:413)
org.scalatest.SuperEngine$$anonfun$traverseSubNodes.apply(Engine.scala:401)
scala.collection.immutable.List.foreach(List.scala:381)
org.scalatest.SuperEngine.traverseSubNodes(Engine.scala:401)
org.scalatest.SuperEngine.org$scalatest$SuperEngine$$runTestsInBranch(Engine.scala:390)
org.scalatest.SuperEngine$$anonfun$traverseSubNodes.apply(Engine.scala:427)
org.scalatest.SuperEngine$$anonfun$traverseSubNodes.apply(Engine.scala:401)
scala.collection.immutable.List.foreach(List.scala:381)
org.scalatest.SuperEngine.traverseSubNodes(Engine.scala:401)
org.scalatest.SuperEngine.org$scalatest$SuperEngine$$runTestsInBranch(Engine.scala:396)
org.scalatest.SuperEngine.runTestsImpl(Engine.scala:483)
org.scalatest.FlatSpecLike$class.runTests(FlatSpecLike.scala:1714)
org.scalatest.FlatSpec.runTests(FlatSpec.scala:1683)
org.scalatest.Suite$class.run(Suite.scala:1424)
org.scalatest.FlatSpec.org$scalatest$FlatSpecLike$$super$run(FlatSpec.scala:1683)
org.scalatest.FlatSpecLike$$anonfun$run.apply(FlatSpecLike.scala:1760)
org.scalatest.FlatSpecLike$$anonfun$run.apply(FlatSpecLike.scala:1760)
org.scalatest.SuperEngine.runImpl(Engine.scala:545)
org.scalatest.FlatSpecLike$class.run(FlatSpecLike.scala:1760)
org.scalatest.FlatSpec.run(FlatSpec.scala:1683)
org.scalatest.tools.SuiteRunner.run(SuiteRunner.scala:55)
org.scalatest.tools.Runner$$anonfun$doRunRunRunDaDoRunRun.apply(Runner.scala:2563)
org.scalatest.tools.Runner$$anonfun$doRunRunRunDaDoRunRun.apply(Runner.scala:2557)
scala.collection.immutable.List.foreach(List.scala:381)
org.scalatest.tools.Runner$.doRunRunRunDaDoRunRun(Runner.scala:2557)
org.scalatest.tools.Runner$$anonfun$runOptionallyWithPassFailReporter.apply(Runner.scala:1044)
org.scalatest.tools.Runner$$anonfun$runOptionallyWithPassFailReporter.apply(Runner.scala:1043)
org.scalatest.tools.Runner$.withClassLoaderAndDispatchReporter(Runner.scala:2722)
org.scalatest.tools.Runner$.runOptionallyWithPassFailReporter(Runner.scala:1043)
org.scalatest.tools.Runner$.run(Runner.scala:883)
org.scalatest.tools.Runner.run(Runner.scala)
org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner.runScalaTest2(ScalaTestRunner.java:131)
org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner.main(ScalaTestRunner.java:28)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:67)
我已将 Scala 插件更新到最新版本 2018.2.9,并且正在使用最新版本的 IntelliJ IDEA(来自“关于”对话框):
IntelliJ IDEA 2018.2(终极版)
构建 #IU-182.3684.101,构建于 2018 年 7 月 24 日
Scala 调试器在计算复杂表达式(使用 lambda、匿名 类、类 声明等)时存在一些问题。其中之一 https://youtrack.jetbrains.com/issue/SCL-14194 看起来是您问题的原因,因为调试器在 lambda c.p.p.e.u.ClassUnderTest$$<b>anonfun</b>$4.apply 中停止(ClassUnderTest.scala:81)
并且表达式包含 lambda 函数。
原因是 IDEA 在计算之前编译表达式,它并不总是正确地捕获上下文。作为解决方法,您可以尝试从其他调试器停止处评估表达式,例如,常用方法的主体。
我正在尝试在调试应用程序时检查 IntelliJ 中一个中等大小的 Scala 对象映射的内容。我在 "Evaluate" 对话框中输入以下内容:prices.get.keys.toList.filter(k => k.startsWith("GC"))
,其中 prices
是 Future[Map[String, SomeObject]]
。我在没有 toList
集合的情况下直接在 Iterable 上进行了尝试,结果相同。
我得到以下异常:
生成的代码调用期间出错:
com.intellij.debugger.engine.evaluation.EvaluateException: Method threw 'java.lang.NoSuchMethodError' exception.
堆栈跟踪的顶部就是我设置断点的行。
还有其他人 运行 参与其中吗?如果是这样,是否有解决方法?
堆栈跟踪如下:
c.p.p.e.u.ClassUnderTest$$anonfun$GeneratedEvaluatorClass.invoke(FileToCompile1993.scala:85)
c.p.p.e.u.ClassUnderTest$$anonfun.apply(ClassUnderTest.scala:81)
c.p.p.e.u.ClassUnderTest$$anonfun.apply(ClassUnderTest.scala:76)
scala.collection.immutable.HashSet$HashSet1.filter0(HashSet.scala:313)
scala.collection.immutable.HashSet$HashTrieSet.filter0(HashSet.scala:929)
scala.collection.immutable.HashSet$HashTrieSet.filter0(HashSet.scala:929)
scala.collection.immutable.HashSet.filter(HashSet.scala:167)
scala.collection.immutable.HashSet.filter(HashSet.scala:35)
c.p.p.e.u.ClassTest.get(ClassTest.scala:76)
c.p.p.e.u.ClassTest.$$anonfun.apply$mcV$sp(ClassTest.scala:35)
c.p.p.e.u.ClassTest$$anonfun.apply(ClassTest.scala:22)
c.p.p.e.u.ClassTest$$anonfun.apply(ClassTest.scala:22)
org.scalatest.Transformer$$anonfun$apply.apply$mcV$sp(Transformer.scala:22)
org.scalatest.OutcomeOf$class.outcomeOf(OutcomeOf.scala:85)
org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)
org.scalatest.Transformer.apply(Transformer.scala:22)
org.scalatest.Transformer.apply(Transformer.scala:20)
org.scalatest.FlatSpecLike$$anon.apply(FlatSpecLike.scala:1647)
org.scalatest.Suite$class.withFixture(Suite.scala:1122)
org.scalatest.FlatSpec.withFixture(FlatSpec.scala:1683)
org.scalatest.FlatSpecLike$class.invokeWithFixture(FlatSpecLike.scala:1644)
org.scalatest.FlatSpecLike$$anonfun$runTest.apply(FlatSpecLike.scala:1656)
org.scalatest.FlatSpecLike$$anonfun$runTest.apply(FlatSpecLike.scala:1656)
org.scalatest.SuperEngine.runTestImpl(Engine.scala:306)
org.scalatest.FlatSpecLike$class.runTest(FlatSpecLike.scala:1656)
org.scalatest.FlatSpec.runTest(FlatSpec.scala:1683)
org.scalatest.FlatSpecLike$$anonfun$runTests.apply(FlatSpecLike.scala:1714)
org.scalatest.FlatSpecLike$$anonfun$runTests.apply(FlatSpecLike.scala:1714)
org.scalatest.SuperEngine$$anonfun$traverseSubNodes.apply(Engine.scala:413)
org.scalatest.SuperEngine$$anonfun$traverseSubNodes.apply(Engine.scala:401)
scala.collection.immutable.List.foreach(List.scala:381)
org.scalatest.SuperEngine.traverseSubNodes(Engine.scala:401)
org.scalatest.SuperEngine.org$scalatest$SuperEngine$$runTestsInBranch(Engine.scala:390)
org.scalatest.SuperEngine$$anonfun$traverseSubNodes.apply(Engine.scala:427)
org.scalatest.SuperEngine$$anonfun$traverseSubNodes.apply(Engine.scala:401)
scala.collection.immutable.List.foreach(List.scala:381)
org.scalatest.SuperEngine.traverseSubNodes(Engine.scala:401)
org.scalatest.SuperEngine.org$scalatest$SuperEngine$$runTestsInBranch(Engine.scala:396)
org.scalatest.SuperEngine.runTestsImpl(Engine.scala:483)
org.scalatest.FlatSpecLike$class.runTests(FlatSpecLike.scala:1714)
org.scalatest.FlatSpec.runTests(FlatSpec.scala:1683)
org.scalatest.Suite$class.run(Suite.scala:1424)
org.scalatest.FlatSpec.org$scalatest$FlatSpecLike$$super$run(FlatSpec.scala:1683)
org.scalatest.FlatSpecLike$$anonfun$run.apply(FlatSpecLike.scala:1760)
org.scalatest.FlatSpecLike$$anonfun$run.apply(FlatSpecLike.scala:1760)
org.scalatest.SuperEngine.runImpl(Engine.scala:545)
org.scalatest.FlatSpecLike$class.run(FlatSpecLike.scala:1760)
org.scalatest.FlatSpec.run(FlatSpec.scala:1683)
org.scalatest.tools.SuiteRunner.run(SuiteRunner.scala:55)
org.scalatest.tools.Runner$$anonfun$doRunRunRunDaDoRunRun.apply(Runner.scala:2563)
org.scalatest.tools.Runner$$anonfun$doRunRunRunDaDoRunRun.apply(Runner.scala:2557)
scala.collection.immutable.List.foreach(List.scala:381)
org.scalatest.tools.Runner$.doRunRunRunDaDoRunRun(Runner.scala:2557)
org.scalatest.tools.Runner$$anonfun$runOptionallyWithPassFailReporter.apply(Runner.scala:1044)
org.scalatest.tools.Runner$$anonfun$runOptionallyWithPassFailReporter.apply(Runner.scala:1043)
org.scalatest.tools.Runner$.withClassLoaderAndDispatchReporter(Runner.scala:2722)
org.scalatest.tools.Runner$.runOptionallyWithPassFailReporter(Runner.scala:1043)
org.scalatest.tools.Runner$.run(Runner.scala:883)
org.scalatest.tools.Runner.run(Runner.scala)
org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner.runScalaTest2(ScalaTestRunner.java:131)
org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner.main(ScalaTestRunner.java:28)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:67)
我已将 Scala 插件更新到最新版本 2018.2.9,并且正在使用最新版本的 IntelliJ IDEA(来自“关于”对话框):
IntelliJ IDEA 2018.2(终极版) 构建 #IU-182.3684.101,构建于 2018 年 7 月 24 日
Scala 调试器在计算复杂表达式(使用 lambda、匿名 类、类 声明等)时存在一些问题。其中之一 https://youtrack.jetbrains.com/issue/SCL-14194 看起来是您问题的原因,因为调试器在 lambda c.p.p.e.u.ClassUnderTest$$<b>anonfun</b>$4.apply 中停止(ClassUnderTest.scala:81)
并且表达式包含 lambda 函数。
原因是 IDEA 在计算之前编译表达式,它并不总是正确地捕获上下文。作为解决方法,您可以尝试从其他调试器停止处评估表达式,例如,常用方法的主体。