Scala Intellij“计算表达式”导致NoSuchMethodException

Scala Intellij“计算表达式”导致NoSuchMethodException,scala,debugging,intellij-idea,evaluate,Scala,Debugging,Intellij Idea,Evaluate,我试图在调试应用程序时检查IntelliJ中对象的中等规模映射的内容。我在评估对话框中输入以下内容:prices.get.keys.toList.filterk=>k.startsWithGC,其中prices是Future[Map[String,SomeObject]]。我曾直接尝试过Iterable,但没有toList集合,结果也一样 我得到以下例外情况: 调用生成的代码时出错: com.intellij.debugger.engine.evaluation.EvaluateExceptio

我试图在调试应用程序时检查IntelliJ中对象的中等规模映射的内容。我在评估对话框中输入以下内容:prices.get.keys.toList.filterk=>k.startsWithGC,其中prices是Future[Map[String,SomeObject]]。我曾直接尝试过Iterable,但没有toList集合,结果也一样

我得到以下例外情况: 调用生成的代码时出错: com.intellij.debugger.engine.evaluation.EvaluateException:方法引发了“java.lang.NoSuchMethodError”异常。堆栈跟踪的顶部就是断点所在的行

还有人碰到这个吗?如果是,是否有解决办法

堆栈跟踪如下所示:

c.p.p.e.u.ClassUnderTest$$anonfun$4$GeneratedEvaluatorClass$10$1.invoke(FileToCompile1993.scala:85)
c.p.p.e.u.ClassUnderTest$$anonfun$4.apply(ClassUnderTest.scala:81)
c.p.p.e.u.ClassUnderTest$$anonfun$4.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$1.apply$mcV$sp(ClassTest.scala:35)
c.p.p.e.u.ClassTest$$anonfun$1.apply(ClassTest.scala:22)
c.p.p.e.u.ClassTest$$anonfun$1.apply(ClassTest.scala:22)
org.scalatest.Transformer$$anonfun$apply$1.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$1.apply(FlatSpecLike.scala:1647)
org.scalatest.Suite$class.withFixture(Suite.scala:1122)
org.scalatest.FlatSpec.withFixture(FlatSpec.scala:1683)
org.scalatest.FlatSpecLike$class.invokeWithFixture$1(FlatSpecLike.scala:1644)
org.scalatest.FlatSpecLike$$anonfun$runTest$1.apply(FlatSpecLike.scala:1656)
org.scalatest.FlatSpecLike$$anonfun$runTest$1.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$1.apply(FlatSpecLike.scala:1714)
org.scalatest.FlatSpecLike$$anonfun$runTests$1.apply(FlatSpecLike.scala:1714)
org.scalatest.SuperEngine$$anonfun$traverseSubNodes$1$1.apply(Engine.scala:413)
org.scalatest.SuperEngine$$anonfun$traverseSubNodes$1$1.apply(Engine.scala:401)
scala.collection.immutable.List.foreach(List.scala:381)
org.scalatest.SuperEngine.traverseSubNodes$1(Engine.scala:401)
org.scalatest.SuperEngine.org$scalatest$SuperEngine$$runTestsInBranch(Engine.scala:390)
org.scalatest.SuperEngine$$anonfun$traverseSubNodes$1$1.apply(Engine.scala:427)
org.scalatest.SuperEngine$$anonfun$traverseSubNodes$1$1.apply(Engine.scala:401)
scala.collection.immutable.List.foreach(List.scala:381)
org.scalatest.SuperEngine.traverseSubNodes$1(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$1.apply(FlatSpecLike.scala:1760)
org.scalatest.FlatSpecLike$$anonfun$run$1.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$3.apply(Runner.scala:2563)
org.scalatest.tools.Runner$$anonfun$doRunRunRunDaDoRunRun$3.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$2.apply(Runner.scala:1044)
org.scalatest.tools.Runner$$anonfun$runOptionallyWithPassFailReporter$2.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终极版
Build IU-182.3684.101,于2018年7月24日构建

Scala调试器在使用lambdas、匿名类、类声明计算复杂表达式时遇到一些问题,等等。其中一个看起来是问题的原因,因为调试器在lambda c.p.p.e.u.ClassUnderTest$$anonfun$4.applyClassUnderTest.scala:81中停止,并且表达式包含lambda函数


原因是IDEA在计算之前编译表达式,并且它并不总是正确地捕获上下文。作为一种解决方法,您可以尝试从其他调试器停止(例如,一个常用方法的主体)计算表达式。

我发现这是一个比较常见的问题。通常帮助我的是,在设置断点时要注意,并选择将其用于特定调用而不是全部调用的选项。通常,这会使此类错误消失,代价是失去对外部作用域中变量的访问,因为它们不在同一线程中。。。但根据我的总体经验,评估基于未来的代码会有点糟糕耶^ ^”