Skip to content
Browse files

Revert "Work around scalac issue causing boxing." (ClassNotFoundExcep…

…tion)

This reverts commit 6c09031.
  • Loading branch information...
1 parent e7f70c2 commit 7dac90fffe2e579c34be78ac81a8ea0cdd9c1d0f @harrah committed
Showing with 10 additions and 12 deletions.
  1. +10 −12 util/classfile/Parser.scala
View
22 util/classfile/Parser.scala
@@ -5,7 +5,6 @@ package sbt
package classfile
import java.io.{DataInputStream, File, InputStream}
-import scala.annotation.switch
// Translation of jdepend.framework.ClassFileParser by Mike Clark, Clarkware Consulting, Inc.
// BSD Licensed
@@ -133,18 +132,17 @@ private[sbt] object Parser
pool
}
- private def getConstant(in: DataInputStream): Constant =
- {
+ private def getConstant(in: DataInputStream) =
+ {
val tag = in.readByte()
-
- // No switch for byte scrutinees! Stupid compiler.
- ((tag: Int): @switch) match {
- case ConstantClass | ConstantString => new Constant(tag, in.readUnsignedShort())
- case ConstantField | ConstantMethod | ConstantInterfaceMethod | ConstantNameAndType =>
- new Constant(tag, in.readUnsignedShort(), in.readUnsignedShort())
- case ConstantInteger => new Constant(tag, new java.lang.Integer(in.readInt()))
- case ConstantFloat => new Constant(tag, new java.lang.Float(in.readFloat()))
- case ConstantLong => new Constant(tag, new java.lang.Long(in.readLong()))
+ tag match
+ {
+ case ConstantClass | ConstantString => new Constant(tag, in.readUnsignedShort())
+ case ConstantField | ConstantMethod | ConstantInterfaceMethod | ConstantNameAndType =>
+ new Constant(tag, in.readUnsignedShort(), in.readUnsignedShort())
+ case ConstantInteger => new Constant(tag, new java.lang.Integer(in.readInt()))
+ case ConstantFloat => new Constant(tag, new java.lang.Float(in.readFloat()))
+ case ConstantLong => new Constant(tag, new java.lang.Long(in.readLong()))
case ConstantDouble => new Constant(tag, new java.lang.Double(in.readDouble()))
case ConstantUTF8 => new Constant(tag, in.readUTF())
case _ => error("Unknown constant: " + tag)

0 comments on commit 7dac90f

Please sign in to comment.
Something went wrong with that request. Please try again.