diff options
135 files changed, 640 insertions, 514 deletions
diff --git a/lib/scala-compiler.jar.desired.sha1 b/lib/scala-compiler.jar.desired.sha1 index 5a541f8cf3..736086a8c3 100644 --- a/lib/scala-compiler.jar.desired.sha1 +++ b/lib/scala-compiler.jar.desired.sha1 @@ -1 +1 @@ -c020eccb8cf37963725985f36b44d070915cf4d2 ?scala-compiler.jar +5b3f50d124f84dcda869e17fb0cfd605ed40f385 ?scala-compiler.jar diff --git a/lib/scala-library.jar.desired.sha1 b/lib/scala-library.jar.desired.sha1 index d059e861f0..4c15c663dd 100644 --- a/lib/scala-library.jar.desired.sha1 +++ b/lib/scala-library.jar.desired.sha1 @@ -1 +1 @@ -31c7188cef85c28b84b9ce35bc6780996e5dd139 ?scala-library.jar +8f19876a8908e7d7d2a140a8434805cfec2c1346 ?scala-library.jar diff --git a/src/compiler/scala/reflect/internal/Symbols.scala b/src/compiler/scala/reflect/internal/Symbols.scala index 724e5bf628..240dedc658 100644 --- a/src/compiler/scala/reflect/internal/Symbols.scala +++ b/src/compiler/scala/reflect/internal/Symbols.scala @@ -3054,7 +3054,7 @@ trait Symbols extends api.Symbols { self: SymbolTable => override def originalEnclosingMethod = this override def owner: Symbol = - abort("no-symbol does not have an owner (this is a bug: scala " + scala.util.Properties.versionString + ")") + abort("no-symbol does not have an owner") override def typeConstructor: Type = abort("no-symbol does not have a type constructor (this may indicate scalac cannot find fundamental classes)") } diff --git a/src/compiler/scala/tools/ant/templates/tool-unix.tmpl b/src/compiler/scala/tools/ant/templates/tool-unix.tmpl index 599936f6f8..85bb5f2056 100644 --- a/src/compiler/scala/tools/ant/templates/tool-unix.tmpl +++ b/src/compiler/scala/tools/ant/templates/tool-unix.tmpl @@ -9,10 +9,19 @@ ############################################################################## findScalaHome () { - # see #2092 + # see SI-2092 local SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done - ( cd -P "$( dirname "$SOURCE" )"/.. && pwd ) + local bindir="$( dirname "$SOURCE" )" + if [[ -d "$bindir"/.. ]]; then + ( cd -P "$bindir"/.. && pwd ) + else + # See SI-5792 + local dir=$(dirname "${BASH_SOURCE[0]}") + local link=$(dirname "$(readlink "${BASH_SOURCE[0]}")") + local path="$dir/$link/.." + ( cd "$path" && pwd ) + fi } execCommand () { [[ -n $SCALA_RUNNER_DEBUG ]] && echo "" && for arg in "$@@"; do echo "$arg"; done && echo ""; diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index de270a76f1..49a644ba3a 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -130,7 +130,28 @@ class Global(var currentSettings: Settings, var reporter: Reporter) extends Symb object nodePrinters extends { val global: Global.this.type = Global.this } with NodePrinters { + var lastPrintedPhase: Phase = NoPhase + var lastPrintedSource: String = "" infolevel = InfoLevel.Verbose + + def showUnit(unit: CompilationUnit) { + print(" // " + unit.source) + if (unit.body == null) println(": tree is null") + else { + val source = util.stringFromWriter(w => newTreePrinter(w) print unit.body) + + // treePrinter show unit.body + if (lastPrintedSource == source) + println(": tree is unchanged since " + lastPrintedPhase) + else { + lastPrintedPhase = phase.prev // since we're running inside "afterPhase" + lastPrintedSource = source + println("") + println(source) + println("") + } + } + } } def withInfoLevel[T](infolevel: nodePrinters.InfoLevel.Value)(op: => T) = { @@ -1588,8 +1609,10 @@ class Global(var currentSettings: Settings, var reporter: Reporter) extends Symb } // class Run def printAllUnits() { - print("[[syntax trees at end of " + phase + "]]") - afterPhase(phase) { currentRun.units foreach (treePrinter.print(_)) } + print("[[syntax trees at end of %25s]]".format(phase)) + afterPhase(phase)(currentRun.units foreach { unit => + nodePrinters showUnit unit + }) } /** We resolve the class/object ambiguity by passing a type/term name. diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala index 722440349a..793b85da18 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala @@ -1133,16 +1133,27 @@ trait Implicits { * An EmptyTree is returned if materialization fails. */ private def tagOfType(pre: Type, tp: Type, tagClass: Symbol): SearchResult = { - def success(arg: Tree) = + def success(arg: Tree) = { + def isMacroException(msg: String): Boolean = + // [Eugene] very unreliable, ask Hubert about a better way + msg contains "exception during macro expansion" + + def processMacroExpansionError(pos: Position, msg: String): SearchResult = { + // giving up and reporting all macro exceptions regardless of their source + // this might lead to an avalanche of errors if one of your implicit macros misbehaves + if (isMacroException(msg)) context.error(pos, msg) + failure(arg, "failed to typecheck the materialized tag: %n%s".format(msg), pos) + } + try { val tree1 = typed(atPos(pos.focus)(arg)) - def isErroneous = tree exists (_.isErroneous) - if (context.hasErrors) failure(tp, "failed to typecheck the materialized typetag: %n%s".format(context.errBuffer.head.errMsg), context.errBuffer.head.errPos) + if (context.hasErrors) processMacroExpansionError(context.errBuffer.head.errPos, context.errBuffer.head.errMsg) else new SearchResult(tree1, EmptyTreeTypeSubstituter) } catch { case ex: TypeError => - failure(arg, "failed to typecheck the materialized typetag: %n%s".format(ex.msg), ex.pos) + processMacroExpansionError(ex.pos, ex.msg) } + } val prefix = ( // ClassTags only exist for scala.reflect.mirror, so their materializer diff --git a/src/compiler/scala/tools/nsc/typechecker/Macros.scala b/src/compiler/scala/tools/nsc/typechecker/Macros.scala index 353514c397..c10901cdce 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Macros.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Macros.scala @@ -641,143 +641,181 @@ trait Macros extends Traces { */ private type MacroRuntime = List[Any] => Any private val macroRuntimesCache = perRunCaches.newWeakMap[Symbol, Option[MacroRuntime]] - private def macroRuntime(macroDef: Symbol): Option[MacroRuntime] = - macroRuntimesCache.getOrElseUpdate(macroDef, { - val runtime = { - macroTraceVerbose("looking for macro implementation: ")(macroDef) - macroTraceVerbose("macroDef is annotated with: ")(macroDef.annotations) - - val ann = macroDef.getAnnotation(MacroImplAnnotation) - if (ann == None) { - macroTraceVerbose("@macroImpl annotation is missing (this means that macro definition failed to typecheck)")(macroDef) - return None - } + private lazy val fastTrack: Map[Symbol, MacroRuntime] = { + import scala.reflect.api.Universe + import scala.reflect.makro.internal._ + Map( // challenge: how can we factor out the common code? Does not seem to be easy. + MacroInternal_materializeArrayTag -> (args => { + assert(args.length == 3, args) + val c = args(0).asInstanceOf[MacroContext] + materializeArrayTag_impl(c)(args(1).asInstanceOf[c.Expr[Universe]])(args(2).asInstanceOf[c.TypeTag[_]]) + }), + MacroInternal_materializeErasureTag -> (args => { + assert(args.length == 3, args) + val c = args(0).asInstanceOf[MacroContext] + materializeErasureTag_impl(c)(args(1).asInstanceOf[c.Expr[Universe]])(args(2).asInstanceOf[c.TypeTag[_]]) + }), + MacroInternal_materializeClassTag -> (args => { + assert(args.length == 3, args) + val c = args(0).asInstanceOf[MacroContext] + materializeClassTag_impl(c)(args(1).asInstanceOf[c.Expr[Universe]])(args(2).asInstanceOf[c.TypeTag[_]]) + }), + MacroInternal_materializeTypeTag -> (args => { + assert(args.length == 3, args) + val c = args(0).asInstanceOf[MacroContext] + materializeTypeTag_impl(c)(args(1).asInstanceOf[c.Expr[Universe]])(args(2).asInstanceOf[c.TypeTag[_]]) + }), + MacroInternal_materializeConcreteTypeTag -> (args => { + assert(args.length == 3, args) + val c = args(0).asInstanceOf[MacroContext] + materializeConcreteTypeTag_impl(c)(args(1).asInstanceOf[c.Expr[Universe]])(args(2).asInstanceOf[c.TypeTag[_]]) + }) + ) + } + private def macroRuntime(macroDef: Symbol): Option[MacroRuntime] = { + macroTraceVerbose("looking for macro implementation: ")(macroDef) + if (fastTrack contains macroDef) { + macroLogVerbose("macro expansion serviced by a fast track") + Some(fastTrack(macroDef)) + } else { + macroRuntimesCache.getOrElseUpdate(macroDef, { + val runtime = { + macroTraceVerbose("looking for macro implementation: ")(macroDef) + macroTraceVerbose("macroDef is annotated with: ")(macroDef.annotations) - val macroImpl = ann.get.args(0).symbol - if (macroImpl == NoSymbol) { - macroTraceVerbose("@macroImpl annotation is malformed (this means that macro definition failed to typecheck)")(macroDef) - return None - } + val ann = macroDef.getAnnotation(MacroImplAnnotation) + if (ann == None) { + macroTraceVerbose("@macroImpl annotation is missing (this means that macro definition failed to typecheck)")(macroDef) + return None + } - macroLogVerbose("resolved implementation %s at %s".format(macroImpl, macroImpl.pos)) - if (macroImpl.isErroneous) { - macroTraceVerbose("macro implementation is erroneous (this means that either macro body or macro implementation signature failed to typecheck)")(macroDef) - return None - } + val macroImpl = ann.get.args(0).symbol + if (macroImpl == NoSymbol) { + macroTraceVerbose("@macroImpl annotation is malformed (this means that macro definition failed to typecheck)")(macroDef) + return None + } - def loadMacroImpl(macroMirror: Mirror): Option[(Object, macroMirror.Symbol)] = { - try { - // this logic relies on the assumptions that were valid for the old macro prototype - // namely that macro implementations can only be defined in top-level classes and modules - // with the new prototype that materialized in a SIP, macros need to be statically accessible, which is different - // for example, a macro def could be defined in a trait that is implemented by an object - // there are some more clever cases when seemingly non-static method ends up being statically accessible - // however, the code below doesn't account for these guys, because it'd take a look of time to get it right - // for now I leave it as a todo and move along to more the important stuff - - macroTraceVerbose("loading implementation class from %s: ".format(macroMirror))(macroImpl.owner.fullName) - macroTraceVerbose("classloader is: ")("%s of type %s".format(macroMirror.classLoader, if (macroMirror.classLoader != null) macroMirror.classLoader.getClass.toString else "primordial classloader")) - def inferClasspath(cl: ClassLoader) = cl match { - case cl: java.net.URLClassLoader => "[" + (cl.getURLs mkString ",") + "]" - case null => "[" + scala.tools.util.PathResolver.Environment.javaBootClassPath + "]" - case _ => "<unknown>" - } - macroTraceVerbose("classpath is: ")(inferClasspath(macroMirror.classLoader)) - - // [Eugene] relies on the fact that macro implementations can only be defined in static classes - // [Martin to Eugene] There's similar logic buried in Symbol#flatname. Maybe we can refactor? - def classfile(sym: Symbol): String = { - def recur(sym: Symbol): String = sym match { - case sym if sym.owner.isPackageClass => - val suffix = if (sym.isModuleClass) "$" else "" - sym.fullName + suffix - case sym => - val separator = if (sym.owner.isModuleClass) "" else "$" - recur(sym.owner) + separator + sym.javaSimpleName.toString + macroLogVerbose("resolved implementation %s at %s".format(macroImpl, macroImpl.pos)) + if (macroImpl.isErroneous) { + macroTraceVerbose("macro implementation is erroneous (this means that either macro body or macro implementation signature failed to typecheck)")(macroDef) + return None + } + + def loadMacroImpl(macroMirror: Mirror): Option[(Object, macroMirror.Symbol)] = { + try { + // this logic relies on the assumptions that were valid for the old macro prototype + // namely that macro implementations can only be defined in top-level classes and modules + // with the new prototype that materialized in a SIP, macros need to be statically accessible, which is different + // for example, a macro def could be defined in a trait that is implemented by an object + // there are some more clever cases when seemingly non-static method ends up being statically accessible + // however, the code below doesn't account for these guys, because it'd take a look of time to get it right + // for now I leave it as a todo and move along to more the important stuff + + macroTraceVerbose("loading implementation class from %s: ".format(macroMirror))(macroImpl.owner.fullName) + macroTraceVerbose("classloader is: ")("%s of type %s".format(macroMirror.classLoader, if (macroMirror.classLoader != null) macroMirror.classLoader.getClass.toString else "primordial classloader")) + def inferClasspath(cl: ClassLoader) = cl match { + case cl: java.net.URLClassLoader => "[" + (cl.getURLs mkString ",") + "]" + case null => "[" + scala.tools.util.PathResolver.Environment.javaBootClassPath + "]" + case _ => "<unknown>" } + macroTraceVerbose("classpath is: ")(inferClasspath(macroMirror.classLoader)) + + // [Eugene] relies on the fact that macro implementations can only be defined in static classes + // [Martin to Eugene] There's similar logic buried in Symbol#flatname. Maybe we can refactor? + def classfile(sym: Symbol): String = { + def recur(sym: Symbol): String = sym match { + case sym if sym.owner.isPackageClass => + val suffix = if (sym.isModuleClass) "$" else "" + sym.fullName + suffix + case sym => + val separator = if (sym.owner.isModuleClass) "" else "$" + recur(sym.owner) + separator + sym.javaSimpleName.toString + } - if (sym.isClass || sym.isModule) recur(sym) - else recur(sym.enclClass) - } + if (sym.isClass || sym.isModule) recur(sym) + else recur(sym.enclClass) + } - // [Eugene] this doesn't work for inner classes - // neither does macroImpl.owner.javaClassName, so I had to roll my own implementation - //val receiverName = macroImpl.owner.fullName - val implClassName = classfile(macroImpl.owner) - val implClassSymbol: macroMirror.Symbol = macroMirror.symbolForName(implClassName) + // [Eugene] this doesn't work for inner classes + // neither does macroImpl.owner.javaClassName, so I had to roll my own implementation + //val receiverName = macroImpl.owner.fullName + val implClassName = classfile(macroImpl.owner) + val implClassSymbol: macroMirror.Symbol = macroMirror.symbolForName(implClassName) - if (macroDebugVerbose) { - println("implClassSymbol is: " + implClassSymbol.fullNameString) + if (macroDebugVerbose) { + println("implClassSymbol is: " + implClassSymbol.fullNameString) - if (implClassSymbol != macroMirror.NoSymbol) { - val implClass = macroMirror.classToJava(implClassSymbol) - val implSource = implClass.getProtectionDomain.getCodeSource - println("implClass is %s from %s".format(implClass, implSource)) - println("implClassLoader is %s with classpath %s".format(implClass.getClassLoader, inferClasspath(implClass.getClassLoader))) + if (implClassSymbol != macroMirror.NoSymbol) { + val implClass = macroMirror.classToJava(implClassSymbol) + val implSource = implClass.getProtectionDomain.getCodeSource + println("implClass is %s from %s".format(implClass, implSource)) + println("implClassLoader is %s with classpath %s".format(implClass.getClassLoader, inferClasspath(implClass.getClassLoader))) + } } - } - val implObjSymbol = implClassSymbol.companionModule - macroTraceVerbose("implObjSymbol is: ")(implObjSymbol.fullNameString) + val implObjSymbol = implClassSymbol.companionModule + macroTraceVerbose("implObjSymbol is: ")(implObjSymbol.fullNameString) - if (implObjSymbol == macroMirror.NoSymbol) None - else { - // yet another reflection method that doesn't work for inner classes - //val receiver = macroMirror.companionInstance(receiverClass) - val implObj = try { - val implObjClass = java.lang.Class.forName(implClassName, true, macroMirror.classLoader) - implObjClass getField "MODULE$" get null - } catch { - case ex: NoSuchFieldException => macroTraceVerbose("exception when loading implObj: ")(ex); null - case ex: NoClassDefFoundError => macroTraceVerbose("exception when loading implObj: ")(ex); null - case ex: ClassNotFoundException => macroTraceVerbose("exception when loading implObj: ")(ex); null - } - - if (implObj == null) None + if (implObjSymbol == macroMirror.NoSymbol) None else { - val implMethSymbol = implObjSymbol.info.member(macroMirror.newTermName(macroImpl.name.toString)) - macroLogVerbose("implMethSymbol is: " + implMethSymbol.fullNameString) - macroLogVerbose("jimplMethSymbol is: " + macroMirror.methodToJava(implMethSymbol)) + // yet another reflection method that doesn't work for inner classes + //val receiver = macroMirror.companionInstance(receiverClass) + val implObj = try { + val implObjClass = java.lang.Class.forName(implClassName, true, macroMirror.classLoader) + implObjClass getField "MODULE$" get null + } catch { + case ex: NoSuchFieldException => macroTraceVerbose("exception when loading implObj: ")(ex); null + case ex: NoClassDefFoundError => macroTraceVerbose("exception when loading implObj: ")(ex); null + case ex: ClassNotFoundException => macroTraceVerbose("exception when loading implObj: ")(ex); null + } - if (implMethSymbol == macroMirror.NoSymbol) None + if (implObj == null) None else { - macroLogVerbose("successfully loaded macro impl as (%s, %s)".format(implObj, implMethSymbol)) - Some((implObj, implMethSymbol)) + val implMethSymbol = implObjSymbol.info.member(macroMirror.newTermName(macroImpl.name.toString)) + macroLogVerbose("implMethSymbol is: " + implMethSymbol.fullNameString) + macroLogVerbose("jimplMethSymbol is: " + macroMirror.methodToJava(implMethSymbol)) + + if (implMethSymbol == macroMirror.NoSymbol) None + else { + macroLogVerbose("successfully loaded macro impl as (%s, %s)".format(implObj, implMethSymbol)) + Some((implObj, implMethSymbol)) + } } } + } catch { + case ex: ClassNotFoundException => + macroTraceVerbose("implementation class failed to load: ")(ex.toString) + None } - } catch { - case ex: ClassNotFoundException => - macroTraceVerbose("implementation class failed to load: ")(ex.toString) - None } - } - val primary = loadMacroImpl(primaryMirror) - primary match { - case Some((implObj, implMethSymbol)) => - def runtime(args: List[Any]) = primaryMirror.invoke(implObj, implMethSymbol)(args: _*).asInstanceOf[Any] - Some(runtime _) - case None => - if (settings.XmacroFallbackClasspath.value != "") { - macroLogVerbose("trying to load macro implementation from the fallback mirror: %s".format(settings.XmacroFallbackClasspath.value)) - val fallback = loadMacroImpl(fallbackMirror) - fallback match { - case Some((implObj, implMethSymbol)) => - def runtime(args: List[Any]) = fallbackMirror.invoke(implObj, implMethSymbol)(args: _*).asInstanceOf[Any] - Some(runtime _) - case None => - None + val primary = loadMacroImpl(primaryMirror) + primary match { + case Some((implObj, implMethSymbol)) => + def runtime(args: List[Any]) = primaryMirror.invoke(implObj, implMethSymbol)(args: _*).asInstanceOf[Any] + Some(runtime _) + case None => + if (settings.XmacroFallbackClasspath.value != "") { + macroLogVerbose("trying to load macro implementation from the fallback mirror: %s".format(settings.XmacroFallbackClasspath.value)) + val fallback = loadMacroImpl(fallbackMirror) + fallback match { + case Some((implObj, implMethSymbol)) => + def runtime(args: List[Any]) = fallbackMirror.invoke(implObj, implMethSymbol)(args: _*).asInstanceOf[Any] + Some(runtime _) + case None => + None + } + } else { + None } - } else { - None - } + } } - } - if (runtime == None) macroDef setFlag IS_ERROR - runtime - }) + if (runtime == None) macroDef setFlag IS_ERROR + runtime + }) + } + } /** Should become private again once we're done with migrating typetag generation from implicits */ def macroContext(typer: Typer, prefixTree: Tree, expandeeTree: Tree): MacroContext { val mirror: global.type } = @@ -1203,8 +1241,10 @@ trait Macros extends Traces { if (relevancyThreshold == -1) None else { var relevantElements = realex.getStackTrace().take(relevancyThreshold + 1) - var framesTillReflectiveInvocationOfMacroImpl = relevantElements.reverse.indexWhere(_.isNativeMethod) + 1 - relevantElements = relevantElements dropRight framesTillReflectiveInvocationOfMacroImpl + def isMacroInvoker(este: StackTraceElement) = este.isNativeMethod || (este.getClassName != null && (este.getClassName contains "fastTrack")) + var threshold = relevantElements.reverse.indexWhere(isMacroInvoker) + 1 + while (threshold != relevantElements.length && isMacroInvoker(relevantElements(relevantElements.length - threshold - 1))) threshold += 1 + relevantElements = relevantElements dropRight threshold realex.setStackTrace(relevantElements) val message = new java.io.StringWriter() diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala index b878ce3a53..4e578e3f0d 100644 --- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala +++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala @@ -1488,8 +1488,23 @@ abstract class RefChecks extends InfoTransform with reflect.internal.transform.R private def transformCaseApply(tree: Tree, ifNot: => Unit) = { val sym = tree.symbol - - if (sym.isSourceMethod && sym.isCase && sym.name == nme.apply) + + def isClassTypeAccessible(tree: Tree): Boolean = tree match { + case TypeApply(fun, targs) => + isClassTypeAccessible(fun) + case Select(module, apply) => + // Fixes SI-5626. Classes in refinement types cannot be constructed with `new`. In this case, + // the companion class is actually not a ClassSymbol, but a reference to an abstract type. + module.symbol.companionClass.isClass + } + + val doTransform = + sym.isSourceMethod && + sym.isCase && + sym.name == nme.apply && + isClassTypeAccessible(tree) + + if (doTransform) toConstructor(tree.pos, tree.tpe) else { ifNot diff --git a/src/compiler/scala/tools/nsc/typechecker/Unapplies.scala b/src/compiler/scala/tools/nsc/typechecker/Unapplies.scala index 1ebcea4a07..3d9453d8cd 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Unapplies.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Unapplies.scala @@ -210,13 +210,25 @@ trait Unapplies extends ast.TreeDSL // and re-added in ``finishWith'' in the namer. def paramWithDefault(vd: ValDef) = treeCopy.ValDef(vd, vd.mods | DEFAULTPARAM, vd.name, atPos(vd.pos.focus)(TypeTree() setOriginal vd.tpt), toIdent(vd)) - - val paramss = mmap(cparamss)(paramWithDefault) - val classTpe = classType(cdef, tparams) + + val (copyParamss, funParamss) = cparamss match { + case Nil => (Nil, Nil) + case ps :: pss => + (List(ps.map(paramWithDefault)), mmap(pss)(p => copyUntyped[ValDef](p).copy(rhs = EmptyTree))) + } + + val classTpe = classType(cdef, tparams) + val bodyTpe = funParamss.foldRight(classTpe)((params, restp) => gen.scalaFunctionConstr(params.map(_.tpt), restp)) + + val argss = copyParamss match { + case Nil => Nil + case ps :: Nil => mmap(ps :: funParamss)(toIdent) + } + val body = funParamss.foldRight(New(classTpe, argss): Tree)(Function) Some(atPos(cdef.pos.focus)( - DefDef(Modifiers(SYNTHETIC), nme.copy, tparams, paramss, classTpe, - New(classTpe, mmap(paramss)(toIdent))) + DefDef(Modifiers(SYNTHETIC), nme.copy, tparams, copyParamss, bodyTpe, + body) )) } } diff --git a/src/library/scala/Array.scala b/src/library/scala/Array.scala index 36e95b303d..cf72973b7c 100644 --- a/src/library/scala/Array.scala +++ b/src/library/scala/Array.scala @@ -362,8 +362,8 @@ object Array extends FallbackArrayBuilding { /** Returns an array containing a sequence of increasing integers in a range. * - * @param from the start value of the array - * @param end the end value of the array, exclusive (in other words, this is the first value '''not''' returned) + * @param start the start value of the array + * @param end the end value of the array, exclusive (in other words, this is the first value '''not''' returned) * @return the array with values in range `start, start + 1, ..., end - 1` * up to, but excluding, `end`. */ diff --git a/src/library/scala/Console.scala b/src/library/scala/Console.scala index 5e62df6c71..50e6626700 100644 --- a/src/library/scala/Console.scala +++ b/src/library/scala/Console.scala @@ -186,7 +186,6 @@ object Console { * } * }}} * - * @param in the new input stream. * @param thunk the code to execute with * the new input stream active * diff --git a/src/library/scala/Either.scala b/src/library/scala/Either.scala index 20451600a9..b35d8a7c8a 100644 --- a/src/library/scala/Either.scala +++ b/src/library/scala/Either.scala @@ -297,7 +297,7 @@ object Either { * Left(12).left.foreach(x => println(x)) // prints "12" * Right(12).left.foreach(x => println(x)) // doesn't print * }}} - * @param e The side-effecting function to execute. + * @param f The side-effecting function to execute. */ def foreach[U](f: A => U) = e match { case Left(a) => f(a) @@ -358,7 +358,7 @@ object Either { * Left(12).left.flatMap(x => Left("scala")) // Left("scala") * Right(12).left.flatMap(x => Left("scala") // Right(12) * }}} - * @param The function to bind across `Left`. + * @param f The function to bind across `Left`. */ def flatMap[BB >: B, X](f: A => Either[X, BB]) = e match { case Left(a) => f(a) @@ -462,7 +462,7 @@ object Either { * Right(12).right.foreach(x => println(x)) // prints "12" * Left(12).right.foreach(x => println(x)) // doesn't print * }}} - * @param e The side-effecting function to execute. + * @param f The side-effecting function to execute. */ def foreach[U](f: B => U) = e match { case Left(_) => {} @@ -516,7 +516,7 @@ object Either { /** * Binds the given function across `Right`. * - * @param The function to bind across `Right`. + * @param f The function to bind across `Right`. */ def flatMap[AA >: A, Y](f: B => Either[AA, Y]) = e match { case Left(a) => Left(a) diff --git a/src/library/scala/Function.scala b/src/library/scala/Function.scala index 9fa56a332f..9ad2bc49ea 100644 --- a/src/library/scala/Function.scala +++ b/src/library/scala/Function.scala @@ -20,7 +20,6 @@ object Function { * function `f,,1,, andThen ... andThen f,,n,,`. * * @param fs The given sequence of functions - * @return ... */ def chain[a](fs: Seq[a => a]): a => a = { x => (x /: fs) ((x, f) => f(x)) } @@ -72,9 +71,6 @@ object Function { * * @note These functions are slotted for deprecation, but it is on * hold pending superior type inference for tupling anonymous functions. - * - * @param f ... - * @return ... */ // @deprecated("Use `f.tupled` instead") def tupled[a1, a2, b](f: (a1, a2) => b): Tuple2[a1, a2] => b = { diff --git a/src/library/scala/Option.scala b/src/library/scala/Option.scala index 44c8fba45f..c461b413d6 100644 --- a/src/library/scala/Option.scala +++ b/src/library/scala/Option.scala @@ -146,7 +146,7 @@ sealed abstract class Option[+A] extends Product with Serializable { /** Returns the result of applying $f to this $option's * value if the $option is nonempty. Otherwise, evaluates - * expression $ifEmpty. + * expression `ifEmpty`. * * @note This is equivalent to `$option map f getOrElse ifEmpty`. * diff --git a/src/library/scala/Predef.scala b/src/library/scala/Predef.scala index 500ee87c46..30ad703c4a 100644 --- a/src/library/scala/Predef.scala +++ b/src/library/scala/Predef.scala @@ -160,7 +160,7 @@ object Predef extends LowPriorityImplicits { * is at least `ASSERTION`. * * @see elidable - * @param p the expression to test + * @param assertion the expression to test */ @elidable(ASSERTION) def assert(assertion: Boolean) { @@ -173,8 +173,8 @@ object Predef extends LowPriorityImplicits { * is at least `ASSERTION`. * * @see elidable - * @param p the expression to test - * @param msg a String to include in the failure message + * @param assertion the expression to test + * @param message a String to include in the failure message */ @elidable(ASSERTION) @inline final def assert(assertion: Boolean, message: => Any) { @@ -189,7 +189,7 @@ object Predef extends LowPriorityImplicits { * will not be generated if `-Xelide-below` is at least `ASSERTION`. * * @see elidable - * @param p the expression to test + * @param assumption the expression to test */ @elidable(ASSERTION) def assume(assumption: Boolean) { @@ -204,8 +204,8 @@ object Predef extends LowPriorityImplicits { * will not be generated if `-Xelide-below` is at least `ASSERTION`. * * @see elidable - * @param p the expression to test - * @param msg a String to include in the failure message + * @param assumption the expression to test + * @param message a String to include in the failure message */ @elidable(ASSERTION) @inline final def assume(assumption: Boolean, message: => Any) { @@ -217,7 +217,7 @@ object Predef extends LowPriorityImplicits { * This method is similar to `assert`, but blames the caller of the method * for violating the condition. * - * @param p the expression to test + * @param requirement the expression to test */ def require(requirement: Boolean) { if (!requirement) @@ -228,8 +228,8 @@ object Predef extends LowPriorityImplicits { * This method is similar to `assert`, but blames the caller of the method * for violating the condition. * - * @param p the expression to test - * @param msg a String to include in the failure message + * @param requirement the expression to test + * @param message a String to include in the failure message */ @inline final def require(requirement: Boolean, message: => Any) { if (!requirement) diff --git a/src/library/scala/Product.scala b/src/library/scala/Product.scala index 1459ab9ea5..8c42c60d98 100644 --- a/src/library/scala/Product.scala +++ b/src/library/scala/Product.scala @@ -19,7 +19,7 @@ package scala */ trait Product extends Any with Equals { /** The n^th^ element of this product, 0-based. In other words, for a - * product `A(x,,1,,, ..., x,,k,,)`, returns `x,,(n+1),, where `0 < n < k`. + * product `A(x,,1,,, ..., x,,k,,)`, returns `x,,(n+1),,` where `0 < n < k`. * * @param n the index of the element to return * @throws `IndexOutOfBoundsException` diff --git a/src/library/scala/Responder.scala b/src/library/scala/Responder.scala index 189d75a4ae..04c69bc330 100644 --- a/src/library/scala/Responder.scala +++ b/src/library/scala/Responder.scala @@ -21,9 +21,6 @@ package scala object Responder { /** Creates a responder that answer continuations with the constant `a`. - * - * @param x ... - * @return ... */ def constant[A](x: A) = new Responder[A] { def respond(k: A => Unit) = k(x) @@ -31,9 +28,6 @@ object Responder { /** Executes `x` and returns `'''true'''`, useful as syntactic * convenience in for comprehensions. - * - * @param x ... - * @return ... */ def exec[A](x: => Unit): Boolean = { x; true } diff --git a/src/library/scala/StringContext.scala b/src/library/scala/StringContext.scala index be9e0c290a..f400f18dab 100644 --- a/src/library/scala/StringContext.scala +++ b/src/library/scala/StringContext.scala @@ -132,7 +132,7 @@ object StringContext { * escape: `\\`, `\"`, `\'` * octal: `\d` `\dd` `\ddd` where `d` is an octal digit between `0` and `7`. * - * @param A string that may contain escape sequences + * @param str A string that may contain escape sequences * @return The string with all escape sequences expanded. */ def treatEscapes(str: String): String = { diff --git a/src/library/scala/annotation/elidable.scala b/src/library/scala/annotation/elidable.scala index 880b645daa..18be2450f5 100644 --- a/src/library/scala/annotation/elidable.scala +++ b/src/library/scala/annotation/elidable.scala @@ -18,18 +18,22 @@ import java.util.logging.Level * be omitted from generated code if the priority given the annotation * is lower than that given on the command line. * + * {{{ * @elidable(123) // annotation priority * scalac -Xelide-below 456 // command line priority - * + * }}} + * * The method call will be replaced with an expression which depends on * the type of the elided expression. In decreasing order of precedence: * + * {{{ * Unit () * Boolean false * T <: AnyVal 0 * T >: Null null * T >: Nothing Predef.??? - * + * }}} + * * Complete example: {{{ import annotation._, elidable._ diff --git a/src/library/scala/collection/BitSetLike.scala b/src/library/scala/collection/BitSetLike.scala index c0aaa9f28e..00cd63eb70 100644 --- a/src/library/scala/collection/BitSetLike.scala +++ b/src/library/scala/collection/BitSetLike.scala @@ -137,7 +137,7 @@ trait BitSetLike[+This <: BitSetLike[This] with SortedSet[Int]] extends SortedSe /** Computes the intersection between this bitset and another bitset by performing * a bitwise "and". - * @param that the bitset to intersect with. + * @param other the bitset to intersect with. * @return a new bitset consisting of all elements that are both in this * bitset and in the given bitset `other`. */ @@ -152,7 +152,7 @@ trait BitSetLike[+This <: BitSetLike[This] with SortedSet[Int]] extends SortedSe /** Computes the difference of this bitset and another bitset by performing * a bitwise "and-not". * - * @param that the set of bits to exclude. + * @param other the set of bits to exclude. * @return a bitset containing those bits of this * bitset that are not also contained in the given bitset `other`. */ @@ -167,7 +167,7 @@ trait BitSetLike[+This <: BitSetLike[This] with SortedSet[Int]] extends SortedSe /** Computes the symmetric difference of this bitset and another bitset by performing * a bitwise "exclusive-or". * - * @param that the other bitset to take part in the symmetric difference. + * @param other the other bitset to take part in the symmetric difference. * @return a bitset containing those bits of this * bitset or the other bitset that are not contained in both bitsets. */ @@ -184,7 +184,7 @@ trait BitSetLike[+This <: BitSetLike[This] with SortedSet[Int]] extends SortedSe /** Tests whether this bitset is a subset of another bitset. * - * @param that the bitset to test. + * @param other the bitset to test. * @return `true` if this bitset is a subset of `other`, i.e. if * every bit of this set is also an element in `other`. */ diff --git a/src/library/scala/collection/GenIterableLike.scala b/src/library/scala/collection/GenIterableLike.scala index 290a3b26b5..0fd9bac379 100644 --- a/src/library/scala/collection/GenIterableLike.scala +++ b/src/library/scala/collection/GenIterableLike.scala @@ -41,7 +41,7 @@ trait GenIterableLike[+A, +Repr] extends Any with GenTraversableLike[A, Repr] { /** Checks if the other iterable collection contains the same elements in the same order as this $coll. * * @param that the collection to compare with. - * @tparam B the type of the elements of collection `that`. + * @tparam A1 the type of the elements of collection `that`. * @return `true`, if both collections contain the same elements in the same order, `false` otherwise. * * @usecase def sameElements(that: GenIterable[A]): Boolean @@ -87,13 +87,13 @@ trait GenIterableLike[+A, +Repr] extends Any with GenTraversableLike[A, Repr] { * @tparam A1 the type of the first half of the returned pairs (this is always a supertype * of the collection's element type `A`). * @tparam That the class of the returned collection. Where possible, `That` is - * the same class as the current collection class `Repr`, but this - * depends on the element type `(A1, Int)` being admissible for that class, - * which means that an implicit instance of type `CanBuildFrom[Repr, (A1, Int), That]`. - * is found. - * @tparam bf an implicit value of class `CanBuildFrom` which determines the - * result class `That` from the current representation type `Repr` - * and the new element type `(A1, Int)`. + * the same class as the current collection class `Repr`, but this + * depends on the element type `(A1, Int)` being admissible for that class, + * which means that an implicit instance of type `CanBuildFrom[Repr, (A1, Int), That]`. + * is found. + * @param bf an implicit value of class `CanBuildFrom` which determines the + * result class `That` from the current representation type `Repr` + * and the new element type `(A1, Int)`. * @return A new collection of type `That` containing pairs consisting of all elements of this * $coll paired with their index. Indices start at `0`. * diff --git a/src/library/scala/collection/GenMapLike.scala b/src/library/scala/collection/GenMapLike.scala index d611eaea43..4dd2a4fe37 100644 --- a/src/library/scala/collection/GenMapLike.scala +++ b/src/library/scala/collection/GenMapLike.scala @@ -42,7 +42,6 @@ trait GenMapLike[A, +B, +Repr] extends GenIterableLike[(A, B), Repr] with Equals * otherwise the result of the `default` computation. * @usecase def getOrElse(key: A, default: => B): B * @inheritdoc - * @tparam B the result type of the default computation. */ def getOrElse[B1 >: B](key: A, default: => B1): B1 diff --git a/src/library/scala/collection/GenSeqLike.scala b/src/library/scala/collection/GenSeqLike.scala index fd7892c9f9..cfa0ca101e 100644 --- a/src/library/scala/collection/GenSeqLike.scala +++ b/src/library/scala/collection/GenSeqLike.scala @@ -413,8 +413,6 @@ trait GenSeqLike[+A, +Repr] extends Any with GenIterableLike[A, Repr] with Equal * * @param that the sequence of elements to remove * @tparam B the element type of the returned $coll. - * @tparam That $thatinfo - * @param bf $bfinfo * @return a new collection of type `That` which contains all elements of this $coll * except some of occurrences of elements that also appear in `that`. * If an element value `x` appears @@ -438,8 +436,6 @@ trait GenSeqLike[+A, +Repr] extends Any with GenIterableLike[A, Repr] with Equal * * @param that the sequence of elements to intersect with. * @tparam B the element type of the returned $coll. - * @tparam That $thatinfo - * @param bf $bfinfo * @return a new collection of type `That` which contains all elements of this $coll * which also appear in `that`. * If an element value `x` appears diff --git a/src/library/scala/collection/GenTraversableLike.scala b/src/library/scala/collection/GenTraversableLike.scala index df652f99d9..0d51230623 100644 --- a/src/library/scala/collection/GenTraversableLike.scala +++ b/src/library/scala/collection/GenTraversableLike.scala @@ -289,7 +289,7 @@ trait GenTraversableLike[+A, +Repr] extends Any with GenTraversableOnce[A] with /** Selects all elements of this $coll which satisfy a predicate. * - * @param p the predicate used to test elements. + * @param pred the predicate used to test elements. * @return a new $coll consisting of all elements of this $coll that satisfy the given * predicate `p`. Their order may not be preserved. */ @@ -297,7 +297,7 @@ trait GenTraversableLike[+A, +Repr] extends Any with GenTraversableOnce[A] with /** Selects all elements of this $coll which do not satisfy a predicate. * - * @param p the predicate used to test elements. + * @param pred the predicate used to test elements. * @return a new $coll consisting of all elements of this $coll that do not satisfy the given * predicate `p`. Their order may not be preserved. */ @@ -305,11 +305,11 @@ trait GenTraversableLike[+A, +Repr] extends Any with GenTraversableOnce[A] with /** Partitions this $coll in two ${coll}s according to a predicate. * - * @param p the predicate on which to partition. - * @return a pair of ${coll}s: the first $coll consists of all elements that - * satisfy the predicate `p` and the second $coll consists of all elements - * that don't. The relative order of the elements in the resulting ${coll}s - * may not be preserved. + * @param pred the predicate on which to partition. + * @return a pair of ${coll}s: the first $coll consists of all elements that + * satisfy the predicate `p` and the second $coll consists of all elements + * that don't. The relative order of the elements in the resulting ${coll}s + * may not be preserved. */ def partition(pred: A => Boolean): (Repr, Repr) @@ -354,8 +354,8 @@ trait GenTraversableLike[+A, +Repr] extends Any with GenTraversableOnce[A] with * }}} * $orderDependent * - * @param from the lowest index to include from this $coll. - * @param until the lowest index to EXCLUDE from this $coll. + * @param unc_from the lowest index to include from this $coll. + * @param unc_until the lowest index to EXCLUDE from this $coll. * @return a $coll containing the elements greater than or equal to * index `from` extending up to (but not including) index `until` * of this $coll. @@ -375,7 +375,7 @@ trait GenTraversableLike[+A, +Repr] extends Any with GenTraversableOnce[A] with /** Takes longest prefix of elements that satisfy a predicate. * $orderDependent - * @param p The predicate used to test elements. + * @param pred The predicate used to test elements. * @return the longest prefix of this $coll whose elements all satisfy * the predicate `p`. */ @@ -388,7 +388,7 @@ trait GenTraversableLike[+A, +Repr] extends Any with GenTraversableOnce[A] with * predicate `p` does not cause any side-effects. * $orderDependent * - * @param p the test predicate + * @param pred the test predicate * @return a pair consisting of the longest prefix of this $coll whose * elements all satisfy `p`, and the rest of this $coll. */ @@ -396,7 +396,7 @@ trait GenTraversableLike[+A, +Repr] extends Any with GenTraversableOnce[A] with /** Drops longest prefix of elements that satisfy a predicate. * $orderDependent - * @param p The predicate used to test elements. + * @param pred The predicate used to test elements. * @return the longest suffix of this $coll whose first element * does not satisfy the predicate `p`. */ diff --git a/src/library/scala/collection/GenTraversableOnce.scala b/src/library/scala/collection/GenTraversableOnce.scala index f4e3848d98..eab6b84ea8 100644 --- a/src/library/scala/collection/GenTraversableOnce.scala +++ b/src/library/scala/collection/GenTraversableOnce.scala @@ -312,7 +312,7 @@ trait GenTraversableOnce[+A] extends Any { * * @param num an implicit parameter defining a set of numeric operations * which includes the `+` operator to be used in forming the sum. - * @tparam B the result type of the `+` operator. + * @tparam A1 the result type of the `+` operator. * @return the sum of all elements of this $coll with respect to the `+` operator in `num`. * * @usecase def sum: A @@ -330,7 +330,7 @@ trait GenTraversableOnce[+A] extends Any { * * @param num an implicit parameter defining a set of numeric operations * which includes the `*` operator to be used in forming the product. - * @tparam B the result type of the `*` operator. + * @tparam A1 the result type of the `*` operator. * @return the product of all elements of this $coll with respect to the `*` operator in `num`. * * @usecase def product: A @@ -345,8 +345,8 @@ trait GenTraversableOnce[+A] extends Any { /** Finds the smallest element. * - * @param cmp An ordering to be used for comparing elements. - * @tparam B The type over which the ordering is defined. + * @param ord An ordering to be used for comparing elements. + * @tparam A1 The type over which the ordering is defined. * @return the smallest element of this $coll with respect to the ordering `cmp`. * * @usecase def min: A @@ -358,8 +358,8 @@ trait GenTraversableOnce[+A] extends Any { /** Finds the largest element. * - * @param cmp An ordering to be used for comparing elements. - * @tparam B The type over which the ordering is defined. + * @param ord An ordering to be used for comparing elements. + * @tparam A1 The type over which the ordering is defined. * @return the largest element of this $coll with respect to the ordering `cmp`. * * @usecase def max: A @@ -382,9 +382,9 @@ trait GenTraversableOnce[+A] extends Any { * $mayNotTerminateInf * $orderDependent * - * @param p the predicate used to test elements. - * @return an option value containing the first element in the $coll - * that satisfies `p`, or `None` if none exists. + * @param pred the predicate used to test elements. + * @return an option value containing the first element in the $coll + * that satisfies `p`, or `None` if none exists. */ def find(pred: A => Boolean): Option[A] @@ -459,9 +459,9 @@ trait GenTraversableOnce[+A] extends Any { /** Converts this $coll to an array. * - * @tparam B the type of the elements of the array. An `ArrayTag` for - * this type must be available. - * @return an array containing all elements of this $coll. + * @tparam A1 the type of the elements of the array. An `ArrayTag` for + * this type must be available. + * @return an array containing all elements of this $coll. * * @usecase def toArray: Array[A] * @inheritdoc diff --git a/src/library/scala/collection/IterableLike.scala b/src/library/scala/collection/IterableLike.scala index f4397f2167..0a5d9fc23c 100644 --- a/src/library/scala/collection/IterableLike.scala +++ b/src/library/scala/collection/IterableLike.scala @@ -166,13 +166,23 @@ self => * @see Iterator#sliding * * @param size the number of elements per group + * @return An iterator producing ${coll}s of size `size`, except the + * last and the only element will be truncated if there are + * fewer elements than size. + */ + def sliding(size: Int): Iterator[Repr] = sliding(size, 1) + + /** Groups elements in fixed size blocks by passing a "sliding window" + * over them (as opposed to partitioning them, as is done in grouped.) + * @see Iterator#sliding + * + * @param size the number of elements per group * @param step the distance between the first elements of successive * groups (defaults to 1) * @return An iterator producing ${coll}s of size `size`, except the * last and the only element will be truncated if there are * fewer elements than size. */ - def sliding(size: Int): Iterator[Repr] = sliding(size, 1) def sliding(size: Int, step: Int): Iterator[Repr] = for (xs <- iterator.sliding(size, step)) yield { val b = newBuilder diff --git a/src/library/scala/collection/MapLike.scala b/src/library/scala/collection/MapLike.scala index b2b687e75a..b9b8f62574 100644 --- a/src/library/scala/collection/MapLike.scala +++ b/src/library/scala/collection/MapLike.scala @@ -280,14 +280,14 @@ self => * * @usecase def + (kvs: (A, B)*): Map[A, B] * @inheritdoc - * @param the key/value pairs + * @param kvs the key/value pairs */ def + [B1 >: B] (kv1: (A, B1), kv2: (A, B1), kvs: (A, B1) *): Map[A, B1] = this + kv1 + kv2 ++ kvs /** Adds all key/value pairs in a traversable collection to this map, returning a new map. * - * @param kvs the collection containing the added key/value pairs + * @param xs the collection containing the added key/value pairs * @tparam B1 the type of the added values * @return a new map with the given bindings added to this map * diff --git a/src/library/scala/collection/SeqLike.scala b/src/library/scala/collection/SeqLike.scala index 044bd624ae..f64e1d780c 100644 --- a/src/library/scala/collection/SeqLike.scala +++ b/src/library/scala/collection/SeqLike.scala @@ -413,8 +413,6 @@ trait SeqLike[+A, +Repr] extends Any with IterableLike[A, Repr] with GenSeqLike[ * * @param that the sequence of elements to remove * @tparam B the element type of the returned $coll. - * @tparam That $thatinfo - * @param bf $bfinfo * @return a new collection of type `That` which contains all elements of this $coll * except some of occurrences of elements that also appear in `that`. * If an element value `x` appears @@ -444,8 +442,6 @@ trait SeqLike[+A, +Repr] extends Any with IterableLike[A, Repr] with GenSeqLike[ * * @param that the sequence of elements to intersect with. * @tparam B the element type of the returned $coll. - * @tparam That $thatinfo - * @param bf $bfinfo * @return a new collection of type `That` which contains all elements of this $coll * which also appear in `that`. * If an element value `x` appears diff --git a/src/library/scala/collection/TraversableOnce.scala b/src/library/scala/collection/TraversableOnce.scala index 639610a30c..d42c037dee 100644 --- a/src/library/scala/collection/TraversableOnce.scala +++ b/src/library/scala/collection/TraversableOnce.scala @@ -16,8 +16,6 @@ import language.{implicitConversions, higherKinds} * or one or more times. * $traversableonceinfo * - * @tparam A the element type of the collection - * * @author Martin Odersky * @author Paul Phillips * @version 2.8 diff --git a/src/library/scala/collection/convert/DecorateAsScala.scala b/src/library/scala/collection/convert/DecorateAsScala.scala index b170d8d139..539584b148 100644 --- a/src/library/scala/collection/convert/DecorateAsScala.scala +++ b/src/library/scala/collection/convert/DecorateAsScala.scala @@ -186,9 +186,9 @@ trait DecorateAsScala { * any side-effects of using it via the Scala interface will be visible via * the Java interface and vice versa. * - * @param m The `Dictionary` to be converted. - * @return An object with an `asScala` method that returns a Scala mutable - * `Map[String, String]` view of the argument. + * @param p The `Dictionary` to be converted. + * @return An object with an `asScala` method that returns a Scala mutable + * `Map[String, String]` view of the argument. */ implicit def dictionaryAsScalaMapConverter[A, B](p: ju.Dictionary[A, B]): AsScala[mutable.Map[A, B]] = new AsScala(dictionaryAsScalaMap(p)) @@ -200,9 +200,9 @@ trait DecorateAsScala { * any side-effects of using it via the Scala interface will be visible via * the Java interface and vice versa. * - * @param m The `Properties` to be converted. - * @return An object with an `asScala` method that returns a Scala mutable - * `Map[String, String]` view of the argument. + * @param p The `Properties` to be converted. + * @return An object with an `asScala` method that returns a Scala mutable + * `Map[String, String]` view of the argument. */ implicit def propertiesAsScalaMapConverter(p: ju.Properties): AsScala[mutable.Map[String, String]] = new AsScala(propertiesAsScalaMap(p)) diff --git a/src/library/scala/collection/convert/WrapAsJava.scala b/src/library/scala/collection/convert/WrapAsJava.scala index ecf91deb3a..fcfe402a68 100644 --- a/src/library/scala/collection/convert/WrapAsJava.scala +++ b/src/library/scala/collection/convert/WrapAsJava.scala @@ -24,8 +24,8 @@ trait WrapAsJava { * explicit call of `asIterator(java.util.Iterator)` then the original * Java Iterator will be returned. * - * @param i The Iterator to be converted. - * @return A Java Iterator view of the argument. + * @param it The Iterator to be converted. + * @return A Java Iterator view of the argument. */ implicit def asJavaIterator[A](it: Iterator[A]): ju.Iterator[A] = it match { case JIteratorWrapper(wrapped) => wrapped.asInstanceOf[ju.Iterator[A]] @@ -42,8 +42,8 @@ trait WrapAsJava { * explicit call of `asIterator(java.util.Enumeration)` then the * original Java Enumeration will be returned. * - * @param i The Iterator to be converted. - * @return A Java Enumeration view of the argument. + * @param it The Iterator to be converted. + * @return A Java Enumeration view of the argument. */ implicit def asJavaEnumeration[A](it: Iterator[A]): ju.Enumeration[A] = it match { case JEnumerationWrapper(wrapped) => wrapped.asInstanceOf[ju.Enumeration[A]] @@ -76,8 +76,8 @@ trait WrapAsJava { * explicit call of `asSizedIterable(java.util.Collection)` then the original * Java Collection will be returned. * - * @param i The SizedIterable to be converted. - * @return A Java Collection view of the argument. + * @param it The SizedIterable to be converted. + * @return A Java Collection view of the argument. */ implicit def asJavaCollection[A](it: Iterable[A]): ju.Collection[A] = it match { case JCollectionWrapper(wrapped) => wrapped.asInstanceOf[ju.Collection[A]] @@ -112,8 +112,8 @@ trait WrapAsJava { * explicit call of `asSeq(java.util.List)` then the original * Java List will be returned. * - * @param b The Seq to be converted. - * @return A Java List view of the argument. + * @param seq The Seq to be converted. + * @return A Java List view of the argument. */ implicit def mutableSeqAsJavaList[A](seq: mutable.Seq[A]): ju.List[A] = seq match { case JListWrapper(wrapped) => wrapped @@ -130,8 +130,8 @@ trait WrapAsJava { * explicit call of `asSeq(java.util.List)` then the original * Java List will be returned. * - * @param b The Seq to be converted. - * @return A Java List view of the argument. + * @param seq The Seq to be converted. + * @return A Java List view of the argument. */ implicit def seqAsJavaList[A](seq: Seq[A]): ju.List[A] = seq match { case JListWrapper(wrapped) => wrapped.asInstanceOf[ju.List[A]] diff --git a/src/library/scala/collection/convert/WrapAsScala.scala b/src/library/scala/collection/convert/WrapAsScala.scala index 14c64695ff..49f4d7cd99 100644 --- a/src/library/scala/collection/convert/WrapAsScala.scala +++ b/src/library/scala/collection/convert/WrapAsScala.scala @@ -25,8 +25,8 @@ trait WrapAsScala { * explicit call of `asIterator(scala.collection.Iterator)` then the * original Scala `Iterator` will be returned. * - * @param i The `Iterator` to be converted. - * @return A Scala `Iterator` view of the argument. + * @param it The `Iterator` to be converted. + * @return A Scala `Iterator` view of the argument. */ implicit def asScalaIterator[A](it: ju.Iterator[A]): Iterator[A] = it match { case IteratorWrapper(wrapped) => wrapped @@ -187,8 +187,8 @@ trait WrapAsScala { * `Dictionary` and any side-effects of using it via the Scala interface * will be visible via the Java interface and vice versa. * - * @param m The Dictionary to be converted. - * @return A Scala mutable Map[String, String] view of the argument. + * @param p The Dictionary to be converted. + * @return A Scala mutable Map[String, String] view of the argument. */ implicit def dictionaryAsScalaMap[A, B](p: ju.Dictionary[A, B]): mutable.Map[A, B] = p match { case DictionaryWrapper(wrapped) => wrapped @@ -202,8 +202,8 @@ trait WrapAsScala { * `Properties` and any side-effects of using it via the Scala interface * will be visible via the Java interface and vice versa. * - * @param m The Properties to be converted. - * @return A Scala mutable Map[String, String] view of the argument. + * @param p The Properties to be converted. + * @return A Scala mutable Map[String, String] view of the argument. */ implicit def propertiesAsScalaMap(p: ju.Properties): mutable.Map[String, String] = p match { case _ => new JPropertiesWrapper(p) diff --git a/src/library/scala/collection/generic/GenTraversableFactory.scala b/src/library/scala/collection/generic/GenTraversableFactory.scala index 94def7ab5d..2aaf93de05 100644 --- a/src/library/scala/collection/generic/GenTraversableFactory.scala +++ b/src/library/scala/collection/generic/GenTraversableFactory.scala @@ -201,8 +201,8 @@ abstract class GenTraversableFactory[CC[X] <: GenTraversable[X] with GenericTrav /** Produces a $coll containing a sequence of increasing of integers. * - * @param from the first element of the $coll - * @param end the end value of the $coll (the first value NOT contained) + * @param start the first element of the $coll + * @param end the end value of the $coll (the first value NOT contained) * @return a $coll with values `start, start + 1, ..., end - 1` */ def range[T: Integral](start: T, end: T): CC[T] = range(start, end, implicitly[Integral[T]].one) diff --git a/src/library/scala/collection/generic/GenericTraversableTemplate.scala b/src/library/scala/collection/generic/GenericTraversableTemplate.scala index 69eab43150..7cb0e812d8 100644 --- a/src/library/scala/collection/generic/GenericTraversableTemplate.scala +++ b/src/library/scala/collection/generic/GenericTraversableTemplate.scala @@ -73,8 +73,8 @@ trait GenericTraversableTemplate[+A, +CC[X] <: GenTraversable[X]] extends HasNew /** Converts this $coll of pairs into two collections of the first and second * half of each pair. * - * @param A1 the type of the first half of the element pairs - * @param A2 the type of the second half of the element pairs + * @tparam A1 the type of the first half of the element pairs + * @tparam A2 the type of the second half of the element pairs * @param asPair an implicit conversion which asserts that the element type * of this $coll is a pair. * @return a pair ${coll}s, containing the first, respectively second @@ -94,9 +94,9 @@ trait GenericTraversableTemplate[+A, +CC[X] <: GenTraversable[X]] extends HasNew /** Converts this $coll of triples into three collections of the first, second, * and third element of each triple. * - * @param A1 the type of the first member of the element triples - * @param A2 the type of the second member of the element triples - * @param A3 the type of the third member of the element triples + * @tparam A1 the type of the first member of the element triples + * @tparam A2 the type of the second member of the element triples + * @tparam A3 the type of the third member of the element triples * @param asTriple an implicit conversion which asserts that the element type * of this $coll is a triple. * @return a triple ${coll}s, containing the first, second, respectively diff --git a/src/library/scala/collection/generic/Growable.scala b/src/library/scala/collection/generic/Growable.scala index d6a263af2f..730cb18733 100644 --- a/src/library/scala/collection/generic/Growable.scala +++ b/src/library/scala/collection/generic/Growable.scala @@ -42,7 +42,7 @@ trait Growable[-A] extends Clearable { /** ${Add}s all elements produced by a TraversableOnce to this $coll. * - * @param iter the TraversableOnce producing the elements to $add. + * @param xs the TraversableOnce producing the elements to $add. * @return the $coll itself. */ def ++=(xs: TraversableOnce[A]): this.type = { xs.seq foreach += ; this } diff --git a/src/library/scala/collection/generic/Shrinkable.scala b/src/library/scala/collection/generic/Shrinkable.scala index 0c9dafefb1..593cd0f58e 100644 --- a/src/library/scala/collection/generic/Shrinkable.scala +++ b/src/library/scala/collection/generic/Shrinkable.scala @@ -43,7 +43,7 @@ trait Shrinkable[-A] { /** Removes all elements produced by an iterator from this $coll. * - * @param iter the iterator producing the elements to remove. + * @param xs the iterator producing the elements to remove. * @return the $coll itself */ def --=(xs: TraversableOnce[A]): this.type = { xs.seq foreach -= ; this } diff --git a/src/library/scala/collection/generic/Sorted.scala b/src/library/scala/collection/generic/Sorted.scala index ed9e11fd30..42eca72806 100644 --- a/src/library/scala/collection/generic/Sorted.scala +++ b/src/library/scala/collection/generic/Sorted.scala @@ -62,8 +62,6 @@ trait Sorted[K, +This <: Sorted[K, This]] { * and an upper-bound. * * @param from The upper-bound (exclusive) of the ranged projection. - * @param until ... - * @return ... */ def range(from: K, until: K): This = rangeImpl(Some(from), Some(until)) diff --git a/src/library/scala/collection/generic/Subtractable.scala b/src/library/scala/collection/generic/Subtractable.scala index cda71c0291..aed4f4f7da 100644 --- a/src/library/scala/collection/generic/Subtractable.scala +++ b/src/library/scala/collection/generic/Subtractable.scala @@ -52,7 +52,7 @@ trait Subtractable[A, +Repr <: Subtractable[A, Repr]] { self => /** Creates a new $coll from this $coll by removing all elements of another * collection. * - * @param elems the collection containing the removed elements. + * @param xs the collection containing the removed elements. * @return a new $coll that contains all elements of the current $coll * except one less occurrence of each of the elements of `elems`. */ diff --git a/src/library/scala/collection/immutable/List.scala b/src/library/scala/collection/immutable/List.scala index b4c22c3b6c..6fd8d143ee 100644 --- a/src/library/scala/collection/immutable/List.scala +++ b/src/library/scala/collection/immutable/List.scala @@ -511,7 +511,7 @@ object List extends SeqFactory[List] { /** Transforms an Iterable of Eithers into a pair of lists. * - * @param xs the iterable of Eithers to separate + * @param es the iterable of Eithers to separate * @return a pair of lists. */ @deprecated("use `(for (Left(x) <- es) yield x, for (Right(x) <- es) yield x)` instead", "2.8.0") @@ -582,7 +582,7 @@ object List extends SeqFactory[List] { /** Tests whether the given predicate `p` holds * for all corresponding elements of the argument lists. * - * @param p function to apply to each pair of elements. + * @param f function to apply to each pair of elements. * @return `(p(a<sub>0</sub>,b<sub>0</sub>) && * ... && p(a<sub>n</sub>,b<sub>n</sub>))]` * if the lists are `[a<sub>0</sub>, ..., a<sub>k</sub>]`; @@ -604,7 +604,7 @@ object List extends SeqFactory[List] { /** Tests whether the given predicate `p` holds * for some corresponding elements of the argument lists. * - * @param p function to apply to each pair of elements. + * @param f function to apply to each pair of elements. * @return `n != 0 && (p(a<sub>0</sub>,b<sub>0</sub>) || * ... || p(a<sub>n</sub>,b<sub>n</sub>))]` if the lists are * `[a<sub>0</sub>, ..., a<sub>k</sub>]`, diff --git a/src/library/scala/collection/immutable/ListMap.scala b/src/library/scala/collection/immutable/ListMap.scala index 9289b35632..091443f909 100644 --- a/src/library/scala/collection/immutable/ListMap.scala +++ b/src/library/scala/collection/immutable/ListMap.scala @@ -152,7 +152,7 @@ extends AbstractMap[A, B] * method throws an exception if there is no mapping from the given * key to a value. * - * @param key the key + * @param k the key * @return the value associated with the given key. */ override def apply(k: A): B1 = apply0(this, k) @@ -162,7 +162,7 @@ extends AbstractMap[A, B] /** Checks if this map maps `key` to a value and return the * value if it exists. * - * @param key the key of the mapping of interest + * @param k the key of the mapping of interest * @return the value of the mapping, if it exists */ override def get(k: A): Option[B1] = get0(this, k) @@ -174,9 +174,6 @@ extends AbstractMap[A, B] /** This method allows one to create a new map with an additional mapping * from `key` to `value`. If the map contains already a mapping for `key`, * it will be overridden by this function. - * - * @param k ... - * @param v ... */ override def updated [B2 >: B1](k: A, v: B2): ListMap[A, B2] = { val m = if (contains(k)) this - k else this @@ -186,9 +183,6 @@ extends AbstractMap[A, B] /** Creates a new mapping without the given `key`. * If the map does not contain a mapping for the given key, the * method returns the same map. - * - * @param k ... - * @return ... */ override def - (k: A): ListMap[A, B1] = { // This definition used to result in stack overflows diff --git a/src/library/scala/collection/immutable/ListSet.scala b/src/library/scala/collection/immutable/ListSet.scala index 0331e01f35..ce3abaacb7 100644 --- a/src/library/scala/collection/immutable/ListSet.scala +++ b/src/library/scala/collection/immutable/ListSet.scala @@ -157,7 +157,7 @@ class ListSet[A] extends AbstractSet[A] /** Checks if this set contains element `elem`. * - * @param elem the element to check for membership. + * @param e the element to check for membership. * @return `'''true'''`, iff `elem` is contained in this set. */ override def contains(e: A) = containsInternal(this, e) diff --git a/src/library/scala/collection/immutable/MapLike.scala b/src/library/scala/collection/immutable/MapLike.scala index 84c87b4eae..6ae2d78188 100644 --- a/src/library/scala/collection/immutable/MapLike.scala +++ b/src/library/scala/collection/immutable/MapLike.scala @@ -35,9 +35,9 @@ import parallel.immutable.ParMap * It is also good idea to override methods `foreach` and * `size` for efficiency. * - * @param A the type of the keys contained in this collection. - * @param B the type of the values associated with the keys. - * @param This The type of the actual map implementation. + * @tparam A the type of the keys contained in this collection. + * @tparam B the type of the values associated with the keys. + * @tparam This The type of the actual map implementation. * * @author Martin Odersky * @version 2.8 diff --git a/src/library/scala/collection/immutable/Stack.scala b/src/library/scala/collection/immutable/Stack.scala index c63c1ce232..473ac6b0b0 100644 --- a/src/library/scala/collection/immutable/Stack.scala +++ b/src/library/scala/collection/immutable/Stack.scala @@ -84,7 +84,7 @@ class Stack[+A] protected (protected val elems: List[A]) * the stack. The last element returned by the traversable object * will be on top of the new stack. * - * @param elems the iterator object. + * @param xs the iterator object. * @return the stack with the new elements on top. */ def pushAll[B >: A](xs: TraversableOnce[B]): Stack[B] = diff --git a/src/library/scala/collection/immutable/Stream.scala b/src/library/scala/collection/immutable/Stream.scala index f3e7214c5f..9f5f98ddf4 100644 --- a/src/library/scala/collection/immutable/Stream.scala +++ b/src/library/scala/collection/immutable/Stream.scala @@ -716,8 +716,8 @@ self => /** A substream starting at index `from` and extending up to (but not including) * index `until`. This returns a `Stream` that is lazily evaluated. * - * @param start The index of the first element of the returned subsequence - * @param end The index of the element following the returned subsequence + * @param from The index of the first element of the returned subsequence + * @param until The index of the element following the returned subsequence * @return A new string containing the elements requested from `start` until * `end`. * diff --git a/src/library/scala/collection/immutable/StringLike.scala b/src/library/scala/collection/immutable/StringLike.scala index d1605bf637..e41b17a5e8 100644 --- a/src/library/scala/collection/immutable/StringLike.scala +++ b/src/library/scala/collection/immutable/StringLike.scala @@ -274,7 +274,7 @@ self => * `scala.BigDecimal`) are unwrapped to pass a type which `Formatter` * understands. * - * @param locale an instance of `java.util.Locale` + * @param l an instance of `java.util.Locale` * @param args the arguments used to instantiating the pattern. * @throws `java.lang.IllegalArgumentException` */ diff --git a/src/library/scala/collection/mutable/ArrayOps.scala b/src/library/scala/collection/mutable/ArrayOps.scala index 57e81fdb9c..0807721f7d 100644 --- a/src/library/scala/collection/mutable/ArrayOps.scala +++ b/src/library/scala/collection/mutable/ArrayOps.scala @@ -61,7 +61,7 @@ abstract class ArrayOps[T] extends ArrayLike[T, Array[T]] with CustomParalleliza * into a single array. * * @tparam U Type of row elements. - * @param asArray A function that converts elements of this array to rows - arrays of type `U`. + * @param asTrav A function that converts elements of this array to rows - arrays of type `U`. * @return An array obtained by concatenating rows of this array. */ def flatten[U, To](implicit asTrav: T => collection.Traversable[U], m: ArrayTag[U]): Array[U] = { diff --git a/src/library/scala/collection/mutable/ArrayStack.scala b/src/library/scala/collection/mutable/ArrayStack.scala index 04a318d0c3..ed5f39f21b 100644 --- a/src/library/scala/collection/mutable/ArrayStack.scala +++ b/src/library/scala/collection/mutable/ArrayStack.scala @@ -152,7 +152,7 @@ extends AbstractSeq[T] /** Pushes all the provided elements in the traversable object onto the stack. * - * @param x The source of elements to push. + * @param xs The source of elements to push. * @return A reference to this stack. */ override def ++=(xs: TraversableOnce[T]): this.type = { xs.seq foreach += ; this } diff --git a/src/library/scala/collection/mutable/BufferProxy.scala b/src/library/scala/collection/mutable/BufferProxy.scala index aa1b20d240..db3b039461 100644 --- a/src/library/scala/collection/mutable/BufferProxy.scala +++ b/src/library/scala/collection/mutable/BufferProxy.scala @@ -77,7 +77,7 @@ trait BufferProxy[A] extends Buffer[A] with Proxy { /** Prepend an element to this list. * - * @param elem the element to prepend. + * @param elems the elements to prepend. */ override def prepend(elems: A*) { self.prependAll(elems) } diff --git a/src/library/scala/collection/mutable/IndexedSeqLike.scala b/src/library/scala/collection/mutable/IndexedSeqLike.scala index 4bd5ea1e89..2ff7ac8272 100644 --- a/src/library/scala/collection/mutable/IndexedSeqLike.scala +++ b/src/library/scala/collection/mutable/IndexedSeqLike.scala @@ -43,7 +43,7 @@ trait IndexedSeqLike[A, +Repr] extends scala.collection.IndexedSeqLike[A, Repr] /** Replaces element at given index with a new value. * - * @param n the index of the element to replace. + * @param idx the index of the element to replace. * @param elem the new value. * @throws IndexOutOfBoundsException if the index is not valid. */ diff --git a/src/library/scala/collection/mutable/ListBuffer.scala b/src/library/scala/collection/mutable/ListBuffer.scala index 5c580f9c09..cd743999bc 100644 --- a/src/library/scala/collection/mutable/ListBuffer.scala +++ b/src/library/scala/collection/mutable/ListBuffer.scala @@ -208,7 +208,7 @@ final class ListBuffer[A] * one. Instead, it will insert a new element at index `n`. * * @param n the index where a new element will be inserted. - * @param iter the iterable object providing all elements to insert. + * @param seq the iterable object providing all elements to insert. * @throws Predef.IndexOutOfBoundsException if `n` is out of bounds. */ def insertAll(n: Int, seq: Traversable[A]) { @@ -338,8 +338,8 @@ final class ListBuffer[A] /** Remove a single element from this buffer. May take time linear in the * buffer size. * - * @param x the element to remove. - * @return this $coll. + * @param elem the element to remove. + * @return this $coll. */ override def -= (elem: A): this.type = { if (exported) copy() diff --git a/src/library/scala/collection/mutable/QueueProxy.scala b/src/library/scala/collection/mutable/QueueProxy.scala index df86545a70..fb76fa609f 100644 --- a/src/library/scala/collection/mutable/QueueProxy.scala +++ b/src/library/scala/collection/mutable/QueueProxy.scala @@ -49,7 +49,7 @@ trait QueueProxy[A] extends Queue[A] with Proxy { /** Adds all elements provided by an iterator at the end of the queue. The * elements are prepended in the order they are given out by the iterator. * - * @param iter an iterator + * @param it an iterator */ override def ++=(it: TraversableOnce[A]): this.type = { self ++= it diff --git a/src/library/scala/collection/mutable/SeqLike.scala b/src/library/scala/collection/mutable/SeqLike.scala index 7194f15bc2..3a77558e94 100644 --- a/src/library/scala/collection/mutable/SeqLike.scala +++ b/src/library/scala/collection/mutable/SeqLike.scala @@ -28,8 +28,8 @@ trait SeqLike[A, +This <: SeqLike[A, This] with Seq[A]] /** Replaces element at given index with a new value. * - * @param n the index of the element to replace. - * @param lem the new value. + * @param idx the index of the element to replace. + * @param elem the new value. * @throws IndexOutOfBoundsException if the index is not valid. */ def update(idx: Int, elem: A) diff --git a/src/library/scala/collection/mutable/SynchronizedBuffer.scala b/src/library/scala/collection/mutable/SynchronizedBuffer.scala index a14605d60a..1c34046e88 100644 --- a/src/library/scala/collection/mutable/SynchronizedBuffer.scala +++ b/src/library/scala/collection/mutable/SynchronizedBuffer.scala @@ -61,7 +61,7 @@ trait SynchronizedBuffer[A] extends Buffer[A] { /** Appends a number of elements provided by a traversable object * via its `foreach` method. * - * @param iter the iterable object. + * @param xs the iterable object. */ override def ++=(xs: TraversableOnce[A]): this.type = synchronized[this.type] { super.++=(xs) @@ -102,7 +102,7 @@ trait SynchronizedBuffer[A] extends Buffer[A] { /** Prepend an element to this list. * - * @param elem the element to prepend. + * @param elems the elements to prepend. */ override def prepend(elems: A*): Unit = prependAll(elems) diff --git a/src/library/scala/collection/parallel/ParIterableLike.scala b/src/library/scala/collection/parallel/ParIterableLike.scala index 4cb229fc0f..321f259f5d 100644 --- a/src/library/scala/collection/parallel/ParIterableLike.scala +++ b/src/library/scala/collection/parallel/ParIterableLike.scala @@ -491,8 +491,8 @@ self: ParIterableLike[T, Repr, Sequential] => * * $abortsignalling * - * @param p a predicate used to test elements - * @return true if `p` holds for all elements, false otherwise + * @param pred a predicate used to test elements + * @return true if `p` holds for all elements, false otherwise */ def forall(pred: T => Boolean): Boolean = { tasksupport.executeAndWaitResult(new Forall(pred, splitter assign new DefaultSignalling with VolatileAbort)) @@ -502,8 +502,8 @@ self: ParIterableLike[T, Repr, Sequential] => * * $abortsignalling * - * @param p a predicate used to test elements - * @return true if `p` holds for some element, false otherwise + * @param pred a predicate used to test elements + * @return true if `p` holds for some element, false otherwise */ def exists(pred: T => Boolean): Boolean = { tasksupport.executeAndWaitResult(new Exists(pred, splitter assign new DefaultSignalling with VolatileAbort)) @@ -517,8 +517,8 @@ self: ParIterableLike[T, Repr, Sequential] => * * $abortsignalling * - * @param p predicate used to test the elements - * @return an option value with the element if such an element exists, or `None` otherwise + * @param pred predicate used to test the elements + * @return an option value with the element if such an element exists, or `None` otherwise */ def find(pred: T => Boolean): Option[T] = { tasksupport.executeAndWaitResult(new Find(pred, splitter assign new DefaultSignalling with VolatileAbort)) @@ -685,7 +685,7 @@ self: ParIterableLike[T, Repr, Sequential] => * @tparam That type of the resulting collection * @param z neutral element for the operator `op` * @param op the associative operator for the scan - * @param cbf combiner factory which provides a combiner + * @param bf $bfinfo * @return a collection containing the prefix scan of the elements in the original collection * * @usecase def scan(z: T)(op: (T, T) => T): $Coll[T] diff --git a/src/library/scala/collection/parallel/ParSeqLike.scala b/src/library/scala/collection/parallel/ParSeqLike.scala index b3c527da84..be5ab03ba7 100644 --- a/src/library/scala/collection/parallel/ParSeqLike.scala +++ b/src/library/scala/collection/parallel/ParSeqLike.scala @@ -162,7 +162,7 @@ self => * * $abortsignalling * - * @tparam U the element type of `that` parallel sequence + * @tparam S the element type of `that` parallel sequence * @param that the parallel sequence this sequence is being searched for * @param offset the starting offset for the search * @return `true` if there is a sequence `that` starting at `offset` in this sequence, `false` otherwise @@ -287,9 +287,7 @@ self => /** Computes the multiset intersection between this $coll and another sequence. * * @param that the sequence of elements to intersect with. - * @tparam B the element type of the returned $coll. - * @tparam That $thatinfo - * @param bf $bfinfo + * @tparam U the element type of `that` parallel sequence * @return a new collection of type `That` which contains all elements of this $coll * which also appear in `that`. * If an element value `x` appears diff --git a/src/library/scala/collection/parallel/RemainsIterator.scala b/src/library/scala/collection/parallel/RemainsIterator.scala index c5910ff2c8..a67a4d8eb7 100644 --- a/src/library/scala/collection/parallel/RemainsIterator.scala +++ b/src/library/scala/collection/parallel/RemainsIterator.scala @@ -39,8 +39,7 @@ private[collection] trait RemainsIterator[+T] extends Iterator[T] { /** Augments iterators with additional methods, mostly transformers, * assuming they iterate an iterable collection. * - * @param T type of the elements iterated. - * @param IterRepr iterator type. + * @tparam T type of the elements iterated. */ private[collection] trait AugmentedIterableIterator[+T] extends RemainsIterator[T] { @@ -377,7 +376,7 @@ private[collection] trait AugmentedSeqIterator[+T] extends AugmentedIterableIter /** Parallel iterators allow splitting and provide a `remaining` method to * obtain the number of elements remaining in the iterator. * - * @param T type of the elements iterated. + * @tparam T type of the elements iterated. */ trait IterableSplitter[+T] extends AugmentedIterableIterator[T] @@ -537,7 +536,7 @@ self => /** Parallel sequence iterators allow splitting into arbitrary subsets. * - * @param T type of the elements iterated. + * @tparam T type of the elements iterated. */ trait SeqSplitter[+T] extends IterableSplitter[T] diff --git a/src/library/scala/collection/parallel/mutable/ParHashMap.scala b/src/library/scala/collection/parallel/mutable/ParHashMap.scala index 05b3f89fa1..8d39d6e0de 100644 --- a/src/library/scala/collection/parallel/mutable/ParHashMap.scala +++ b/src/library/scala/collection/parallel/mutable/ParHashMap.scala @@ -26,7 +26,8 @@ import collection.parallel.Task * `ParHashMap` is a parallel map which internally keeps elements within a hash table. * It uses chaining to resolve collisions. * - * @tparam T type of the elements in the parallel hash map + * @tparam K type of the keys in the parallel hash map + * @tparam V type of the values in the parallel hash map * * @define Coll `ParHashMap` * @define coll parallel hash map diff --git a/src/library/scala/concurrent/Channel.scala b/src/library/scala/concurrent/Channel.scala index f6d6341151..7aeccd8d05 100644 --- a/src/library/scala/concurrent/Channel.scala +++ b/src/library/scala/concurrent/Channel.scala @@ -25,7 +25,6 @@ class Channel[A] { private var nreaders = 0 /** - * @param x ... */ def write(x: A) = synchronized { lastWritten.elem = x diff --git a/src/library/scala/concurrent/Future.scala b/src/library/scala/concurrent/Future.scala index 496e4698d4..2f90afe056 100644 --- a/src/library/scala/concurrent/Future.scala +++ b/src/library/scala/concurrent/Future.scala @@ -191,7 +191,7 @@ trait Future[+T] extends Awaitable[T] { * this future. If this future is completed with an exception then the new * future will also contain this exception. * - * $forComprehensionExample + * $forComprehensionExamples */ def map[S](f: T => S): Future[S] = { val p = Promise[S]() @@ -213,7 +213,7 @@ trait Future[+T] extends Awaitable[T] { * If this future is completed with an exception then the new future will * also contain this exception. * - * $forComprehensionExample + * $forComprehensionExamples */ def flatMap[S](f: T => Future[S]): Future[S] = { val p = Promise[S]() diff --git a/src/library/scala/concurrent/Promise.scala b/src/library/scala/concurrent/Promise.scala index f7ec0714cf..2e9de4a0d0 100644 --- a/src/library/scala/concurrent/Promise.scala +++ b/src/library/scala/concurrent/Promise.scala @@ -66,7 +66,7 @@ trait Promise[T] { /** Completes the promise with a value. * - * @param value The value to complete the promise with. + * @param v The value to complete the promise with. * * $promiseCompletion */ @@ -106,7 +106,7 @@ object Promise { /** Creates a promise object which can be completed with a value. * * @tparam T the type of the value in the promise - * @param execctx the execution context on which the promise is created on + * @param executor the execution context on which the promise is created on * @return the newly created `Promise` object */ def apply[T]()(implicit executor: ExecutionContext): Promise[T] = new impl.Promise.DefaultPromise[T]() @@ -114,7 +114,7 @@ object Promise { /** Creates an already completed Promise with the specified exception. * * @tparam T the type of the value in the promise - * @param execctx the execution context on which the promise is created on + * @param executor the execution context on which the promise is created on * @return the newly created `Promise` object */ def failed[T](exception: Throwable)(implicit executor: ExecutionContext): Promise[T] = new impl.Promise.KeptPromise[T](Left(exception)) @@ -122,7 +122,7 @@ object Promise { /** Creates an already completed Promise with the specified result. * * @tparam T the type of the value in the promise - * @param execctx the execution context on which the promise is created on + * @param executor the execution context on which the promise is created on * @return the newly created `Promise` object */ def successful[T](result: T)(implicit executor: ExecutionContext): Promise[T] = new impl.Promise.KeptPromise[T](Right(result)) diff --git a/src/library/scala/concurrent/Scheduler.scala b/src/library/scala/concurrent/Scheduler.scala index e2eb4d69fe..6645abcc4e 100644 --- a/src/library/scala/concurrent/Scheduler.scala +++ b/src/library/scala/concurrent/Scheduler.scala @@ -35,7 +35,7 @@ trait Scheduler { /** Schedules a thunk for execution after a given delay. * * @param delay the duration after which the thunk should be executed - * @param thunk the thunk that is scheduled for execution + * @param task the thunk that is scheduled for execution * @return a `Cancellable` that may be used to cancel the execution * of the thunk */ diff --git a/src/library/scala/io/Source.scala b/src/library/scala/io/Source.scala index 5e09e13680..319e021f04 100644 --- a/src/library/scala/io/Source.scala +++ b/src/library/scala/io/Source.scala @@ -100,8 +100,6 @@ object Source { /** Create a `Source` from array of bytes, decoding * the bytes according to codec. * - * @param bytes ... - * @param enc ... * @return the created `Source` instance. */ def fromBytes(bytes: Array[Byte])(implicit codec: Codec): Source = diff --git a/src/library/scala/math/BigInt.scala b/src/library/scala/math/BigInt.scala index ff52ca9bec..af2ab04576 100644 --- a/src/library/scala/math/BigInt.scala +++ b/src/library/scala/math/BigInt.scala @@ -71,11 +71,7 @@ object BigInt { new BigInt(new BigInteger(bitlength, certainty, rnd.self)) /** Constructs a randomly generated BigInt, uniformly distributed over the - * range 0 to (2 ^ numBits - 1), inclusive. - * - * @param numbits ... - * @param rnd ... - * @return ... + * range `0` to `(2 ^ numBits - 1)`, inclusive. */ def apply(numbits: Int, rnd: scala.util.Random): BigInt = new BigInt(new BigInteger(numbits, rnd.self)) @@ -87,10 +83,6 @@ object BigInt { /** Translates the string representation of a `BigInt` in the * specified `radix` into a BigInt. - * - * @param x ... - * @param radix ... - * @return ... */ def apply(x: String, radix: Int): BigInt = new BigInt(new BigInteger(x, radix)) diff --git a/src/library/scala/parallel/Future.scala b/src/library/scala/parallel/Future.scala index f61d376093..8b71794756 100644 --- a/src/library/scala/parallel/Future.scala +++ b/src/library/scala/parallel/Future.scala @@ -12,6 +12,8 @@ package scala.parallel /** A future is a function without parameters that will block the caller if * the parallel computation associated with the function is not completed. + * + * @tparam R the type of the result * * @since 2.9 */ @@ -23,7 +25,6 @@ trait Future[@specialized +R] extends (() => R) { * '''Note:''' creating a circular dependency between futures by calling * this method will result in a deadlock. * - * @tparam R the type of the result * @return the result * @throws the exception that was thrown during a parallel computation */ diff --git a/src/library/scala/reflect/api/Trees.scala b/src/library/scala/reflect/api/Trees.scala index ca4e60f3f6..3427136fde 100644 --- a/src/library/scala/reflect/api/Trees.scala +++ b/src/library/scala/reflect/api/Trees.scala @@ -727,7 +727,7 @@ trait Trees { self: Universe => def Ident(sym: Symbol): Ident /** Marks underlying reference to id as boxed. - * @pre: id must refer to a captured variable + * @pre id must refer to a captured variable * A reference such marked will refer to the boxed entity, no dereferencing * with `.elem` is done on it. * This tree node can be emitted by macros such as reify that call referenceCapturedVariable. diff --git a/src/library/scala/reflect/api/Types.scala b/src/library/scala/reflect/api/Types.scala index 5c7563c2c5..3d42242641 100755 --- a/src/library/scala/reflect/api/Types.scala +++ b/src/library/scala/reflect/api/Types.scala @@ -111,10 +111,12 @@ trait Types { self: Universe => * Proceed analogously for thistypes referring to outer classes. * * Example: + * {{{ * class D[T] { def m: T } * class C extends p.D[Int] * T.asSeenFrom(ThisType(C), D) (where D is owner of m) * = Int + * }}} */ def asSeenFrom(pre: Type, clazz: Symbol): Type @@ -481,10 +483,6 @@ trait Types { self: Universe => def refinedType(parents: List[Type], owner: Symbol, decls: Scope, pos: Position): Type /** The canonical creator for a refined type with an initially empty scope. - * - * @param parents ... - * @param owner ... - * @return ... */ def refinedType(parents: List[Type], owner: Symbol): Type diff --git a/src/library/scala/reflect/api/Universe.scala b/src/library/scala/reflect/api/Universe.scala index 9670780522..05b5963c73 100755 --- a/src/library/scala/reflect/api/Universe.scala +++ b/src/library/scala/reflect/api/Universe.scala @@ -28,18 +28,23 @@ abstract class Universe extends Symbols * * For instance, given the abstract syntax tree representation of the <[ x + 1 ]> expression: * + * {{{ * Apply(Select(Ident("x"), "+"), List(Literal(Constant(1)))) + * }}} * * The reifier transforms it to the following expression: - * + * + * {{{ * <[ * val $mr: scala.reflect.api.Universe = <reference to the Universe that calls the reify> * $mr.Expr[Int]($mr.Apply($mr.Select($mr.Ident($mr.newFreeVar("x", <Int>, x), "+"), List($mr.Literal($mr.Constant(1)))))) * ]> + * }}} * * Reification performs expression splicing (when processing Expr.eval and Expr.value) * and type splicing (for every type T that has a TypeTag[T] implicit in scope): * + * {{{ * val two = mirror.reify(2) // Literal(Constant(2)) * val four = mirror.reify(two.eval + two.eval) // Apply(Select(two.tree, newTermName("$plus")), List(two.tree)) * @@ -51,6 +56,7 @@ abstract class Universe extends Symbols * val factory = c.reify{ new Queryable[T] } * ... * } + * }}} * * The transformation looks mostly straightforward, but it has its tricky parts: * * Reifier retains symbols and types defined outside the reified tree, however diff --git a/src/library/scala/runtime/RichDouble.scala b/src/library/scala/runtime/RichDouble.scala index f702b9e3da..396323d1e8 100644 --- a/src/library/scala/runtime/RichDouble.scala +++ b/src/library/scala/runtime/RichDouble.scala @@ -18,14 +18,12 @@ final class RichDouble(val self: Double) extends FractionalProxy[Double] { /** Converts an angle measured in degrees to an approximately equivalent * angle measured in radians. * - * @param x an angle, in degrees * @return the measurement of the angle x in radians. */ def toRadians: Double = math.toRadians(self) /** Converts an angle measured in radians to an approximately equivalent * angle measured in degrees. - * @param x angle, in radians * @return the measurement of the angle x in degrees. */ def toDegrees: Double = math.toDegrees(self) diff --git a/src/library/scala/runtime/RichFloat.scala b/src/library/scala/runtime/RichFloat.scala index 6b72a9dd55..4fc9e8864a 100644 --- a/src/library/scala/runtime/RichFloat.scala +++ b/src/library/scala/runtime/RichFloat.scala @@ -18,7 +18,6 @@ final class RichFloat(val self: Float) extends FractionalProxy[Float] { /** Converts an angle measured in degrees to an approximately equivalent * angle measured in radians. * - * @param x an angle, in degrees * @return the measurement of the angle `x` in radians. */ def toRadians: Float = math.toRadians(self).toFloat @@ -26,7 +25,6 @@ final class RichFloat(val self: Float) extends FractionalProxy[Float] { /** Converts an angle measured in radians to an approximately equivalent * angle measured in degrees. * - * @param x angle, in radians * @return the measurement of the angle `x` in degrees. */ def toDegrees: Float = math.toDegrees(self).toFloat diff --git a/src/library/scala/sys/Prop.scala b/src/library/scala/sys/Prop.scala index 33b88f119f..687a32cf7d 100644 --- a/src/library/scala/sys/Prop.scala +++ b/src/library/scala/sys/Prop.scala @@ -38,7 +38,7 @@ trait Prop[+T] { /** Sets the property. * - * @param the new string value + * @param newValue the new string value * @return the old value, or null if it was unset. */ def set(newValue: String): String diff --git a/src/library/scala/sys/package.scala b/src/library/scala/sys/package.scala index 16faded419..b27da8e61d 100644 --- a/src/library/scala/sys/package.scala +++ b/src/library/scala/sys/package.scala @@ -69,8 +69,8 @@ package object sys { * * Note that shutdown hooks are NOT guaranteed to be run. * - * @param the body of code to run at shutdown - * @return the Thread which will run the shutdown hook. + * @param body the body of code to run at shutdown + * @return the Thread which will run the shutdown hook. */ def addShutdownHook(body: => Unit): ShutdownHookThread = ShutdownHookThread(body) diff --git a/src/library/scala/testing/Benchmark.scala b/src/library/scala/testing/Benchmark.scala index c8e31766ea..9acae34d4e 100644 --- a/src/library/scala/testing/Benchmark.scala +++ b/src/library/scala/testing/Benchmark.scala @@ -49,9 +49,6 @@ trait Benchmark { /** Run the benchmark the specified number of times and return a list with * the execution times in milliseconds in reverse order of the execution. - * - * @param noTimes ... - * @return ... */ def runBenchmark(noTimes: Int): List[Long] = for (i <- List.range(1, noTimes + 1)) yield { diff --git a/src/library/scala/text/Document.scala b/src/library/scala/text/Document.scala index c0a54799a3..6a0fca40ca 100644 --- a/src/library/scala/text/Document.scala +++ b/src/library/scala/text/Document.scala @@ -33,9 +33,6 @@ abstract class Document { /** * Format this document on `writer` and try to set line * breaks so that the result fits in `width` columns. - * - * @param width ... - * @param writer ... */ def format(width: Int, writer: Writer) { type FmtState = (Int, Boolean, Document) diff --git a/src/library/scala/util/Marshal.scala b/src/library/scala/util/Marshal.scala index e2ebe7851c..209cd6c062 100644 --- a/src/library/scala/util/Marshal.scala +++ b/src/library/scala/util/Marshal.scala @@ -16,6 +16,7 @@ package scala.util * @author Stephane Micheloud * @version 1.0 */ +@deprecated("This class will be removed", "2.10.0") object Marshal { import java.io._ import scala.reflect.ClassTag diff --git a/src/library/scala/util/Random.scala b/src/library/scala/util/Random.scala index 17c356801b..65a1b8c685 100644 --- a/src/library/scala/util/Random.scala +++ b/src/library/scala/util/Random.scala @@ -101,8 +101,7 @@ class Random(val self: java.util.Random) { /** Returns a new collection of the same type in a randomly chosen order. * - * @param coll the [[scala.collection.TraversableOnce]] to shuffle - * @return the shuffled [[scala.collection.TraversableOnce]] + * @return the shuffled collection */ def shuffle[T, CC[X] <: TraversableOnce[X]](xs: CC[T])(implicit bf: CanBuildFrom[CC[T], T, CC[T]]): CC[T] = { val buf = new ArrayBuffer[T] ++= xs diff --git a/src/library/scala/util/automata/BaseBerrySethi.scala b/src/library/scala/util/automata/BaseBerrySethi.scala index c78b2d0790..d8d260c478 100644 --- a/src/library/scala/util/automata/BaseBerrySethi.scala +++ b/src/library/scala/util/automata/BaseBerrySethi.scala @@ -17,6 +17,7 @@ import scala.collection.{ mutable, immutable } * [[scala.util.automata.NondetWordAutom]] over `A` using the celebrated * position automata construction (also called ''Berry-Sethi'' or ''Glushkov''). */ +@deprecated("This class will be removed", "2.10.0") abstract class BaseBerrySethi { val lang: Base import lang.{ Alt, Eps, Meta, RegExp, Sequ, Star } @@ -54,9 +55,6 @@ abstract class BaseBerrySethi { /** Starts from the right-to-left * precondition: pos is final * pats are successor patterns of a Sequence node - * - * @param r ... - * @return ... */ protected def compFollow(rs: Seq[RegExp]): Set[Int] = { follow(0) = @@ -72,10 +70,6 @@ abstract class BaseBerrySethi { } /** Returns the first set of an expression, setting the follow set along the way. - * - * @param fol1 ... - * @param r ... - * @return ... */ protected def compFollow1(fol1: Set[Int], r: RegExp): Set[Int] = r match { case x: Alt => Set((x.rs reverseMap (compFollow1(fol1, _))).flatten: _*) @@ -92,8 +86,6 @@ abstract class BaseBerrySethi { } /** Returns the "Sethi-length" of a pattern, creating the set of position along the way. - * - * @param r ... */ protected def traverse(r: RegExp): Unit = r match { // (is tree automaton stuff, more than Berry-Sethi) diff --git a/src/library/scala/util/automata/DetWordAutom.scala b/src/library/scala/util/automata/DetWordAutom.scala index 16c5d2944b..c6d72f1a06 100644 --- a/src/library/scala/util/automata/DetWordAutom.scala +++ b/src/library/scala/util/automata/DetWordAutom.scala @@ -20,6 +20,7 @@ import scala.collection.{ mutable, immutable } * @author Burak Emir * @version 1.0 */ +@deprecated("This class will be removed", "2.10.0") abstract class DetWordAutom[T <: AnyRef] { val nstates: Int val finals: Array[Int] diff --git a/src/library/scala/util/automata/Inclusion.scala b/src/library/scala/util/automata/Inclusion.scala index 63133998b4..4eaf1dfc02 100644 --- a/src/library/scala/util/automata/Inclusion.scala +++ b/src/library/scala/util/automata/Inclusion.scala @@ -17,14 +17,12 @@ package scala.util.automata * @author Burak Emir * @version 1.0 */ +@deprecated("This class will be removed", "2.10.0") trait Inclusion[A <: AnyRef] { val labels: Seq[A] /** Returns true if `dfa1` is included in `dfa2`. - * - * @param dfa1 ... - * @param dfa2 ... */ def inclusion(dfa1: DetWordAutom[A], dfa2: DetWordAutom[A]) = { diff --git a/src/library/scala/util/automata/NondetWordAutom.scala b/src/library/scala/util/automata/NondetWordAutom.scala index b09e82ca11..3b6f0b251a 100644 --- a/src/library/scala/util/automata/NondetWordAutom.scala +++ b/src/library/scala/util/automata/NondetWordAutom.scala @@ -17,6 +17,7 @@ import scala.collection.{ immutable, mutable } * All states are reachable. Accepting states are those for which * the partial function `finals` is defined. */ +@deprecated("This class will be removed", "2.10.0") abstract class NondetWordAutom[T <: AnyRef] { val nstates: Int val labels: Seq[T] diff --git a/src/library/scala/util/automata/SubsetConstruction.scala b/src/library/scala/util/automata/SubsetConstruction.scala index 81805fce2f..1cdcd734cd 100644 --- a/src/library/scala/util/automata/SubsetConstruction.scala +++ b/src/library/scala/util/automata/SubsetConstruction.scala @@ -10,6 +10,7 @@ package scala.util.automata import scala.collection.{ mutable, immutable } +@deprecated("This class will be removed", "2.10.0") class SubsetConstruction[T <: AnyRef](val nfa: NondetWordAutom[T]) { import nfa.labels diff --git a/src/library/scala/util/automata/WordBerrySethi.scala b/src/library/scala/util/automata/WordBerrySethi.scala index a7ad92e648..1d4d1f971f 100644 --- a/src/library/scala/util/automata/WordBerrySethi.scala +++ b/src/library/scala/util/automata/WordBerrySethi.scala @@ -17,6 +17,7 @@ import scala.util.regexp.WordExp * @author Burak Emir * @version 1.0 */ +@deprecated("This class will be removed", "2.10.0") abstract class WordBerrySethi extends BaseBerrySethi { override val lang: WordExp @@ -52,7 +53,6 @@ abstract class WordBerrySethi extends BaseBerrySethi { /** Returns the first set of an expression, setting the follow set along * the way. * - * @param fol1 ... * @param r the regular expression * @return the computed set */ diff --git a/src/library/scala/util/grammar/HedgeRHS.scala b/src/library/scala/util/grammar/HedgeRHS.scala index 8fb3d4c5dc..da109f41c5 100644 --- a/src/library/scala/util/grammar/HedgeRHS.scala +++ b/src/library/scala/util/grammar/HedgeRHS.scala @@ -10,13 +10,17 @@ package scala.util.grammar +@deprecated("This class will be removed", "2.10.0") abstract class HedgeRHS /** Right hand side of a hedge production, deriving a single tree. */ +@deprecated("This class will be removed", "2.10.0") case class ConsRHS(tnt: Int, hnt: Int) extends HedgeRHS /** Right hand side of a hedge production, deriving any hedge. */ +@deprecated("This class will be removed", "2.10.0") case object AnyHedgeRHS extends HedgeRHS /** Right hand side of a hedge production, deriving the empty hedge. */ +@deprecated("This class will be removed", "2.10.0") case object EmptyHedgeRHS extends HedgeRHS diff --git a/src/library/scala/util/grammar/TreeRHS.scala b/src/library/scala/util/grammar/TreeRHS.scala index ebe16b25bd..d6e7c01588 100644 --- a/src/library/scala/util/grammar/TreeRHS.scala +++ b/src/library/scala/util/grammar/TreeRHS.scala @@ -11,9 +11,12 @@ package scala.util.grammar /** Right hand side of a tree production. */ +@deprecated("This class will be removed", "2.10.0") abstract class TreeRHS /** Right hand side of a tree production, labelled with a letter from an alphabet. */ +@deprecated("This class will be removed", "2.10.0") case class LabelledRHS[A](label: A, hnt: Int) extends TreeRHS +@deprecated("This class will be removed", "2.10.0") case object AnyTreeRHS extends TreeRHS diff --git a/src/library/scala/util/parsing/ast/AbstractSyntax.scala b/src/library/scala/util/parsing/ast/AbstractSyntax.scala index 220643a0d7..67e8a87221 100644 --- a/src/library/scala/util/parsing/ast/AbstractSyntax.scala +++ b/src/library/scala/util/parsing/ast/AbstractSyntax.scala @@ -14,6 +14,7 @@ import scala.util.parsing.input.Positional * * @author Adriaan Moors */ +@deprecated("This class will be removed", "2.10.0") trait AbstractSyntax { /** The base class for elements of the abstract syntax tree. */ diff --git a/src/library/scala/util/parsing/ast/Binders.scala b/src/library/scala/util/parsing/ast/Binders.scala index 09ad5ce2ab..b93c24fde4 100644 --- a/src/library/scala/util/parsing/ast/Binders.scala +++ b/src/library/scala/util/parsing/ast/Binders.scala @@ -24,6 +24,7 @@ import language.implicitConversions * * @author Adriaan Moors */ +@deprecated("This class will be removed", "2.10.0") trait Mappable { trait Mapper { def apply[T <% Mappable[T]](x: T): T } /* TODO: having type `Forall T. T => T` is too strict: sometimes we want to allow `Forall T >: precision. T => T` for some type `precision`, so that, @@ -325,11 +326,11 @@ trait Binders extends AbstractSyntax with Mappable { // TODO: move this to some utility object higher in the scala hierarchy? /** Returns a given result, but executes the supplied closure before returning. * (The effect of this closure does not influence the returned value.) - * - * @param result the result to be returned - * @param block code to be executed, purely for its side-effects */ trait ReturnAndDo[T]{ + /** + * @param block code to be executed, purely for its side-effects + */ def andDo(block: => Unit): T } diff --git a/src/library/scala/util/parsing/combinator/testing/RegexTest.scala b/src/library/scala/util/parsing/combinator/testing/RegexTest.scala index 255730e5db..ff3554a6af 100644 --- a/src/library/scala/util/parsing/combinator/testing/RegexTest.scala +++ b/src/library/scala/util/parsing/combinator/testing/RegexTest.scala @@ -5,10 +5,14 @@ import scala.util.parsing.combinator._ import scala.util.parsing.input._ import language.postfixOps +@deprecated("This class will be removed", "2.10.0") case class Ident(s: String) +@deprecated("This class will be removed", "2.10.0") case class Number(n: Int) +@deprecated("This class will be removed", "2.10.0") case class Str(s: String) +@deprecated("This class will be removed", "2.10.0") object RegexTest extends RegexParsers { val ident: Parser[Any] = """[a-zA-Z_]\w*""".r ^^ (s => Ident(s)) val number: Parser[Any] = """\d\d*""".r ^^ (s => Number(s.toInt)) diff --git a/src/library/scala/util/parsing/combinator/testing/Tester.scala b/src/library/scala/util/parsing/combinator/testing/Tester.scala index 4607dc8843..1b98d63289 100644 --- a/src/library/scala/util/parsing/combinator/testing/Tester.scala +++ b/src/library/scala/util/parsing/combinator/testing/Tester.scala @@ -28,6 +28,7 @@ import scala.util.parsing.combinator.syntactical.TokenParsers * @author Martin Odersky * @author Adriaan Moors */ +@deprecated("This class will be removed", "2.10.0") abstract class Tester { val syntactic: TokenParsers { val lexical: Lexical } diff --git a/src/library/scala/util/parsing/input/CharArrayReader.scala b/src/library/scala/util/parsing/input/CharArrayReader.scala index e798c9883a..63d76c9382 100644 --- a/src/library/scala/util/parsing/input/CharArrayReader.scala +++ b/src/library/scala/util/parsing/input/CharArrayReader.scala @@ -21,10 +21,8 @@ object CharArrayReader { /** A character array reader reads a stream of characters (keeping track of their positions) * from an array. * - * @param source an array of characters + * @param chars an array of characters * @param index starting offset into the array; the first element returned will be `source(index)` - * @param line the line number of the first element (counting from index `0` of `source`) - * @param column the column number of the first element (counting from index `0` of `source`) * * @author Martin Odersky * @author Adriaan Moors diff --git a/src/library/scala/util/parsing/input/OffsetPosition.scala b/src/library/scala/util/parsing/input/OffsetPosition.scala index c2483c44e3..57a2c9c4c2 100644 --- a/src/library/scala/util/parsing/input/OffsetPosition.scala +++ b/src/library/scala/util/parsing/input/OffsetPosition.scala @@ -45,10 +45,9 @@ case class OffsetPosition(source: java.lang.CharSequence, offset: Int) extends P /** The column number referred to by the position; column numbers start at 1. */ def column: Int = offset - index(line - 1) + 1 - /** The contents of the line numbered `lnum` (must not contain a new-line character). + /** The contents of the line numbered at the current offset. * - * @param lnum a 1-based integer index into the `document` - * @return the line at `lnum` (not including a newline) + * @return the line at `offset` (not including a newline) */ def lineContents: String = source.subSequence(index(line - 1), index(line)).toString @@ -59,7 +58,7 @@ case class OffsetPosition(source: java.lang.CharSequence, offset: Int) extends P /** Compare this position to another, by first comparing their line numbers, * and then -- if necessary -- using the columns to break a tie. * - * @param `that` a `Position` to compare to this `Position` + * @param that a `Position` to compare to this `Position` * @return true if this position's line number or (in case of equal line numbers) * column is smaller than the corresponding components of `that` */ diff --git a/src/library/scala/util/parsing/input/PagedSeqReader.scala b/src/library/scala/util/parsing/input/PagedSeqReader.scala index 134cf0a79a..284afef57b 100644 --- a/src/library/scala/util/parsing/input/PagedSeqReader.scala +++ b/src/library/scala/util/parsing/input/PagedSeqReader.scala @@ -23,7 +23,7 @@ object PagedSeqReader { /** A character array reader reads a stream of characters (keeping track of their positions) * from an array. * - * @param source the source sequence + * @param seq the source sequence * @param offset starting offset. * * @author Martin Odersky diff --git a/src/library/scala/util/parsing/input/Position.scala b/src/library/scala/util/parsing/input/Position.scala index be817013a0..9cb0031746 100644 --- a/src/library/scala/util/parsing/input/Position.scala +++ b/src/library/scala/util/parsing/input/Position.scala @@ -27,10 +27,7 @@ trait Position { /** The column number referred to by the position; column numbers start at 1. */ def column: Int - /** The contents of the line numbered `lnum` (must not contain a new-line character). - * - * @param lnum a 1-based integer index into the `document` - * @return the line at `lnum` (not including a newline) + /** The contents of the line at this position. (must not contain a new-line character). */ protected def lineContents: String diff --git a/src/library/scala/util/parsing/input/Positional.scala b/src/library/scala/util/parsing/input/Positional.scala index ff9d81d4e5..2e9163d5ad 100644 --- a/src/library/scala/util/parsing/input/Positional.scala +++ b/src/library/scala/util/parsing/input/Positional.scala @@ -12,6 +12,7 @@ package scala.util.parsing.input * * @author Martin Odersky, Adriaan Moors */ +@deprecated("This class will be removed", "2.10.0") trait Positional { /** The source position of this object, initially set to undefined. */ diff --git a/src/library/scala/util/parsing/input/StreamReader.scala b/src/library/scala/util/parsing/input/StreamReader.scala index 8244177359..3858dc3210 100644 --- a/src/library/scala/util/parsing/input/StreamReader.scala +++ b/src/library/scala/util/parsing/input/StreamReader.scala @@ -13,14 +13,16 @@ import scala.collection.immutable.PagedSeq /** An object to create a `StreamReader` from a `java.io.Reader`. * - * @param in the `java.io.Reader` that provides the underlying - * stream of characters for this Reader. - * * @author Miles Sabin */ object StreamReader { final val EofCh = '\032' + /** Create a `StreamReader` from a `java.io.Reader`. + * + * @param in the `java.io.Reader` that provides the underlying + * stream of characters for this Reader. + */ def apply(in: java.io.Reader): StreamReader = { new StreamReader(PagedSeq.fromReader(in), 0, 1) } diff --git a/src/library/scala/util/regexp/Base.scala b/src/library/scala/util/regexp/Base.scala index 8e23d46eb9..81962ea8bd 100644 --- a/src/library/scala/util/regexp/Base.scala +++ b/src/library/scala/util/regexp/Base.scala @@ -15,8 +15,9 @@ package scala.util.regexp * @author Burak Emir * @version 1.0 */ -abstract class Base -{ + +@deprecated("This class will be removed", "2.10.0") +abstract class Base { type _regexpT <: RegExp abstract class RegExp { diff --git a/src/library/scala/util/regexp/PointedHedgeExp.scala b/src/library/scala/util/regexp/PointedHedgeExp.scala index 23aa46448c..056031a339 100644 --- a/src/library/scala/util/regexp/PointedHedgeExp.scala +++ b/src/library/scala/util/regexp/PointedHedgeExp.scala @@ -15,6 +15,7 @@ package scala.util.regexp * @author Burak Emir * @version 1.0 */ +@deprecated("This class will be removed", "2.10.0") abstract class PointedHedgeExp extends Base { type _regexpT <: RegExp diff --git a/src/library/scala/util/regexp/SyntaxError.scala b/src/library/scala/util/regexp/SyntaxError.scala index 0f5c2af187..c19dfe126e 100644 --- a/src/library/scala/util/regexp/SyntaxError.scala +++ b/src/library/scala/util/regexp/SyntaxError.scala @@ -16,4 +16,5 @@ package scala.util.regexp * @author Burak Emir * @version 1.0 */ +@deprecated("This class will be removed", "2.10.0") class SyntaxError(e: String) extends RuntimeException(e) diff --git a/src/library/scala/util/regexp/WordExp.scala b/src/library/scala/util/regexp/WordExp.scala index cf146934d1..05674f118c 100644 --- a/src/library/scala/util/regexp/WordExp.scala +++ b/src/library/scala/util/regexp/WordExp.scala @@ -38,6 +38,7 @@ package scala.util.regexp * @author Burak Emir * @version 1.0 */ +@deprecated("This class will be removed", "2.10.0") abstract class WordExp extends Base { abstract class Label diff --git a/src/library/scala/xml/Atom.scala b/src/library/scala/xml/Atom.scala index 72572fb5e4..7bed714f68 100644 --- a/src/library/scala/xml/Atom.scala +++ b/src/library/scala/xml/Atom.scala @@ -37,9 +37,6 @@ class Atom[+A](val data: A) extends SpecialNode with Serializable { /** Returns text, with some characters escaped according to the XML * specification. - * - * @param sb ... - * @return ... */ def buildString(sb: StringBuilder): StringBuilder = Utility.escape(data.toString, sb) diff --git a/src/library/scala/xml/Comment.scala b/src/library/scala/xml/Comment.scala index 014cead47c..9ce053190a 100644 --- a/src/library/scala/xml/Comment.scala +++ b/src/library/scala/xml/Comment.scala @@ -11,7 +11,7 @@ package scala.xml /** The class `Comment` implements an XML node for comments. * * @author Burak Emir - * @param text the text contained in this node, may not contain "--" + * @param commentText the text contained in this node, may not contain "--" */ case class Comment(commentText: String) extends SpecialNode { diff --git a/src/library/scala/xml/EntityRef.scala b/src/library/scala/xml/EntityRef.scala index 60feeb845d..66438135c8 100644 --- a/src/library/scala/xml/EntityRef.scala +++ b/src/library/scala/xml/EntityRef.scala @@ -12,7 +12,7 @@ package scala.xml * * @author Burak Emir * @version 1.0 - * @param text the text contained in this node. + * @param entityName the name of the entity reference, for example `amp`. */ case class EntityRef(entityName: String) extends SpecialNode { final override def doCollectNamespaces = false diff --git a/src/library/scala/xml/MetaData.scala b/src/library/scala/xml/MetaData.scala index b44a817499..e98ec90aca 100644 --- a/src/library/scala/xml/MetaData.scala +++ b/src/library/scala/xml/MetaData.scala @@ -102,7 +102,6 @@ extends AbstractIterable[MetaData] * @param namespace_uri namespace uri of key * @param owner the element owning this attribute list * @param key the attribute key - * @return ... */ final def apply(namespace_uri: String, owner: Node, key: String): Seq[Node] = apply(namespace_uri, owner.scope, key) @@ -112,15 +111,12 @@ extends AbstractIterable[MetaData] * * @param namespace_uri namespace uri of key * @param scp a namespace scp (usually of the element owning this attribute list) - * @param key to be looked fore + * @param k to be looked for * @return value as Seq[Node] if key is found, null otherwise */ - def apply(namespace_uri:String, scp:NamespaceBinding, k:String): Seq[Node] + def apply(namespace_uri: String, scp: NamespaceBinding, k: String): Seq[Node] /** returns a copy of this MetaData item with next field set to argument. - * - * @param next ... - * @return ... */ def copy(next: MetaData): MetaData @@ -208,31 +204,13 @@ extends AbstractIterable[MetaData] } /** - * @param scope ... - * @return `'''true'''` iff ... */ def wellformed(scope: NamespaceBinding): Boolean - /** - * @param key ... - * @return ... - */ def remove(key: String): MetaData - /** - * @param namespace ... - * @param scope ... - * @param key ... - * @return ... - */ def remove(namespace: String, scope: NamespaceBinding, key: String): MetaData - /** - * @param namespace ... - * @param owner ... - * @param key ... - * @return ... - */ final def remove(namespace: String, owner: Node, key: String): MetaData = remove(namespace, owner.scope, key) } diff --git a/src/library/scala/xml/Node.scala b/src/library/scala/xml/Node.scala index 02e34e1bdc..7fca644730 100755 --- a/src/library/scala/xml/Node.scala +++ b/src/library/scala/xml/Node.scala @@ -155,8 +155,7 @@ abstract class Node extends NodeSeq { /** * String representation of this node * - * @param stripComment if true, strips comment nodes from result - * @return ... + * @param stripComments if true, strips comment nodes from result */ def buildString(stripComments: Boolean): String = Utility.serialize(this, stripComments = stripComments).toString @@ -170,9 +169,6 @@ abstract class Node extends NodeSeq { /** * Appends qualified name of this node to `StringBuilder`. - * - * @param sb ... - * @return ... */ def nameToString(sb: StringBuilder): StringBuilder = { if (null != prefix) { diff --git a/src/library/scala/xml/NodeSeq.scala b/src/library/scala/xml/NodeSeq.scala index f0be338fcf..40ddc7d85c 100644 --- a/src/library/scala/xml/NodeSeq.scala +++ b/src/library/scala/xml/NodeSeq.scala @@ -88,9 +88,6 @@ abstract class NodeSeq extends AbstractSeq[Node] with immutable.Seq[Node] with S * There is no support for searching a prefixed attribute by its literal prefix. * * The document order is preserved. - * - * @param that ... - * @return ... */ def \(that: String): NodeSeq = { def fail = throw new IllegalArgumentException(that) @@ -138,9 +135,6 @@ abstract class NodeSeq extends AbstractSeq[Node] with immutable.Seq[Node] with S * There is no support for searching a prefixed attribute by its literal prefix. * * The document order is preserved. - * - * @param that ... - * @return ... */ def \\ (that: String): NodeSeq = { def filt(cond: (Node) => Boolean) = this flatMap (_.descendant_or_self) filter cond diff --git a/src/library/scala/xml/PrefixedAttribute.scala b/src/library/scala/xml/PrefixedAttribute.scala index b80d6a1c73..5cab113d85 100644 --- a/src/library/scala/xml/PrefixedAttribute.scala +++ b/src/library/scala/xml/PrefixedAttribute.scala @@ -11,10 +11,10 @@ package scala.xml /** prefixed attributes always have a non-null namespace. * - * @param pre ... - * @param key ... + * @param pre + * @param key * @param value the attribute value - * @param next ... + * @param next1 */ class PrefixedAttribute( val pre: String, diff --git a/src/library/scala/xml/PrettyPrinter.scala b/src/library/scala/xml/PrettyPrinter.scala index 64dbd00f2f..da82aca33a 100755 --- a/src/library/scala/xml/PrettyPrinter.scala +++ b/src/library/scala/xml/PrettyPrinter.scala @@ -42,10 +42,6 @@ class PrettyPrinter(width: Int, step: Int) { } /** Try to cut at whitespace. - * - * @param s ... - * @param ind ... - * @return ... */ protected def cut(s: String, ind: Int): List[Item] = { val tmp = width - cur @@ -74,10 +70,6 @@ class PrettyPrinter(width: Int, step: Int) { } /** Try to make indented box, if possible, else para. - * - * @param ind ... - * @param s ... - * @return ... */ protected def makeBox(ind: Int, s: String) = if (cur + s.length > width) { // fits in this line @@ -99,10 +91,6 @@ class PrettyPrinter(width: Int, step: Int) { cur = 0 } - /** - * @param n ... - * @return ... - */ protected def leafTag(n: Node) = { def mkLeaf(sb: StringBuilder) { sb append '<' @@ -149,7 +137,6 @@ class PrettyPrinter(width: Int, step: Int) { private def doPreserve(node: Node) = node.attribute(XML.namespace, XML.space).map(_.toString == XML.preserve) getOrElse false - /** @param tail: what we'd like to sqeeze in */ protected def traverse(node: Node, pscope: NamespaceBinding, ind: Int): Unit = node match { case Text(s) if s.trim() == "" => @@ -210,7 +197,6 @@ class PrettyPrinter(width: Int, step: Int) { * given namespace to prefix mapping to the given string buffer. * * @param n the node to be serialized - * @param pmap the namespace to prefix mapping * @param sb the stringbuffer to append to */ def format(n: Node, sb: StringBuilder) { // entry point @@ -250,9 +236,9 @@ class PrettyPrinter(width: Int, step: Int) { /** Returns a formatted string containing well-formed XML with * given namespace to prefix mapping. * - * @param n the node to be serialized - * @param pmap the namespace to prefix mapping - * @return ... + * @param n the node to be serialized + * @param pscope the namespace to prefix mapping + * @return the formatted string */ def format(n: Node, pscope: NamespaceBinding = null): String = sbToString(format(n, pscope, _)) diff --git a/src/library/scala/xml/ProcInstr.scala b/src/library/scala/xml/ProcInstr.scala index b3f4ba9186..152bcf989f 100644 --- a/src/library/scala/xml/ProcInstr.scala +++ b/src/library/scala/xml/ProcInstr.scala @@ -12,8 +12,8 @@ package scala.xml /** an XML node for processing instructions (PI) * * @author Burak Emir - * @param target target name of this PI - * @param text text contained in this node, may not contain "?>" + * @param target target name of this PI + * @param proctext text contained in this node, may not contain "?>" */ case class ProcInstr(target: String, proctext: String) extends SpecialNode { diff --git a/src/library/scala/xml/TextBuffer.scala b/src/library/scala/xml/TextBuffer.scala index bcd5fc731f..3d62afb2ef 100644 --- a/src/library/scala/xml/TextBuffer.scala +++ b/src/library/scala/xml/TextBuffer.scala @@ -25,9 +25,6 @@ class TextBuffer val sb = new StringBuilder() /** Appends this string to the text buffer, trimming whitespaces as needed. - * - * @param cs ... - * @return ... */ def append(cs: Seq[Char]): this.type = { cs foreach { c => diff --git a/src/library/scala/xml/Utility.scala b/src/library/scala/xml/Utility.scala index 062a62e240..17c91fa52c 100755 --- a/src/library/scala/xml/Utility.scala +++ b/src/library/scala/xml/Utility.scala @@ -77,9 +77,6 @@ object Utility extends AnyRef with parsing.TokenTests { /** * Escapes the characters < > & and " from string. - * - * @param text ... - * @return ... */ final def escape(text: String): String = sbToString(escape(text, _)) @@ -102,10 +99,6 @@ object Utility extends AnyRef with parsing.TokenTests { /** * Appends escaped string to `s`. - * - * @param text ... - * @param s ... - * @return ... */ final def escape(text: String, s: StringBuilder): StringBuilder = { // Implemented per XML spec: @@ -135,8 +128,6 @@ object Utility extends AnyRef with parsing.TokenTests { * Appends unescaped string to `s`, `amp` becomes `&`, * `lt` becomes `<` etc.. * - * @param ref ... - * @param s ... * @return `'''null'''` if `ref` was not a predefined entity. */ final def unescape(ref: String, s: StringBuilder): StringBuilder = @@ -145,18 +136,12 @@ object Utility extends AnyRef with parsing.TokenTests { /** * Returns a set of all namespaces used in a sequence of nodes * and all their descendants, including the empty namespaces. - * - * @param nodes ... - * @return ... */ def collectNamespaces(nodes: Seq[Node]): mutable.Set[String] = nodes.foldLeft(new mutable.HashSet[String]) { (set, x) => collectNamespaces(x, set) ; set } /** * Adds all namespaces in node to set. - * - * @param n ... - * @param set ... */ def collectNamespaces(n: Node, set: mutable.Set[String]) { if (n.doCollectNamespaces) { @@ -273,9 +258,6 @@ object Utility extends AnyRef with parsing.TokenTests { /** * Returns prefix of qualified name if any. - * - * @param name ... - * @return ... */ final def prefix(name: String): Option[String] = (name indexOf ':') match { case -1 => None @@ -284,11 +266,6 @@ object Utility extends AnyRef with parsing.TokenTests { /** * Returns a hashcode for the given constituents of a node - * - * @param uri - * @param label - * @param attribHashCode - * @param children */ def hashCode(pre: String, label: String, attribHashCode: Int, scpeHash: Int, children: Seq[Node]) = scala.util.MurmurHash3.orderedHash(label +: attribHashCode +: scpeHash +: children, pre.##) @@ -298,10 +275,6 @@ object Utility extends AnyRef with parsing.TokenTests { /** * Appends "s" if string `s` does not contain ", * 's' otherwise. - * - * @param s ... - * @param sb ... - * @return ... */ def appendQuoted(s: String, sb: StringBuilder) = { val ch = if (s contains '"') '\'' else '"' @@ -310,10 +283,6 @@ object Utility extends AnyRef with parsing.TokenTests { /** * Appends "s" and escapes and " i s with \" - * - * @param s ... - * @param sb ... - * @return ... */ def appendEscapedQuoted(s: String, sb: StringBuilder): StringBuilder = { sb.append('"') @@ -324,11 +293,6 @@ object Utility extends AnyRef with parsing.TokenTests { sb.append('"') } - /** - * @param s ... - * @param index ... - * @return ... - */ def getName(s: String, index: Int): String = { if (index >= s.length) null else { @@ -341,9 +305,6 @@ object Utility extends AnyRef with parsing.TokenTests { /** * Returns `'''null'''` if the value is a correct attribute value, * error message if it isn't. - * - * @param value ... - * @return ... */ def checkAttributeValue(value: String): String = { var i = 0 @@ -365,12 +326,6 @@ object Utility extends AnyRef with parsing.TokenTests { null } - /** - * new - * - * @param value ... - * @return ... - */ def parseAttributeValue(value: String): Seq[Node] = { val sb = new StringBuilder var rfb: StringBuilder = null @@ -426,11 +381,6 @@ object Utility extends AnyRef with parsing.TokenTests { * | "&#x" '0'..'9'|'A'..'F'|'a'..'f' { hexdigit } ";" * }}} * See [66] - * - * @param ch ... - * @param nextch ... - * @param reportSyntaxError ... - * @return ... */ def parseCharRef(ch: () => Char, nextch: () => Unit, reportSyntaxError: String => Unit, reportTruncatedError: String => Unit): String = { val hex = (ch() == 'x') && { nextch(); true } diff --git a/src/library/scala/xml/dtd/DocType.scala b/src/library/scala/xml/dtd/DocType.scala index f0ef09b901..64aa7e2f74 100644 --- a/src/library/scala/xml/dtd/DocType.scala +++ b/src/library/scala/xml/dtd/DocType.scala @@ -14,7 +14,7 @@ package dtd * * @author Burak Emir * - * @param target name of this DOCTYPE + * @param name name of this DOCTYPE * @param extID None, or Some(external ID of this doctype) * @param intSubset sequence of internal subset declarations */ diff --git a/src/library/scala/xml/dtd/ExternalID.scala b/src/library/scala/xml/dtd/ExternalID.scala index fdde18a926..a0a5818d07 100644 --- a/src/library/scala/xml/dtd/ExternalID.scala +++ b/src/library/scala/xml/dtd/ExternalID.scala @@ -41,7 +41,7 @@ abstract class ExternalID extends parsing.TokenTests /** a system identifier * * @author Burak Emir - * @param systemLiteral the system identifier literal + * @param systemId the system identifier literal */ case class SystemID(systemId: String) extends ExternalID { val publicId = null @@ -54,8 +54,8 @@ case class SystemID(systemId: String) extends ExternalID { /** a public identifier (see http://www.w3.org/QA/2002/04/valid-dtd-list.html). * * @author Burak Emir - * @param publicLiteral the public identifier literal - * @param systemLiteral (can be null for notation pubIDs) the system identifier literal + * @param publicId the public identifier literal + * @param systemId (can be null for notation pubIDs) the system identifier literal */ case class PublicID(publicId: String, systemId: String) extends ExternalID { if (!checkPubID(publicId)) diff --git a/src/library/scala/xml/include/sax/XIncludeFilter.scala b/src/library/scala/xml/include/sax/XIncludeFilter.scala index 4bd0336a26..52ddf6b476 100644 --- a/src/library/scala/xml/include/sax/XIncludeFilter.scala +++ b/src/library/scala/xml/include/sax/XIncludeFilter.scala @@ -249,7 +249,7 @@ class XIncludeFilter extends XMLFilterImpl { * calls to `characters()`. It's used to include files with `parse="text"`. * * @param url URL of the document that will be read - * @param encoding Encoding of the document; e.g. UTF-8, + * @param encoding1 Encoding of the document; e.g. UTF-8, * ISO-8859-1, etc. * @return void * @throws SAXException if the requested document cannot diff --git a/src/library/scala/xml/parsing/ExternalSources.scala b/src/library/scala/xml/parsing/ExternalSources.scala index ca6cea4c67..127d66bf6f 100644 --- a/src/library/scala/xml/parsing/ExternalSources.scala +++ b/src/library/scala/xml/parsing/ExternalSources.scala @@ -23,11 +23,6 @@ import scala.io.Source trait ExternalSources { self: ExternalSources with MarkupParser with MarkupHandler => - /** ... - * - * @param systemId ... - * @return ... - */ def externalSource(systemId: String): Source = { if (systemId startsWith "http:") return Source fromURL new URL(systemId) diff --git a/src/library/scala/xml/parsing/FactoryAdapter.scala b/src/library/scala/xml/parsing/FactoryAdapter.scala index 5aad0e7ce1..507a14a418 100644 --- a/src/library/scala/xml/parsing/FactoryAdapter.scala +++ b/src/library/scala/xml/parsing/FactoryAdapter.scala @@ -158,7 +158,7 @@ abstract class FactoryAdapter extends DefaultHandler with factory.XMLLoader[Node /** End element. * @param uri - * @param localName + * @param _localName * @param qname * @throws org.xml.sax.SAXException if .. */ diff --git a/src/library/scala/xml/parsing/MarkupHandler.scala b/src/library/scala/xml/parsing/MarkupHandler.scala index 83db2f177d..8d66fd0a7f 100755 --- a/src/library/scala/xml/parsing/MarkupHandler.scala +++ b/src/library/scala/xml/parsing/MarkupHandler.scala @@ -64,7 +64,6 @@ abstract class MarkupHandler extends Logged * @param pos the position in the source file * @param pre the prefix * @param label the local name - * @param attrs the attributes (metadata) */ def elemEnd(pos: Int, pre: String, label: String): Unit = () @@ -77,7 +76,6 @@ abstract class MarkupHandler extends Logged * @param attrs the attributes (metadata) * @param empty `true` if the element was previously empty; `false` otherwise. * @param args the children of this element - * @return ... */ def elem(pos: Int, pre: String, label: String, attrs: MetaData, scope: NamespaceBinding, empty: Boolean, args: NodeSeq): NodeSeq diff --git a/src/library/scala/xml/parsing/MarkupParserCommon.scala b/src/library/scala/xml/parsing/MarkupParserCommon.scala index c6da4bb546..096f8a8f38 100644 --- a/src/library/scala/xml/parsing/MarkupParserCommon.scala +++ b/src/library/scala/xml/parsing/MarkupParserCommon.scala @@ -54,8 +54,8 @@ private[scala] trait MarkupParserCommon extends TokenTests { xTakeUntil(mkProcInstr(_, n, _), () => tmppos, "?>") } - /** attribute value, terminated by either ' or ". value may not contain <. - * @param endch either ' or " + /** attribute value, terminated by either `'` or `"`. value may not contain `<`. + @param endCh either `'` or `"` */ def xAttributeValue(endCh: Char): String = { val buf = new StringBuilder diff --git a/src/library/scala/xml/pull/XMLEvent.scala b/src/library/scala/xml/pull/XMLEvent.scala index dff81e8ed6..58d7d9fac5 100644 --- a/src/library/scala/xml/pull/XMLEvent.scala +++ b/src/library/scala/xml/pull/XMLEvent.scala @@ -38,7 +38,7 @@ case class EvElemEnd(pre: String, label: String) extends XMLEvent case class EvText(text: String) extends XMLEvent /** An entity reference was encountered. - * @param the name of the entity, e.g. `gt` when encountering the entity `>` + * @param entity the name of the entity, e.g. `gt` when encountering the entity `>` */ case class EvEntityRef(entity: String) extends XMLEvent diff --git a/src/library/scala/xml/transform/BasicTransformer.scala b/src/library/scala/xml/transform/BasicTransformer.scala index 002f86abe7..0ae417a7f8 100644 --- a/src/library/scala/xml/transform/BasicTransformer.scala +++ b/src/library/scala/xml/transform/BasicTransformer.scala @@ -18,11 +18,6 @@ package transform */ abstract class BasicTransformer extends Function1[Node,Node] { - /** - * @param n ... - * @param ns ... - * @return ... - */ protected def unchanged(n: Node, ns: Seq[Node]) = ns.length == 1 && (ns.head == n) diff --git a/test/files/pos/t1133.scala b/test/files/pos/t1133.scala new file mode 100644 index 0000000000..4538de5f5f --- /dev/null +++ b/test/files/pos/t1133.scala @@ -0,0 +1,32 @@ +object Match +{ + def main(args: Array[String]) = { + args(0) match { + case Extractor1(Extractor2(Extractor3("dog", "dog", "dog"), x2, x3), b, c, Extractor3("b", "b", f), e) => println(e) + case Extractor3(Extractor2(Extractor1("a", "aa", "aaa", "aa", "a"), Extractor2("a", "aa", "aaa"), e), y, z) => println(e) + case Extractor2(Extractor3("a", "a", x), Extractor3("b", "b", y), Extractor3("c", "c", z)) => println(z) + case _ => println("fail") + } + } + + object Extractor1 { + def unapply(x: Any) = x match { + case x: String => Some(x, x+x, x+x+x, x+x, x) + case _ => None + } + } + + object Extractor2 { + def unapply(x: Any) = x match { + case x: String => Some(x, x+x, x+x+x) + case _ => None + } + } + + object Extractor3 { + def unapply(x: Any) = x match { + case x: String => Some(x, x, x) + case _ => None + } + } +} diff --git a/test/files/pos/t5029.flags b/test/files/pos/t5029.flags new file mode 100644 index 0000000000..e8fb65d50c --- /dev/null +++ b/test/files/pos/t5029.flags @@ -0,0 +1 @@ +-Xfatal-warnings
\ No newline at end of file diff --git a/test/files/pos/t5029.scala b/test/files/pos/t5029.scala new file mode 100644 index 0000000000..6f9a329b80 --- /dev/null +++ b/test/files/pos/t5029.scala @@ -0,0 +1,3 @@ +object Test { + (Vector(): Seq[_]) match { case List() => true; case Nil => false } +}
\ No newline at end of file diff --git a/test/files/pos/t5137.scala b/test/files/pos/t5137.scala new file mode 100644 index 0000000000..bb72cf378f --- /dev/null +++ b/test/files/pos/t5137.scala @@ -0,0 +1,17 @@ +object Test { + + // okay + (1 * (List[BigInt]().map(((x0) => x0 match { + case x => x + })).sum)) + + // okay + ((1: BigInt) * (List[BigInt]().map({ + case x => x + }).sum)) + + // fail + (1 * (List[BigInt]().map({ + case x => x + }).sum)) +}
\ No newline at end of file diff --git a/test/files/pos/t5626.scala b/test/files/pos/t5626.scala new file mode 100644 index 0000000000..c501dfbe60 --- /dev/null +++ b/test/files/pos/t5626.scala @@ -0,0 +1,12 @@ +class C { + val blob = { + new { case class Foo() } + } + val blub = { + class Inner { case class Foo() } + new Inner + } + + val foo = blob.Foo() + val bar = blub.Foo() +} diff --git a/test/files/pos/t5720-ownerous.scala b/test/files/pos/t5720-ownerous.scala index 3a12499612..ad4d4c171d 100644 --- a/test/files/pos/t5720-ownerous.scala +++ b/test/files/pos/t5720-ownerous.scala @@ -28,10 +28,10 @@ class C { //def model = Option(M("foo")()).getOrElse(M("bar")()).copy(currentUser = "")() // the bug - def model = Option(m).getOrElse(M("bar")()).copy("baz")() + def model = Option(m).getOrElse(M("bar")()).copy("baz")("empty") // style points for this version - def modish = ((null: Option[M]) getOrElse new M()()).copy()() + def modish = ((null: Option[M]) getOrElse new M()()).copy()("empty") // various simplifications are too simple case class N(currentUser: String = "anon") diff --git a/test/files/run/names-defaults.check b/test/files/run/names-defaults.check index 5656d1a276..f253de71d6 100644 --- a/test/files/run/names-defaults.check +++ b/test/files/run/names-defaults.check @@ -92,7 +92,7 @@ test5 test5 5 10: 2 -slkdfj1 +slkdfj2 1 lskfdjlk 11 diff --git a/test/files/run/names-defaults.scala b/test/files/run/names-defaults.scala index e1bc7cbf59..220414f02a 100644 --- a/test/files/run/names-defaults.scala +++ b/test/files/run/names-defaults.scala @@ -176,7 +176,7 @@ object Test extends App { println(Fact2()("jyp")) println(Fact2(x = 1)()) - println(Fact2(10)().copy(y = "blabla")()) + println(Fact2(10)().copy(y = "blabla")(3)) // assignment to var <-> named argument @@ -195,7 +195,7 @@ object Test extends App { // dependent types and copy method val a11 = new A2 val b11 = a11.B2(new a11.C2)(1) - println(b11.copy()()) + println(b11.copy()(2)) diff --git a/test/files/run/t4025.check b/test/files/run/t4025.check new file mode 100644 index 0000000000..6715003cb6 --- /dev/null +++ b/test/files/run/t4025.check @@ -0,0 +1,19 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> + +scala> class Color(val red: Int) +defined class Color + +scala> + +scala> case class Red(r:Int) extends Color(r) +defined class Red + +scala> + +scala> def f(c: Any) = c match { case Red(_) => () } +f: (c: Any)Unit + +scala> diff --git a/test/files/run/t4025.scala b/test/files/run/t4025.scala new file mode 100644 index 0000000000..5db0093970 --- /dev/null +++ b/test/files/run/t4025.scala @@ -0,0 +1,12 @@ +import scala.tools.nsc.Settings +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ +class Color(val red: Int) + +case class Red(r:Int) extends Color(r) + +def f(c: Any) = c match { case Red(_) => () } +""" +} diff --git a/test/files/run/t5009.check b/test/files/run/t5009.check new file mode 100644 index 0000000000..cc9df54b34 --- /dev/null +++ b/test/files/run/t5009.check @@ -0,0 +1,4 @@ +C(1,true) +10 +C(7283,20) +100 diff --git a/test/files/run/t5009.scala b/test/files/run/t5009.scala new file mode 100644 index 0000000000..b4fe1bc894 --- /dev/null +++ b/test/files/run/t5009.scala @@ -0,0 +1,17 @@ +object Test extends App { + + case class C[T, U <: String, O >: Object](x: Int, y: T)(z: U, b: Boolean)(s: O, val l: Int) + + val c = C(1, true)("dlkfj", true)("dlkfjlk", 10) + println(c) + println(c.l) + + val f1a = c.copy(y = 20, x = 7283) + + val f1b = c.copy[Int, String, Object](y = 20, x = 7283) + val f2b = f1b("lkdjen", false) + val res = f2b(new Object, 100) + println(res) + println(res.l) + +} diff --git a/test/files/run/t5037.check b/test/files/run/t5037.check new file mode 100644 index 0000000000..da29283aaa --- /dev/null +++ b/test/files/run/t5037.check @@ -0,0 +1,2 @@ +true +false diff --git a/test/files/run/t5037.scala b/test/files/run/t5037.scala new file mode 100644 index 0000000000..7b1fce7a82 --- /dev/null +++ b/test/files/run/t5037.scala @@ -0,0 +1,18 @@ +object Test { + def main(args: Array[String]) { + val t = new Test + t.inner.foo() + } +} + +class Test { + class Inner { + def foo() { + println(bar) + bar = false + println(bar) + } + } + val inner = new Inner + private[this] final var bar = true +} diff --git a/test/files/run/t5407.check b/test/files/run/t5407.check new file mode 100644 index 0000000000..51993f072d --- /dev/null +++ b/test/files/run/t5407.check @@ -0,0 +1,2 @@ +2 +2 diff --git a/test/files/run/t5407.scala b/test/files/run/t5407.scala new file mode 100644 index 0000000000..35a8ec6a45 --- /dev/null +++ b/test/files/run/t5407.scala @@ -0,0 +1,17 @@ +case class Foo(private val x: Int, y: Option[Int], z: Boolean) + +object Test extends App { + def foo(x: Foo) = x match { + case Foo(x, Some(y), z) => y + case Foo(x, y, z) => 0 + } + val x = Foo(1, Some(2), false) + println(foo(x)) + + + def bar(x: Foo) = x match { + case Foo(x, Some(y), z) => y + case Foo(x, None, z) => 0 + } + println(bar(x)) +}
\ No newline at end of file diff --git a/test/files/run/t5527.check b/test/files/run/t5527.check index bb13928fd8..1518168c51 100644 --- a/test/files/run/t5527.check +++ b/test/files/run/t5527.check @@ -1,4 +1,4 @@ -[[syntax trees at end of parser]]// Scala source: newSource1 +[[syntax trees at end of parser]] // newSource1 package <empty> { object UselessComments extends scala.AnyRef { def <init>() = { diff --git a/test/files/specialized/SI-5005.check b/test/files/specialized/SI-5005.check index 9fc63a2b1d..81e8342dad 100644 --- a/test/files/specialized/SI-5005.check +++ b/test/files/specialized/SI-5005.check @@ -1,4 +1,4 @@ -[[syntax trees at end of specialize]]// Scala source: newSource1 +[[syntax trees at end of specialize]] // newSource1 package <empty> { class C2[@specialized(scala.Boolean) U >: Nothing <: Any] extends Object { def <init>(): C2[U] = { |