NICTA/scoobi — pull request #123 by benwing (2012-08-05 06:50:03+00:00)
Title: Support up to 22 args in case classes, tuples (auto-generated)

I wrote a script to auto-generate mkCaseWireFormat, mkAbstractWireFormat, and Tuple?Fmt for any number of arguments/elements/whatever between 2 and 22 (the apparent maximum for Scala). The script is called GenWireFormat.scala.interp and it's written so that it can be loaded and run from a scala REPL. WireFormat.scala has the changes in it, and there are comments indicating exactly where the auto-generated sections are, and how to regenerate them if necessary. In the process I fixed one minor bug: toWire() for Tuple?Fmt had an = after it although the abstract prototype declares no return value, so I changed that to have no return value (or =).

I did this originally because I had a case class with 8 fields (the former maximum supported) and then started adding new fields to it (up to 10 now, I think). Rather than hack the code bit-by-bit (and have to keep doing it as I add more fields), I went ahead and did everything.

Note also that compiling from scratch gets a bit slower with this -- and more to the point, I had to make the maximum sizes larger in the invocation of 'java' that runs sbt.

Originally I had this:

java -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256m -Xmx1024M -Xss2M -jar ...

sbt ground to a halt when compiling. I doubled the first two values, as follows:

java -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=512m -Xmx2048M -Xss2M -jar ...

and now sbt compiles fine.