wartremover / wartremover

Flexible Scala code linting tool
https://www.wartremover.org/
Apache License 2.0
1.08k stars 113 forks source link

UnsupportedOperationException: tail of empty list #127

Closed OlegYch closed 10 years ago

OlegYch commented 10 years ago

using 0.11 on 2.10.4 with sbt 0.13.5 i'm randomly getting

java.lang.UnsupportedOperationException: tail of empty list
    at scala.collection.immutable.Nil$.tail(List.scala:339)
    at scala.collection.immutable.Nil$.tail(List.scala:334)
    at scala.reflect.internal.SymbolTable.popPhase(SymbolTable.scala:172)
    at scala.reflect.internal.pickling.UnPickler$Scan$LazyTypeRef.complete(UnPickler.scala:856)
    at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1231)
    at scala.reflect.internal.Symbols$Symbol.initialize(Symbols.scala:1374)
    at scala.reflect.internal.Symbols$Symbol.hasFlag(Symbols.scala:607)
    at scala.reflect.internal.Symbols$Symbol.isStatic(Symbols.scala:804)
    at scala.reflect.runtime.JavaMirrors$JavaMirror.reflectModule(JavaMirrors.scala:198)
    at scala.reflect.runtime.JavaMirrors$JavaMirror.reflectModule(JavaMirrors.scala:65)
    at org.brianmckenna.wartremover.Plugin.getTraverser(Plugin.scala:21)
    at org.brianmckenna.wartremover.Plugin$$anonfun$ts$1$1.apply(Plugin.scala:41)
    at org.brianmckenna.wartremover.Plugin$$anonfun$ts$1$1.apply(Plugin.scala:41)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
    at scala.collection.immutable.List.foreach(List.scala:318)
    at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
    at scala.collection.AbstractTraversable.map(Traversable.scala:105)
    at org.brianmckenna.wartremover.Plugin.ts$1(Plugin.scala:41)
    at org.brianmckenna.wartremover.Plugin.processOptions(Plugin.scala:46)
    at scala.tools.nsc.plugins.Plugins$class.loadPlugins(Plugins.scala:85)
    at scala.tools.nsc.Global.loadPlugins(Global.scala:37)
    at scala.tools.nsc.plugins.Plugins$class.plugins(Plugins.scala:98)
    at scala.tools.nsc.Global.plugins$lzycompute(Global.scala:37)
    at scala.tools.nsc.Global.plugins(Global.scala:37)
    at scala.tools.nsc.plugins.Plugins$class.computePluginPhases(Plugins.scala:109)
    at scala.tools.nsc.Global.computePluginPhases(Global.scala:37)
    at scala.tools.nsc.Global.computePhaseDescriptors(Global.scala:773)
    at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at xsbt.CachedCompiler0$Compiler.superCall(CompilerInterface.scala:237)
    at xsbt.CachedCompiler0$Compiler.superComputePhaseDescriptors(CompilerInterface.scala:230)
    at xsbt.CachedCompiler0$Compiler.phaseDescriptors$lzycompute(CompilerInterface.scala:227)
    at xsbt.CachedCompiler0$Compiler.phaseDescriptors(CompilerInterface.scala:222)
    at scala.tools.nsc.Global$Run.<init>(Global.scala:1301)
    at xsbt.CachedCompiler0$$anon$2.<init>(CompilerInterface.scala:113)
    at xsbt.CachedCompiler0.run(CompilerInterface.scala:113)
    at xsbt.CachedCompiler0.run(CompilerInterface.scala:99)
    at xsbt.CompilerInterface.run(CompilerInterface.scala:27)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:102)
    at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:48)
    at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:41)
    at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileScala$1$1.apply$mcV$sp(AggressiveCompile.scala:99)
    at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileScala$1$1.apply(AggressiveCompile.scala:99)
    at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileScala$1$1.apply(AggressiveCompile.scala:99)
    at sbt.compiler.AggressiveCompile.sbt$compiler$AggressiveCompile$$timed(AggressiveCompile.scala:166)
    at sbt.compiler.AggressiveCompile$$anonfun$3.compileScala$1(AggressiveCompile.scala:98)
    at sbt.compiler.AggressiveCompile$$anonfun$3.apply(AggressiveCompile.scala:143)
    at sbt.compiler.AggressiveCompile$$anonfun$3.apply(AggressiveCompile.scala:87)
    at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:39)
    at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:37)
    at sbt.inc.IncrementalCommon.cycle(Incremental.scala:99)
    at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:38)
    at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:37)
    at sbt.inc.Incremental$.manageClassfiles(Incremental.scala:65)
    at sbt.inc.Incremental$.compile(Incremental.scala:37)
    at sbt.inc.IncrementalCompile$.apply(Compile.scala:27)
    at sbt.compiler.AggressiveCompile.compile2(AggressiveCompile.scala:157)
    at sbt.compiler.AggressiveCompile.compile1(AggressiveCompile.scala:71)
    at sbt.compiler.AggressiveCompile.apply(AggressiveCompile.scala:46)
    at sbt.Compiler$.apply(Compiler.scala:75)
    at sbt.Compiler$.apply(Compiler.scala:66)
    at sbt.Defaults$.sbt$Defaults$$compileTaskImpl(Defaults.scala:770)
    at sbt.Defaults$$anonfun$compileTask$1.apply(Defaults.scala:762)
    at sbt.Defaults$$anonfun$compileTask$1.apply(Defaults.scala:762)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:42)
    at sbt.std.Transform$$anon$4.work(System.scala:64)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
    at sbt.Execute.work(Execute.scala:244)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
    at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

i guess that's caused by http://docs.scala-lang.org/overviews/reflection/thread-safety.html

LeifW commented 10 years ago

Is this related to #74?

OlegYch commented 10 years ago

doh yes, sorry about the duplicate