scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
232 stars 21 forks source link

symtab.AnnotationInfos$$LiteralAnnotArg cannot be cast to symtab.Constants$$Constant #2868

Closed scabug closed 13 years ago

scabug commented 14 years ago

This happens during compilation with the current nightly (scala-compiler-2.8.0-20100107.032215-297):

Exception in thread "main" java.lang.ClassCastException: scala.tools.nsc.symtab.AnnotationInfos$$LiteralAnnotArg cannot be cast to scala.tools.nsc.symtab.Constants$$Constant
    at scala.tools.nsc.symtab.classfile.UnPickler$$UnPickle.readConstantRef(UnPickler.scala:727)
    at scala.tools.nsc.symtab.classfile.UnPickler$$UnPickle.scala$$tools$$nsc$$symtab$$classfile$$UnPickler$$UnPickle$$$$readType(UnPickler.scala:285)
    at scala.tools.nsc.symtab.classfile.UnPickler$$UnPickle$$$$anonfun$$scala$$tools$$nsc$$symtab$$classfile$$UnPickler$$UnPickle$$$$readTypeRef$$1.apply(UnPickler.scala:726)
    at scala.tools.nsc.symtab.classfile.UnPickler$$UnPickle$$$$anonfun$$scala$$tools$$nsc$$symtab$$classfile$$UnPickler$$UnPickle$$$$readTypeRef$$1.apply(UnPickler.scala:726)
    at scala.tools.nsc.symtab.classfile.UnPickler$$UnPickle.scala$$tools$$nsc$$symtab$$classfile$$UnPickler$$UnPickle$$$$at(UnPickler.scala:152)
    at scala.tools.nsc.symtab.classfile.UnPickler$$UnPickle.scala$$tools$$nsc$$symtab$$classfile$$UnPickler$$UnPickle$$$$readTypeRef(UnPickler.scala:726)
    at scala.tools.nsc.symtab.classfile.UnPickler$$UnPickle.scala$$tools$$nsc$$symtab$$classfile$$UnPickler$$UnPickle$$$$readType(UnPickler.scala:319)
    at scala.tools.nsc.symtab.classfile.UnPickler$$UnPickle$$LazyTypeRef$$$$anonfun$$33.apply(UnPickler.scala:781)
    at scala.tools.nsc.symtab.classfile.UnPickler$$UnPickle$$LazyTypeRef$$$$anonfun$$33.apply(UnPickler.scala:781)
    at scala.tools.nsc.symtab.classfile.UnPickler$$UnPickle.scala$$tools$$nsc$$symtab$$classfile$$UnPickler$$UnPickle$$$$at(UnPickler.scala:152)
    at scala.tools.nsc.symtab.classfile.UnPickler$$UnPickle$$LazyTypeRef.complete(UnPickler.scala:781)
    at scala.tools.nsc.symtab.Symbols$$Symbol.info(Symbols.scala:758)
    at scala.tools.nsc.symtab.Symbols$$Symbol.tpe(Symbols.scala:738)
    at scala.tools.nsc.symtab.Symbols$$Symbol.tpeHK(Symbols.scala:915)
    at scala.tools.nsc.symtab.Types$$Type.memberType(Types.scala:513)
    at scala.tools.nsc.typechecker.Infer$$Inferencer.checkAccessible(Infer.scala:375)
    at scala.tools.nsc.typechecker.Typers$$Typer.makeAccessible(Typers.scala:606)
    at scala.tools.nsc.typechecker.Typers$$Typer.typedSelect$$1(Typers.scala:3519)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:3992)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:4077)
    at scala.tools.nsc.typechecker.Typers$$Typer.typedArg(Typers.scala:2171)
    at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$typedArgs$$2.apply(Typers.scala:2181)
    at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$typedArgs$$2.apply(Typers.scala:2180)
    at scala.collection.TraversableLike$$$$anonfun$$map$$1.apply(TraversableLike.scala:238)
    at scala.collection.TraversableLike$$$$anonfun$$map$$1.apply(TraversableLike.scala:238)
    at scala.collection.LinearSeqLike$$class.foreach(LinearSeqLike.scala:97)
    at scala.collection.immutable.List.foreach(List.scala:46)
    at scala.collection.TraversableLike$$class.map(TraversableLike.scala:238)
    at scala.collection.immutable.List.map(List.scala:46)
    at scala.tools.nsc.typechecker.Typers$$Typer.typedArgs(Typers.scala:2180)
    at scala.tools.nsc.typechecker.Typers$$Typer.doTypedApply(Typers.scala:2377)
    at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$tryTypedApply$$1$$1.apply(Typers.scala:3257)
    at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$tryTypedApply$$1$$1.apply(Typers.scala:3257)
    at scala.tools.nsc.typechecker.Typers$$Typer.silent(Typers.scala:715)
    at scala.tools.nsc.typechecker.Typers$$Typer.tryTypedApply$$1(Typers.scala:3257)
    at scala.tools.nsc.typechecker.Typers$$Typer.typedApply$$1(Typers.scala:3312)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:3931)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:4077)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:4122)
    at scala.tools.nsc.typechecker.Typers$$Typer.typedStat$$1(Typers.scala:2097)
    at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$20.apply(Typers.scala:2165)
    at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$20.apply(Typers.scala:2165)
    at scala.collection.immutable.List.loop$$1(List.scala:116)
    at scala.collection.immutable.List.mapConserve(List.scala:133)
    at scala.collection.immutable.List.loop$$1(List.scala:120)
    at scala.collection.immutable.List.mapConserve(List.scala:133)
    at scala.collection.immutable.List.loop$$1(List.scala:120)
    at scala.collection.immutable.List.mapConserve(List.scala:133)
    at scala.collection.immutable.List.loop$$1(List.scala:120)
    at scala.collection.immutable.List.mapConserve(List.scala:133)
    at scala.tools.nsc.typechecker.Typers$$Typer.typedStats(Typers.scala:2165)
    at scala.tools.nsc.typechecker.Typers$$Typer.typedBlock(Typers.scala:1922)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:3776)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:4077)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:4135)
    at scala.tools.nsc.typechecker.Typers$$Typer.computeType(Typers.scala:4215)
    at scala.tools.nsc.typechecker.Namers$$Namer.methodSig(Namers.scala:918)
    at scala.tools.nsc.typechecker.Namers$$Namer.typeSig(Namers.scala:1143)
    at scala.tools.nsc.typechecker.Namers$$Namer$$$$anonfun$$typeCompleter$$1.apply(Namers.scala:515)
    at scala.tools.nsc.typechecker.Namers$$Namer$$$$anonfun$$typeCompleter$$1.apply(Namers.scala:513)
    at scala.tools.nsc.typechecker.Namers$$$$anon$$1.complete(Namers.scala:1301)
    at scala.tools.nsc.symtab.Symbols$$Symbol.info(Symbols.scala:758)
    at scala.tools.nsc.symtab.Symbols$$Symbol.tpe(Symbols.scala:738)
    at scala.tools.nsc.symtab.Symbols$$Symbol.tpeHK(Symbols.scala:915)
    at scala.tools.nsc.symtab.Types$$Type.memberType(Types.scala:513)
    at scala.tools.nsc.symtab.Symbols$$Symbol$$$$anonfun$$matchingSymbol$$1.apply(Symbols.scala:1340)
    at scala.tools.nsc.symtab.Symbols$$Symbol$$$$anonfun$$matchingSymbol$$1.apply(Symbols.scala:1339)
    at scala.tools.nsc.symtab.Symbols$$Symbol.filter(Symbols.scala:1052)
    at scala.tools.nsc.symtab.Symbols$$Symbol.overriddenSymbol(Symbols.scala:1352)
    at scala.tools.nsc.symtab.Symbols$$Symbol$$$$anonfun$$allOverriddenSymbols$$1.apply(Symbols.scala:1362)
    at scala.tools.nsc.symtab.Symbols$$Symbol$$$$anonfun$$allOverriddenSymbols$$1.apply(Symbols.scala:1362)
    at scala.collection.TraversableLike$$$$anonfun$$map$$1.apply(TraversableLike.scala:238)
    at scala.collection.TraversableLike$$$$anonfun$$map$$1.apply(TraversableLike.scala:238)
    at scala.collection.LinearSeqLike$$class.foreach(LinearSeqLike.scala:97)
    at scala.collection.immutable.List.foreach(List.scala:46)
    at scala.collection.TraversableLike$$class.map(TraversableLike.scala:238)
    at scala.collection.immutable.List.map(List.scala:46)
    at scala.tools.nsc.symtab.Symbols$$Symbol.allOverriddenSymbols(Symbols.scala:1362)
    at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$typedBlock$$2.apply(Typers.scala:1907)
    at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$typedBlock$$2.apply(Typers.scala:1905)
    at scala.collection.TraversableLike$$WithFilter$$$$anonfun$$foreach$$1.apply(TraversableLike.scala:1218)
    at scala.collection.LinearSeqLike$$class.foreach(LinearSeqLike.scala:97)
    at scala.collection.immutable.List.foreach(List.scala:46)
    at scala.collection.TraversableLike$$WithFilter.foreach(TraversableLike.scala:1217)
    at scala.tools.nsc.typechecker.Typers$$Typer.typedBlock(Typers.scala:1905)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:3776)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:4077)
    at scala.tools.nsc.typechecker.Typers$$Typer.typedBlock(Typers.scala:1923)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:3776)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:4077)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:4135)
    at scala.tools.nsc.typechecker.Typers$$Typer.computeType(Typers.scala:4215)
    at scala.tools.nsc.typechecker.Namers$$Namer.methodSig(Namers.scala:918)
    at scala.tools.nsc.typechecker.Namers$$Namer.typeSig(Namers.scala:1143)
    at scala.tools.nsc.typechecker.Namers$$Namer$$$$anonfun$$typeCompleter$$1.apply(Namers.scala:515)
    at scala.tools.nsc.typechecker.Namers$$Namer$$$$anonfun$$typeCompleter$$1.apply(Namers.scala:513)
    at scala.tools.nsc.typechecker.Namers$$$$anon$$1.complete(Namers.scala:1301)
    at scala.tools.nsc.symtab.Symbols$$Symbol.info(Symbols.scala:758)
    at scala.tools.nsc.symtab.Symbols$$Symbol.tpe(Symbols.scala:738)
    at scala.tools.nsc.symtab.Symbols$$Symbol.tpeHK(Symbols.scala:915)
    at scala.tools.nsc.symtab.Types$$Type.memberType(Types.scala:513)
    at scala.tools.nsc.typechecker.Infer$$Inferencer.checkAccessible(Infer.scala:375)
    at scala.tools.nsc.typechecker.Typers$$Typer.makeAccessible(Typers.scala:606)
    at scala.tools.nsc.typechecker.Typers$$Typer.typedIdent$$1(Typers.scala:3662)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:4003)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:4077)
    at scala.tools.nsc.typechecker.Typers$$Typer.typedArg(Typers.scala:2171)
    at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$24.apply(Typers.scala:2264)
    at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$24.apply(Typers.scala:2256)
    at scala.collection.TraversableLike$$$$anonfun$$map$$1.apply(TraversableLike.scala:238)
    at scala.collection.TraversableLike$$$$anonfun$$map$$1.apply(TraversableLike.scala:238)
    at scala.collection.LinearSeqLike$$class.foreach(LinearSeqLike.scala:97)
    at scala.collection.immutable.List.foreach(List.scala:46)
    at scala.collection.TraversableLike$$class.map(TraversableLike.scala:238)
    at scala.collection.immutable.List.map(List.scala:46)
    at scala.tools.nsc.typechecker.Typers$$Typer.doTypedApply(Typers.scala:2256)
    at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$tryTypedApply$$1$$1.apply(Typers.scala:3257)
    at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$tryTypedApply$$1$$1.apply(Typers.scala:3257)
    at scala.tools.nsc.typechecker.Typers$$Typer.silent(Typers.scala:721)
    at scala.tools.nsc.typechecker.Typers$$Typer.tryTypedApply$$1(Typers.scala:3257)
    at scala.tools.nsc.typechecker.Typers$$Typer.typedApply$$1(Typers.scala:3312)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:3931)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:4077)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:3863)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:4077)
    at scala.tools.nsc.typechecker.Typers$$Typer.typedArg(Typers.scala:2171)
    at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$24.apply(Typers.scala:2264)
    at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$24.apply(Typers.scala:2256)
    at scala.collection.TraversableLike$$$$anonfun$$map$$1.apply(TraversableLike.scala:238)
    at scala.collection.TraversableLike$$$$anonfun$$map$$1.apply(TraversableLike.scala:238)
    at scala.collection.LinearSeqLike$$class.foreach(LinearSeqLike.scala:97)
    at scala.collection.immutable.List.foreach(List.scala:46)
    at scala.collection.TraversableLike$$class.map(TraversableLike.scala:238)
    at scala.collection.immutable.List.map(List.scala:46)
    at scala.tools.nsc.typechecker.Typers$$Typer.doTypedApply(Typers.scala:2256)
    at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$tryTypedApply$$1$$1.apply(Typers.scala:3257)
    at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$tryTypedApply$$1$$1.apply(Typers.scala:3257)
    at scala.tools.nsc.typechecker.Typers$$Typer.silent(Typers.scala:715)
    at scala.tools.nsc.typechecker.Typers$$Typer.tryTypedApply$$1(Typers.scala:3257)
    at scala.tools.nsc.typechecker.Typers$$Typer.typedApply$$1(Typers.scala:3312)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:3931)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:4077)
    at scala.tools.nsc.typechecker.Typers$$Typer.typedBlock(Typers.scala:1923)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:3776)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:4077)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:4135)
    at scala.tools.nsc.typechecker.Typers$$Typer.computeType(Typers.scala:4215)
    at scala.tools.nsc.typechecker.Namers$$Namer.methodSig(Namers.scala:918)
    at scala.tools.nsc.typechecker.Namers$$Namer.typeSig(Namers.scala:1143)
    at scala.tools.nsc.typechecker.Namers$$Namer$$$$anonfun$$typeCompleter$$1.apply(Namers.scala:515)
    at scala.tools.nsc.typechecker.Namers$$Namer$$$$anonfun$$typeCompleter$$1.apply(Namers.scala:513)
    at scala.tools.nsc.typechecker.Namers$$$$anon$$1.complete(Namers.scala:1301)
    at scala.tools.nsc.symtab.Symbols$$Symbol.info(Symbols.scala:758)
    at scala.tools.nsc.symtab.Symbols$$Symbol.initialize(Symbols.scala:867)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:3729)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:4077)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:4122)
    at scala.tools.nsc.typechecker.Typers$$Typer.typedStat$$1(Typers.scala:2097)
    at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$20.apply(Typers.scala:2165)
    at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$20.apply(Typers.scala:2165)
    at scala.collection.immutable.List.loop$$1(List.scala:116)
    at scala.collection.immutable.List.mapConserve(List.scala:133)
    at scala.collection.immutable.List.loop$$1(List.scala:120)
    at scala.collection.immutable.List.mapConserve(List.scala:133)
    at scala.collection.immutable.List.loop$$1(List.scala:120)
    at scala.collection.immutable.List.mapConserve(List.scala:133)
    at scala.collection.immutable.List.loop$$1(List.scala:120)
    at scala.collection.immutable.List.mapConserve(List.scala:133)
    at scala.collection.immutable.List.loop$$1(List.scala:120)
    at scala.collection.immutable.List.mapConserve(List.scala:133)
    at scala.collection.immutable.List.loop$$1(List.scala:120)
    at scala.collection.immutable.List.mapConserve(List.scala:133)
    at scala.collection.immutable.List.loop$$1(List.scala:120)
    at scala.collection.immutable.List.mapConserve(List.scala:133)
    at scala.collection.immutable.List.loop$$1(List.scala:120)
    at scala.collection.immutable.List.mapConserve(List.scala:133)
    at scala.collection.immutable.List.loop$$1(List.scala:120)
    at scala.collection.immutable.List.mapConserve(List.scala:133)
    at scala.collection.immutable.List.loop$$1(List.scala:120)
    at scala.collection.immutable.List.mapConserve(List.scala:133)
    at scala.tools.nsc.typechecker.Typers$$Typer.typedStats(Typers.scala:2165)
    at scala.tools.nsc.typechecker.Typers$$Typer.typedTemplate(Typers.scala:1512)
    at scala.tools.nsc.typechecker.Typers$$Typer.typedClassDef(Typers.scala:1295)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:3740)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:4077)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:4122)
    at scala.tools.nsc.typechecker.Typers$$Typer.typedStat$$1(Typers.scala:2097)
    at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$20.apply(Typers.scala:2165)
    at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$20.apply(Typers.scala:2165)
    at scala.collection.immutable.List.loop$$1(List.scala:116)
    at scala.collection.immutable.List.mapConserve(List.scala:133)
    at scala.collection.immutable.List.loop$$1(List.scala:120)
    at scala.collection.immutable.List.mapConserve(List.scala:133)
    at scala.collection.immutable.List.loop$$1(List.scala:120)
    at scala.collection.immutable.List.mapConserve(List.scala:133)
    at scala.collection.immutable.List.loop$$1(List.scala:120)
    at scala.collection.immutable.List.mapConserve(List.scala:133)
    at scala.tools.nsc.typechecker.Typers$$Typer.typedStats(Typers.scala:2165)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:3736)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:4077)
    at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:4122)
    at scala.tools.nsc.typechecker.Analyzer$$typerFactory$$$$anon$$3.apply(Analyzer.scala:82)
    at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$applyPhase$$1.apply(Global.scala:281)
    at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$applyPhase$$1.apply(Global.scala:281)
    at scala.tools.nsc.reporters.Reporter.withSource(Reporter.scala:48)
    at scala.tools.nsc.Global$$GlobalPhase.applyPhase(Global.scala:281)
    at scala.tools.nsc.typechecker.Analyzer$$typerFactory$$$$anon$$3$$$$anonfun$$run$$1.apply(Analyzer.scala:77)
    at scala.tools.nsc.typechecker.Analyzer$$typerFactory$$$$anon$$3$$$$anonfun$$run$$1.apply(Analyzer.scala:77)
    at scala.collection.Iterator$$class.foreach(Iterator.scala:582)
    at scala.collection.mutable.ListBuffer$$$$anon$$1.foreach(ListBuffer.scala:285)
    at scala.tools.nsc.typechecker.Analyzer$$typerFactory$$$$anon$$3.run(Analyzer.scala:77)
    at scala.tools.nsc.Global$$Run.compileSources(Global.scala:749)
    at scala.tools.nsc.Global$$Run.compile(Global.scala:839)
    at scala.tools.nsc.Main$$.process(Main.scala:110)
    at scala.tools.nsc.Main$$.main(Main.scala:124)
    at scala.tools.nsc.Main.main(Main.scala)

