Skip to content

Instantly share code, notes, and snippets.

@mdedetrich
Created January 20, 2023 10:28
Show Gist options
  • Save mdedetrich/668823d5dd27a6dba47846ef30e6a990 to your computer and use it in GitHub Desktop.
Save mdedetrich/668823d5dd27a6dba47846ef30e6a990 to your computer and use it in GitHub Desktop.
scalafmt stack trace
org.scalafmt.cli.FailedToFormat: /Users/mdedetrich/github/guardian-for-apache-kafka/core/src/test/scala/io/aiven/guardian/kafka/KafkaClusterTest.scala
Caused by: java.lang.NullPointerException: Cannot invoke "scala.meta.Tree.tokens(scala.meta.Dialect)" because "tree" is null
at org.scalafmt.internal.FormatTokens.getHeadOpt(FormatTokens.scala:194)
at org.scalafmt.internal.FormatTokens.tokenJustBeforeOpt(FormatTokens.scala:246)
at org.scalafmt.internal.FormatWriter$FormatLocations.getAlignContainerParent(FormatWriter.scala:1293)
at org.scalafmt.internal.FormatWriter$FormatLocations.getAlignContainer(FormatWriter.scala:1320)
at org.scalafmt.internal.FormatWriter$FormatLocations.$anonfun$getAlignContainer$1(FormatWriter.scala:1340)
at scala.Option.flatMap(Option.scala:283)
at org.scalafmt.internal.FormatWriter$FormatLocations.getAlignContainer(FormatWriter.scala:1336)
at org.scalafmt.internal.FormatWriter$FormatLocations.processLine$1(FormatWriter.scala:1165)
at org.scalafmt.internal.FormatWriter$FormatLocations.alignmentTokens(FormatWriter.scala:1193)
at org.scalafmt.internal.FormatWriter$FormatLocations.<init>(FormatWriter.scala:424)
at org.scalafmt.internal.FormatWriter.getFormatLocations(FormatWriter.scala:139)
at org.scalafmt.internal.FormatWriter.mkString(FormatWriter.scala:32)
at org.scalafmt.Scalafmt$.$anonfun$doFormatOne$7(Scalafmt.scala:157)
at scala.util.Success.flatMap(Try.scala:258)
at org.scalafmt.Scalafmt$.$anonfun$doFormatOne$4(Scalafmt.scala:156)
at scala.meta.parsers.Parsed.fold(Errors.scala:12)
at scala.meta.parsers.Parsed.fold$(Errors.scala:11)
at scala.meta.parsers.Parsed$Success.fold(Errors.scala:26)
at org.scalafmt.Scalafmt$.org$scalafmt$Scalafmt$$doFormatOne(Scalafmt.scala:152)
at org.scalafmt.Scalafmt$.doFormat(Scalafmt.scala:126)
at org.scalafmt.Scalafmt$.formatCodeWithStyle(Scalafmt.scala:91)
at org.scalafmt.Scalafmt$.$anonfun$formatCode$3(Scalafmt.scala:78)
at scala.util.Success.fold(Try.scala:281)
at org.scalafmt.Scalafmt$.formatCode(Scalafmt.scala:78)
at org.scalafmt.Scalafmt$.format(Scalafmt.scala:59)
at org.scalafmt.Scalafmt.format(Scalafmt.scala)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:578)
at org.scalafmt.dynamic.ScalafmtReflect.$anonfun$tryFormat$1(ScalafmtReflect.scala:121)
at scala.util.Try$.apply(Try.scala:210)
at org.scalafmt.dynamic.ScalafmtReflect.tryFormat(ScalafmtReflect.scala:117)
at org.scalafmt.dynamic.ScalafmtReflectConfig.tryFormat(ScalafmtReflectConfig.scala:95)
nonfun$tryForceFormat$1(ScalafmtDynamicSession.scala:49) Reformatting...
71,7%at scala.util.Success.flatMap(Try.scala:258)
at org.scalafmt.dynamic.ScalafmtDynamicSession.tryForceFormat(ScalafmtDynamicSession.scala:49)
at org.scalafmt.dynamic.ScalafmtDynamicSession.tryFormat(ScalafmtDynamicSession.scala:36)
at org.scalafmt.dynamic.ScalafmtDynamicSession.format(ScalafmtDynamicSession.scala:18)
at org.scalafmt.cli.ScalafmtDynamicRunner$.handleFile(ScalafmtDynamicRunner.scala:76)
at org.scalafmt.cli.ScalafmtDynamicRunner$.$anonfun$run$7(ScalafmtDynamicRunner.scala:49)
at org.scalafmt.cli.ScalafmtDynamicRunner$.$anonfun$run$7$adapted(ScalafmtDynamicRunner.scala:47)
at scala.collection.IterableOnceOps.foreach(IterableOnce.scala:563)
at scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:561)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1293)
ableLike.scala:938) Reformatting...
77,8%at scala.collection.parallel.Task.$anonfun$tryLeaf$1(Tasks.scala:52)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
at scala.util.control.Breaks$$anon$1.catchBreak(Breaks.scala:97)
at scala.collection.parallel.Task.tryLeaf(Tasks.scala:55)
at scala.collection.parallel.Task.tryLeaf$(Tasks.scala:49)
at scala.collection.parallel.ParIterableLike$Foreach.tryLeaf(ParIterableLike.scala:935)
at scala.collection.parallel.AdaptiveWorkStealingTasks$AWSTWrappedTask.internal(Tasks.scala:159)
at scala.collection.parallel.AdaptiveWorkStealingTasks$AWSTWrappedTask.internal$(Tasks.scala:156)
at scala.collection.parallel.AdaptiveWorkStealingForkJoinTasks$AWSFJTWrappedTask.internal(Tasks.scala:304)
at scala.collection.parallel.AdaptiveWorkStealingTasks$AWSTWrappedTask.compute(Tasks.scala:149)
s.scala:148) Reformatting...
79,8%at scala.collection.parallel.AdaptiveWorkStealingForkJoinTasks$AWSFJTWrappedTask.compute(Tasks.scala:304)
at java.base/java.util.concurrent.RecursiveAction.exec(RecursiveAction.java:194)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1311)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1840)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1806)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
org.scalafmt.cli.FailedToFormat: /Users/mdedetrich/github/guardian-for-apache-kafka/core-backup/src/test/scala/io/aiven/guardian/kafka/backup/BackupClientControlWrapper.scala
Caused by: java.lang.NullPointerException: Cannot invoke "scala.meta.Tree.tokens(scala.meta.Dialect)" because "tree" is null
at org.scalafmt.internal.FormatTokens.getHeadOpt(FormatTokens.scala:194)
at org.scalafmt.internal.FormatTokens.tokenJustBeforeOpt(FormatTokens.scala:246)
at org.scalafmt.internal.FormatWriter$FormatLocations.getAlignContainerParent(FormatWriter.scala:1293)
at org.scalafmt.internal.FormatWriter$FormatLocations.getAlignContainer(FormatWriter.scala:1320)
at org.scalafmt.internal.FormatWriter$FormatLocations.$anonfun$getAlignContainer$1(FormatWriter.scala:1340)
at scala.Option.flatMap(Option.scala:283)
at org.scalafmt.internal.FormatWriter$FormatLocations.getAlignContainer(FormatWriter.scala:1336)
at org.scalafmt.internal.FormatWriter$FormatLocations.processLine$1(FormatWriter.scala:1165)
at org.scalafmt.internal.FormatWriter$FormatLocations.alignmentTokens(FormatWriter.scala:1193)
at org.scalafmt.internal.FormatWriter$FormatLocations.<init>(FormatWriter.scala:424)
at org.scalafmt.internal.FormatWriter.getFormatLocations(FormatWriter.scala:139)
at org.scalafmt.internal.FormatWriter.mkString(FormatWriter.scala:32)
at org.scalafmt.Scalafmt$.$anonfun$doFormatOne$7(Scalafmt.scala:157)
at scala.util.Success.flatMap(Try.scala:258)
at org.scalafmt.Scalafmt$.$anonfun$doFormatOne$4(Scalafmt.scala:156)
at scala.meta.parsers.Parsed.fold(Errors.scala:12)
at scala.meta.parsers.Parsed.fold$(Errors.scala:11)
at scala.meta.parsers.Parsed$Success.fold(Errors.scala:26)
at org.scalafmt.Scalafmt$.org$scalafmt$Scalafmt$$doFormatOne(Scalafmt.scala:152)
at org.scalafmt.Scalafmt$.doFormat(Scalafmt.scala:126)
at org.scalafmt.Scalafmt$.formatCodeWithStyle(Scalafmt.scala:91)
at org.scalafmt.Scalafmt$.$anonfun$formatCode$3(Scalafmt.scala:78)
at scala.util.Success.fold(Try.scala:281)
at org.scalafmt.Scalafmt$.formatCode(Scalafmt.scala:78)
at org.scalafmt.Scalafmt$.format(Scalafmt.scala:59)
at org.scalafmt.Scalafmt.format(Scalafmt.scala)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:578)
at org.scalafmt.dynamic.ScalafmtReflect.$anonfun$tryFormat$1(ScalafmtReflect.scala:121)
at scala.util.Try$.apply(Try.scala:210)
at org.scalafmt.dynamic.ScalafmtReflect.tryFormat(ScalafmtReflect.scala:117)
at org.scalafmt.dynamic.ScalafmtReflectConfig.tryFormat(ScalafmtReflectConfig.scala:95)
at org.scalafmt.dynamic.ScalafmtDynamicSession.$anonfun$tryForceFormat$1(ScalafmtDynamicSession.scala:49)
at scala.util.Success.flatMap(Try.scala:258)
at org.scalafmt.dynamic.ScalafmtDynamicSession.tryForceFormat(ScalafmtDynamicSession.scala:49)
at org.scalafmt.dynamic.ScalafmtDynamicSession.tryFormat(ScalafmtDynamicSession.scala:36)
at org.scalafmt.dynamic.ScalafmtDynamicSession.format(ScalafmtDynamicSession.scala:18)
tDynamicRunner.scala:76) Reformatting...
81,8%at org.scalafmt.cli.ScalafmtDynamicRunner$.$anonfun$run$7(ScalafmtDynamicRunner.scala:49)
at org.scalafmt.cli.ScalafmtDynamicRunner$.$anonfun$run$7$adapted(ScalafmtDynamicRunner.scala:47)
at scala.collection.IterableOnceOps.foreach(IterableOnce.scala:563)
at scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:561)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1293)
at scala.collection.parallel.ParIterableLike$Foreach.leaf(ParIterableLike.scala:938)
at scala.collection.parallel.Task.$anonfun$tryLeaf$1(Tasks.scala:52)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
at scala.util.control.Breaks$$anon$1.catchBreak(Breaks.scala:97)
at scala.collection.parallel.Task.tryLeaf(Tasks.scala:55)
at scala.collection.parallel.Task.tryLeaf$(Tasks.scala:49)
at scala.collection.parallel.ParIterableLike$Foreach.tryLeaf(ParIterableLike.scala:935)
at scala.collection.parallel.AdaptiveWorkStealingTasks$AWSTWrappedTask.internal(Tasks.scala:169)
at scala.collection.parallel.AdaptiveWorkStealingTasks$AWSTWrappedTask.internal$(Tasks.scala:156)
at scala.collection.parallel.AdaptiveWorkStealingForkJoinTasks$AWSFJTWrappedTask.internal(Tasks.scala:304)
at scala.collection.parallel.AdaptiveWorkStealingTasks$AWSTWrappedTask.compute(Tasks.scala:149)
at scala.collection.parallel.AdaptiveWorkStealingTasks$AWSTWrappedTask.compute$(Tasks.scala:148)
at scala.collection.parallel.AdaptiveWorkStealingForkJoinTasks$AWSFJTWrappedTask.compute(Tasks.scala:304)
at java.base/java.util.concurrent.RecursiveAction.exec(RecursiveAction.java:194)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1311)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1840)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1806)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment