Skip to content

Commit

Permalink
removed varargs annotation from Params.setDefaults taking multiple Pa…
Browse files Browse the repository at this point in the history
…ramPairs
  • Loading branch information
jkbradley committed May 9, 2015
1 parent 6dad76e commit 098ed39
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion mllib/src/main/scala/org/apache/spark/ml/param/params.scala
Original file line number Diff line number Diff line change
Expand Up @@ -387,11 +387,12 @@ trait Params extends Identifiable with Serializable {
/**
* Sets default values for a list of params.
*
* Note: Java developers should use the single-parameter [[setDefault()]].
* Annotating this with varargs causes compilation failures. See SPARK-7498.
* @param paramPairs a list of param pairs that specify params and their default values to set
* respectively. Make sure that the params are initialized before this method
* gets called.
*/
@varargs
protected final def setDefault(paramPairs: ParamPair[_]*): this.type = {
paramPairs.foreach { p =>
setDefault(p.param.asInstanceOf[Param[Any]], p.value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,5 @@ public JavaTestParams() {
ParamValidators.inArray(validStrings));
setDefault(myIntParam, 1);
setDefault(myDoubleParam, 0.5);
setDefault(myIntParam.w(1), myDoubleParam.w(0.5));
}
}

0 comments on commit 098ed39

Please sign in to comment.