I haven't found the place causing it yet, if I have more information I'll let you know.

scabug commented 14 years ago

Imported From: https://issues.scala-lang.org/browse/SI-2868?orig=1 Reporter: Jan Kriesten (jkriesten) Attachments:

scabug commented 14 years ago

@paulp said: I notice LiteralAnnotArg is pickled two different ways, once as a ref, once not.

          case LiteralAnnotArg(const) =>
            putConstant(const)

...
        case LiteralAnnotArg(const) =>
          writeRef(const)
scabug commented 14 years ago

@lrytz said: i'll look at it. a test case would be helpful obviously :)

scabug commented 14 years ago

Jan Kriesten (jkriesten) said: Is there a way to track down on which file/place/annotation the exception occurs (it's a bigger maven project) - i have tried to add -Xprint:all to the compiler and see where it crashes. But every attempt to reproduce this on a simple test-case has failed yet.

One difference between the project and command line print:all-output makes me curious, though:

On the crashing project I get:

@new Parameters(Array("webappPath")) @new Test(groups = Array("unit")) 

Whereas the command line version produces

@org.testng.annotations.Parameters(value = ["webappPath"]) @org.testng.annotations.Test(groups = ["unit"])

scabug commented 14 years ago

Jan Kriesten (jkriesten) said: Test case (depending on guice-2, quartz and servlet-api, sorry for that)

scabug commented 14 years ago

Jan Kriesten (jkriesten) said: I could create a smaller test-case, though it depends on third-party libraries. I have attached my sources (and another compiled class). You'll find a zip including the deps here:

http://www.footprint.de/test/scala/annot.zip

Calling

scalac -cp classes:guice-2.0.jar:aopalliance-1.0.jar:servlet-api-2.5.jar:quartz-1.7.0.jar src/test.scala

will throw the exception.

I hope you can reproduce it with this example and track down the problems.

Best regards, --- Jan.

scabug commented 14 years ago

@paulp said: Replying to [comment:4 jkriesten]:

I hope you can reproduce it with this example and track down the problems.

exception when typing SchedulerProvider.QUARTZ_FACTORY_KEY_ID

Did you not include the source? Your changes of a resolution are many times lower without source.

I happened to google this message: http://www.mail-archive.com/google-guice-dev@googlegroups.com/msg00014.html

Do you still have methods and fields with the same name? That would have to be a leading contender for inducing bugs in scala.

scabug commented 14 years ago

Jan Kriesten (jkriesten) said: H Paul,

there were problems some time ago with guice, but these have been fixed and never bothered again.

Also: no, I don't have methods and fields with the same name (but class and companion object). The problem isn't guice, but the unpickler getting confused by annotations.

You'll find the source of the Schedulerprovider attached.

Best regards, --- Jan.

scabug commented 14 years ago

Jan Kriesten (jkriesten) said: Source code of the SchedulerProvider class

scabug commented 14 years ago

@paulp said: Lukas -- if you compile SchedulerProvider.scala you will see an inconsistent pickler entry at 36:

34,219: TERMname 21: QUARTZ_FACTORY_KEY_ID
35,242: POLYtpe 1: 36
36,245: CONSTANTtpe 1: 37 33
BAD ENTRY END: computed = 248, actual = 249, bytes = 15, 1, 37, 33

It says only one byte to follow but finds two. I am confused because the pickler format documentation says there should be two, a typeRef and a constantRef:

 *                  | 15 CONSTANTtpe len_Nat type_Ref constant_Ref

However in reality there is only one, and from looking at how constant types are done, it seems like there should be only one.

// Pickler
        case ConstantType(value) =>
          writeRef(value); CONSTANTtpe
// Unpickler
        case CONSTANTtpe =>
          mkConstantType(readConstantRef())

...and as that's all the time I have, this concludes today's visit to Picklerdom. Join us next week and every week here at Trac Mystery Theatre.

scabug commented 14 years ago

@lrytz said: i got it, pretty nasty :) more later.

scabug commented 14 years ago

@lrytz said: (In r20688) close #2868. problem was: when the same constant is used in a ConstantType and a LiteralAnnotArg, it is stored inside the unpickle cache 'entries' (see 'def at' in UnPickler) once as Constant, once as LiteralAnnotArg, resulting in a CCE for the second read. review by extempore.

scabug commented 14 years ago

@lrytz said: (In r20704) now correctly fix #2868. no review