summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2013-03-26 02:13:13 -0700
committerPaul Phillips <paulp@improving.org>2013-03-27 10:39:22 -0700
commit22944e474e038f11ac110661eb7e5edbea5d6d13 (patch)
tree10a50240110d17acbb46f3ba09ff98e2a6465f7d /src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
parente073975997a5291cbe76ea15e797a6783bb4d544 (diff)
downloadscala-22944e474e038f11ac110661eb7e5edbea5d6d13.tar.gz
scala-22944e474e038f11ac110661eb7e5edbea5d6d13.tar.bz2
scala-22944e474e038f11ac110661eb7e5edbea5d6d13.zip
SI-7261 Implicit conversion of BooleanSetting to Boolean and BooleanFlag
This commit shortens expressions of the form `if (settings.debug.value)` to `if (settings.debug)` for various settings. Rarely, the setting is supplied as a method argument. The conversion is not employed in simple definitions where the Boolean type would have to be specified.
Diffstat (limited to 'src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala')
-rw-r--r--src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
index 9d84ca1959..1e5cd31fff 100644
--- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
+++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
@@ -50,11 +50,11 @@ abstract class ClassfileParser {
}
private def handleMissing(e: MissingRequirementError) = {
- if (settings.debug.value) e.printStackTrace
+ if (settings.debug) e.printStackTrace
throw new IOException("Missing dependency '" + e.req + "', required by " + in.file)
}
private def handleError(e: Exception) = {
- if (settings.debug.value) e.printStackTrace()
+ if (settings.debug) e.printStackTrace()
throw new IOException("class file '%s' is broken\n(%s/%s)".format(
in.file,
e.getClass,
@@ -599,7 +599,7 @@ abstract class ClassfileParser {
def parseField() {
val jflags = in.nextChar
val sflags = toScalaFieldFlags(jflags)
- if ((sflags & PRIVATE) != 0L && !global.settings.optimise.value) {
+ if ((sflags & PRIVATE) != 0L && !global.settings.optimise) {
in.skip(4); skipAttributes()
} else {
val name = pool.getName(in.nextChar)
@@ -629,13 +629,13 @@ abstract class ClassfileParser {
def parseMethod() {
val jflags = in.nextChar.toInt
val sflags = toScalaMethodFlags(jflags)
- if (isPrivate(jflags) && !global.settings.optimise.value) {
+ if (isPrivate(jflags) && !global.settings.optimise) {
val name = pool.getName(in.nextChar)
if (name == nme.CONSTRUCTOR)
sawPrivateConstructor = true
in.skip(2); skipAttributes()
} else {
- if ((sflags & PRIVATE) != 0L && global.settings.optimise.value) {
+ if ((sflags & PRIVATE) != 0L && global.settings.optimise) {
in.skip(4); skipAttributes()
} else {
val name = pool.getName(in.nextChar)
@@ -862,7 +862,7 @@ abstract class ClassfileParser {
val sig = pool.getExternalName(in.nextChar)
val newType = sigToType(sym, sig)
sym.setInfo(newType)
- if (settings.debug.value && settings.verbose.value)
+ if (settings.debug && settings.verbose)
println("" + sym + "; signature = " + sig + " type = " + newType)
}
else in.skip(attrLen)
@@ -1025,7 +1025,7 @@ abstract class ClassfileParser {
// with a `FatalError` exception, handled above. Here you'd end up after a NPE (for example),
// and that should never be swallowed silently.
warning("Caught: " + ex + " while parsing annotations in " + in.file)
- if (settings.debug.value) ex.printStackTrace()
+ if (settings.debug) ex.printStackTrace()
None // ignore malformed annotations
}