Revert "Revert "Work around scalac issue causing boxing." (ClassNotFoundException)" (Reverted wrong commit.)

This reverts commit 7dac90fffe.
This commit is contained in:
Mark Harrah 2012-04-18 03:14:59 -04:00
parent 7dac90fffe
commit d0899419e7
1 changed files with 12 additions and 10 deletions

View File

@ -5,6 +5,7 @@ package sbt
package classfile package classfile
import java.io.{DataInputStream, File, InputStream} import java.io.{DataInputStream, File, InputStream}
import scala.annotation.switch
// Translation of jdepend.framework.ClassFileParser by Mike Clark, Clarkware Consulting, Inc. // Translation of jdepend.framework.ClassFileParser by Mike Clark, Clarkware Consulting, Inc.
// BSD Licensed // BSD Licensed
@ -132,11 +133,12 @@ private[sbt] object Parser
pool pool
} }
private def getConstant(in: DataInputStream) = private def getConstant(in: DataInputStream): Constant =
{ {
val tag = in.readByte() val tag = in.readByte()
tag match
{ // No switch for byte scrutinees! Stupid compiler.
((tag: Int): @switch) match {
case ConstantClass | ConstantString => new Constant(tag, in.readUnsignedShort()) case ConstantClass | ConstantString => new Constant(tag, in.readUnsignedShort())
case ConstantField | ConstantMethod | ConstantInterfaceMethod | ConstantNameAndType => case ConstantField | ConstantMethod | ConstantInterfaceMethod | ConstantNameAndType =>
new Constant(tag, in.readUnsignedShort(), in.readUnsignedShort()) new Constant(tag, in.readUnsignedShort(), in.readUnsignedShort())