diff options
author | Paul Phillips <paulp@improving.org> | 2011-09-15 20:32:48 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-09-15 20:32:48 +0000 |
commit | 3b357972e911aed24842f4c2229058b4a1311d1b (patch) | |
tree | 373369e510f69336a90f86ab57a989aad3bf7949 /src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala | |
parent | 09b1a31309c9cbf1394c317b87d2073d39a8cd56 (diff) | |
download | scala-3b357972e911aed24842f4c2229058b4a1311d1b.tar.gz scala-3b357972e911aed24842f4c2229058b4a1311d1b.tar.bz2 scala-3b357972e911aed24842f4c2229058b4a1311d1b.zip |
Removed parens from calls to Name#toString.
This commit doesn't include the line which would change anything
interesting (that being making toString in Name a val), it is all
the changes elsewhere which one would have to make to do that. I
didn't want to waste them. A quirk of scala is that if you call an
empty-parameter-list method:
foo.bar() // e.g. x.toString()
foo.bar // where you could have called x.toString
then if you decide in the future to make it a val, every call site must
potentially be modified. This is a bit of a bummer. One can try to
defend against that future decision by eschewing parentheses, but it's
not very satisfying or effective. No review.
Diffstat (limited to 'src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala index d9eaad55a0..a3c1ebf231 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala @@ -342,7 +342,7 @@ abstract class ClassfileParser { val start = starts(index) value = (in.buf(start).toInt: @switch) match { case CONSTANT_STRING => - Constant(getName(in.getChar(start + 1).toInt).toString()) + Constant(getName(in.getChar(start + 1).toInt).toString) case CONSTANT_INTEGER => Constant(in.getInt(start + 1)) case CONSTANT_FLOAT => @@ -882,13 +882,13 @@ abstract class ClassfileParser { case tpnme.ScalaSignatureATTR => if (!isScalaAnnot) { debuglog("warning: symbol " + sym.fullName + " has pickled signature in attribute") - unpickler.unpickle(in.buf, in.bp, clazz, staticModule, in.file.toString()) + unpickler.unpickle(in.buf, in.bp, clazz, staticModule, in.file.toString) } in.skip(attrLen) case tpnme.ScalaATTR => isScalaRaw = true case tpnme.JacoMetaATTR => - val meta = pool.getName(in.nextChar).toString().trim() + val meta = pool.getName(in.nextChar).toString.trim() metaParser.parse(meta, sym, symtype) this.hasMeta = true // Attribute on methods of java annotation classes when that method has a default @@ -904,7 +904,7 @@ abstract class ClassfileParser { case Some(san: AnnotationInfo) => val bytes = san.assocs.find({ _._1 == nme.bytes }).get._2.asInstanceOf[ScalaSigBytes].bytes - unpickler.unpickle(bytes, 0, clazz, staticModule, in.file.toString()) + unpickler.unpickle(bytes, 0, clazz, staticModule, in.file.toString) case None => throw new RuntimeException("Scala class file does not contain Scala annotation") } @@ -939,7 +939,7 @@ abstract class ClassfileParser { val index = in.nextChar tag match { case STRING_TAG => - Some(LiteralAnnotArg(Constant(pool.getName(index).toString()))) + Some(LiteralAnnotArg(Constant(pool.getName(index).toString))) case BOOL_TAG | BYTE_TAG | CHAR_TAG | SHORT_TAG | INT_TAG | LONG_TAG | FLOAT_TAG | DOUBLE_TAG => Some(LiteralAnnotArg(pool.getConstant(index))) |