diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-02-24 23:00:47 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-02-24 23:00:47 +0100 |
commit | 8cdf3b3f51adff8dbeff5217505f74cfbedb55cd (patch) | |
tree | 5b249995c452ed79fc0ba39410775920380b3de3 /src/reflect | |
parent | e7ab2f4a978e244cdd4c8c03170caa2a44c7adea (diff) | |
download | scala-8cdf3b3f51adff8dbeff5217505f74cfbedb55cd.tar.gz scala-8cdf3b3f51adff8dbeff5217505f74cfbedb55cd.tar.bz2 scala-8cdf3b3f51adff8dbeff5217505f74cfbedb55cd.zip |
Banish needless semicolons.
Diffstat (limited to 'src/reflect')
12 files changed, 32 insertions, 30 deletions
diff --git a/src/reflect/scala/reflect/internal/Constants.scala b/src/reflect/scala/reflect/internal/Constants.scala index 28bc3e1dd0..5ed2f675b2 100644 --- a/src/reflect/scala/reflect/internal/Constants.scala +++ b/src/reflect/scala/reflect/internal/Constants.scala @@ -94,7 +94,7 @@ trait Constants extends api.Constants { def booleanValue: Boolean = if (tag == BooleanTag) value.asInstanceOf[Boolean] - else throw new Error("value " + value + " is not a boolean"); + else throw new Error("value " + value + " is not a boolean") def byteValue: Byte = tag match { case ByteTag => value.asInstanceOf[Byte] diff --git a/src/reflect/scala/reflect/internal/InfoTransformers.scala b/src/reflect/scala/reflect/internal/InfoTransformers.scala index 82904b0b68..4e84a29fd0 100644 --- a/src/reflect/scala/reflect/internal/InfoTransformers.scala +++ b/src/reflect/scala/reflect/internal/InfoTransformers.scala @@ -43,7 +43,7 @@ trait InfoTransformers { if (from == this.pid) this else if (from < this.pid) if (prev.pid < from) this - else prev.nextFrom(from); + else prev.nextFrom(from) else if (next.pid == NoPhase.id) next else next.nextFrom(from) } diff --git a/src/reflect/scala/reflect/internal/Kinds.scala b/src/reflect/scala/reflect/internal/Kinds.scala index 5fecc06128..5d7df8c367 100644 --- a/src/reflect/scala/reflect/internal/Kinds.scala +++ b/src/reflect/scala/reflect/internal/Kinds.scala @@ -36,7 +36,7 @@ trait Kinds { private def varStr(s: Symbol): String = if (s.isCovariant) "covariant" else if (s.isContravariant) "contravariant" - else "invariant"; + else "invariant" private def qualify(a0: Symbol, b0: Symbol): String = if (a0.toString != b0.toString) "" else { if((a0 eq b0) || (a0.owner eq b0.owner)) "" diff --git a/src/reflect/scala/reflect/internal/Names.scala b/src/reflect/scala/reflect/internal/Names.scala index b60d1e619f..8b64bf7a32 100644 --- a/src/reflect/scala/reflect/internal/Names.scala +++ b/src/reflect/scala/reflect/internal/Names.scala @@ -34,7 +34,7 @@ trait Names extends api.Names { cs(offset) * (41 * 41) + cs(offset + len - 1) * 41 + cs(offset + (len >> 1))) - else 0; + else 0 /** Is (the ASCII representation of) name at given index equal to * cs[offset..offset+len-1]? @@ -42,7 +42,7 @@ trait Names extends api.Names { private def equals(index: Int, cs: Array[Char], offset: Int, len: Int): Boolean = { var i = 0 while ((i < len) && (chrs(index + i) == cs(offset + i))) - i += 1; + i += 1 i == len } @@ -275,7 +275,7 @@ trait Names extends api.Names { var i = 0 while (i < prefix.length && start + i < len && chrs(index + start + i) == chrs(prefix.start + i)) - i += 1; + i += 1 i == prefix.length } @@ -287,7 +287,7 @@ trait Names extends api.Names { var i = 1 while (i <= suffix.length && i <= end && chrs(index + end - i) == chrs(suffix.start + suffix.length - i)) - i += 1; + i += 1 i > suffix.length } diff --git a/src/reflect/scala/reflect/internal/Printers.scala b/src/reflect/scala/reflect/internal/Printers.scala index a745a78a4f..9e72fb9145 100644 --- a/src/reflect/scala/reflect/internal/Printers.scala +++ b/src/reflect/scala/reflect/internal/Printers.scala @@ -208,7 +208,7 @@ trait Printers extends api.Printers { self: SymbolTable => case ModuleDef(mods, name, impl) => printAnnotations(tree) - printModifiers(tree, mods); + printModifiers(tree, mods) print("object " + symName(tree, name), " extends ", impl) case ValDef(mods, name, tp, rhs) => @@ -423,7 +423,7 @@ trait Printers extends api.Printers { self: SymbolTable => printOpt(" >: ", lo); printOpt(" <: ", hi) case ExistentialTypeTree(tpt, whereClauses) => - print(tpt); + print(tpt) printColumn(whereClauses, " forSome { ", ";", "}") // SelectFromArray is no longer visible in reflect.internal. diff --git a/src/reflect/scala/reflect/internal/Scopes.scala b/src/reflect/scala/reflect/internal/Scopes.scala index b1cfaa4774..850c497d4b 100644 --- a/src/reflect/scala/reflect/internal/Scopes.scala +++ b/src/reflect/scala/reflect/internal/Scopes.scala @@ -188,7 +188,7 @@ trait Scopes extends api.Scopes { self: SymbolTable => if (e1 == e) { hashtable(index) = e.tail } else { - while (e1.tail != e) e1 = e1.tail; + while (e1.tail != e) e1 = e1.tail e1.tail = e.tail } } @@ -199,7 +199,7 @@ trait Scopes extends api.Scopes { self: SymbolTable => def unlink(sym: Symbol) { var e = lookupEntry(sym.name) while (e ne null) { - if (e.sym == sym) unlink(e); + if (e.sym == sym) unlink(e) e = lookupNextEntry(e) } } @@ -300,7 +300,7 @@ trait Scopes extends api.Scopes { self: SymbolTable => if (hashtable ne null) do { e = e.tail } while ((e ne null) && e.sym.name != entry.sym.name) else - do { e = e.next } while ((e ne null) && e.sym.name != entry.sym.name); + do { e = e.next } while ((e ne null) && e.sym.name != entry.sym.name) e } diff --git a/src/reflect/scala/reflect/internal/SymbolTable.scala b/src/reflect/scala/reflect/internal/SymbolTable.scala index b3a398a8d7..9b5778b9da 100644 --- a/src/reflect/scala/reflect/internal/SymbolTable.scala +++ b/src/reflect/scala/reflect/internal/SymbolTable.scala @@ -222,7 +222,7 @@ abstract class SymbolTable extends macros.Universe def noChangeInBaseClasses(it: InfoTransformer, limit: Phase#Id): Boolean = ( it.pid >= limit || !it.changesBaseClasses && noChangeInBaseClasses(it.next, limit) - ); + ) period != 0 && runId(period) == currentRunId && { val pid = phaseId(period) if (phase.id > pid) noChangeInBaseClasses(infoTransformers.nextFrom(pid), phase.id) diff --git a/src/reflect/scala/reflect/internal/Trees.scala b/src/reflect/scala/reflect/internal/Trees.scala index 408c7c648f..ce33fd8408 100644 --- a/src/reflect/scala/reflect/internal/Trees.scala +++ b/src/reflect/scala/reflect/internal/Trees.scala @@ -522,7 +522,7 @@ trait Trees extends api.Trees { self: SymbolTable => case t => t } - orig = followOriginal(tree); setPos(tree.pos); + orig = followOriginal(tree); setPos(tree.pos) this } @@ -1425,7 +1425,7 @@ trait Trees extends api.Trees { self: SymbolTable => def subst(from: List[Symbol], to: List[Tree]): Tree = if (from.isEmpty) tree else if (tree.symbol == from.head) to.head.shallowDuplicate // TODO: does it ever make sense *not* to perform a shallowDuplicate on `to.head`? - else subst(from.tail, to.tail); + else subst(from.tail, to.tail) subst(from, to) case _ => super.transform(tree) diff --git a/src/reflect/scala/reflect/internal/Types.scala b/src/reflect/scala/reflect/internal/Types.scala index 5cb6f78874..09f78d1d5b 100644 --- a/src/reflect/scala/reflect/internal/Types.scala +++ b/src/reflect/scala/reflect/internal/Types.scala @@ -908,7 +908,7 @@ trait Types extends api.Types { self: SymbolTable => (this eq that) || (if (explainSwitch) explain("=", isSameType, this, that) else isSameType(this, that)) - ); + ) /** Is this type close enough to that type so that members * with the two type would override each other? @@ -1488,7 +1488,7 @@ trait Types extends api.Types { self: SymbolTable => tpe.underlyingPeriod = currentPeriod if (!isValid(period)) { // [Eugene to Paul] needs review - tpe.underlyingCache = if (tpe.sym == NoSymbol) ThisType(rootMirror.RootClass) else tpe.pre.memberType(tpe.sym).resultType; + tpe.underlyingCache = if (tpe.sym == NoSymbol) ThisType(rootMirror.RootClass) else tpe.pre.memberType(tpe.sym).resultType assert(tpe.underlyingCache ne tpe, tpe) } } @@ -1500,7 +1500,8 @@ trait Types extends api.Types { self: SymbolTable => if (trivial == UNKNOWN) trivial = fromBoolean(thistpe.isTrivial && supertpe.isTrivial) toBoolean(trivial) } - override def isNotNull = true; + override def isNotNull = true + override def typeSymbol = thistpe.typeSymbol override def underlying = supertpe override def prefix: Type = supertpe.prefix @@ -1637,8 +1638,8 @@ trait Types extends api.Types { self: SymbolTable => var bcs = sbcs def isNew(clazz: Symbol): Boolean = ( superclazz.baseTypeIndex(clazz) < 0 && - { var p = bcs; - while ((p ne sbcs) && (p.head != clazz)) p = p.tail; + { var p = bcs + while ((p ne sbcs) && (p.head != clazz)) p = p.tail p eq sbcs } ) @@ -2874,7 +2875,8 @@ trait Types extends api.Types { self: SymbolTable => */ case class AntiPolyType(pre: Type, targs: List[Type]) extends Type { override def safeToString = - pre.toString + targs.mkString("(with type arguments ", ", ", ")"); + pre.toString + targs.mkString("(with type arguments ", ", ", ")") + override def memberType(sym: Symbol) = appliedType(pre.memberType(sym), targs) override def kind = "AntiPolyType" } @@ -4976,7 +4978,7 @@ trait Types extends api.Types { self: SymbolTable => sym1.name == sym2.name && (sym1.isPackageClass || corresponds(sym1.owner, sym2.owner)) if (!corresponds(sym.owner, rebind0.owner)) { debuglog("ADAPT1 pre = "+pre+", sym = "+sym.fullLocationString+", rebind = "+rebind0.fullLocationString) - val bcs = pre.baseClasses.dropWhile(bc => !corresponds(bc, sym.owner)); + val bcs = pre.baseClasses.dropWhile(bc => !corresponds(bc, sym.owner)) if (bcs.isEmpty) assert(pre.typeSymbol.isRefinementClass, pre) // if pre is a refinementclass it might be a structural type => OK to leave it in. else @@ -6569,7 +6571,7 @@ trait Types extends api.Types { self: SymbolTable => } } def refines(tp: Type, sym: Symbol): Boolean = { - val syms = tp.nonPrivateMember(sym.name).alternatives; + val syms = tp.nonPrivateMember(sym.name).alternatives !syms.isEmpty && (syms forall (alt => // todo alt != sym is strictly speaking not correct, but without it we lose // efficiency. @@ -6708,8 +6710,8 @@ trait Types extends api.Types { self: SymbolTable => def glbsym(proto: Symbol): Symbol = { val prototp = glbThisType.memberInfo(proto) val syms = for (t <- ts; - alt <- (t.nonPrivateMember(proto.name).alternatives); - if glbThisType.memberInfo(alt) matches prototp + alt <- (t.nonPrivateMember(proto.name).alternatives) + if glbThisType.memberInfo(alt) matches prototp ) yield alt val symtypes = syms map glbThisType.memberInfo assert(!symtypes.isEmpty) @@ -6891,7 +6893,7 @@ trait Types extends api.Types { self: SymbolTable => if (sym.isTerm) for (alt <- tp.nonPrivateDecl(sym.name).alternatives) if (specializesSym(thistp, sym, thistp, alt, depth)) - tp.decls unlink alt; + tp.decls unlink alt tp.decls enter sym } } diff --git a/src/reflect/scala/reflect/internal/pickling/PickleBuffer.scala b/src/reflect/scala/reflect/internal/pickling/PickleBuffer.scala index 34c6fe234c..c9dfb7fe71 100644 --- a/src/reflect/scala/reflect/internal/pickling/PickleBuffer.scala +++ b/src/reflect/scala/reflect/internal/pickling/PickleBuffer.scala @@ -106,7 +106,7 @@ class PickleBuffer(data: Array[Byte], from: Int, to: Int) { do { b = readByte() x = (x << 7) + (b & 0x7f) - } while ((b & 0x80) != 0L); + } while ((b & 0x80) != 0L) x } @@ -150,7 +150,7 @@ class PickleBuffer(data: Array[Byte], from: Int, to: Int) { * Concatenate results into a list. */ def until[T](end: Int, op: () => T): List[T] = - if (readIndex == end) List() else op() :: until(end, op); + if (readIndex == end) List() else op() :: until(end, op) /** Perform operation `op` the number of * times specified. Concatenate the results into a list. diff --git a/src/reflect/scala/reflect/io/VirtualDirectory.scala b/src/reflect/scala/reflect/io/VirtualDirectory.scala index 589076d693..09b99087e6 100644 --- a/src/reflect/scala/reflect/io/VirtualDirectory.scala +++ b/src/reflect/scala/reflect/io/VirtualDirectory.scala @@ -68,6 +68,6 @@ extends AbstractFile { } def clear() { - files.clear(); + files.clear() } } diff --git a/src/reflect/scala/reflect/io/VirtualFile.scala b/src/reflect/scala/reflect/io/VirtualFile.scala index 0dfa7d5473..6f98b8385b 100644 --- a/src/reflect/scala/reflect/io/VirtualFile.scala +++ b/src/reflect/scala/reflect/io/VirtualFile.scala @@ -41,7 +41,7 @@ class VirtualFile(val name: String, override val path: String) extends AbstractF override def sizeOption: Option[Int] = Some(content.size) - def input : InputStream = new ByteArrayInputStream(content); + def input : InputStream = new ByteArrayInputStream(content) override def output: OutputStream = { new ByteArrayOutputStream() { |