Skip to content

Commit

Permalink
[SPARK-11110][BUILD] Remove transient annotation for parameters.
Browse files Browse the repository at this point in the history
`transient` annotations on class parameters (not case class parameters or vals) causes compilation errors during compilation with Scala 2.11.
I understand that transient *parameters* make no sense, however I don't quite understand why the 2.10 compiler accepted them.

Note: in case it is preferred to keep the annotations in case someone would in the future want to redefine them as vals, it would also be possible to just add `val` after the annotation, e.g. `class Foo(transient x: Int)` becomes `class Foo(transient private val x: Int)`.

I chose to remove the annotation as it also reduces needles clutter, however please feel free to tell me if you prefer the second option and I'll update the PR

Author: Jakob Odersky <jodersky@gmail.com>

Closes apache#9126 from jodersky/sbt-scala-2.11.
  • Loading branch information
jodersky authored and srowen committed Oct 20, 2015
1 parent 8f74aa6 commit 60851bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ private[netty] class NettyRpcEnvFactory extends RpcEnvFactory with Logging {
}
}

private[netty] class NettyRpcEndpointRef(@transient conf: SparkConf)
private[netty] class NettyRpcEndpointRef(@transient private val conf: SparkConf)
extends RpcEndpointRef(conf) with Serializable with Logging {

@transient @volatile private var nettyEnv: NettyRpcEnv = _
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ private[hive] case class CurrentDatabase(ctx: HiveContext)
class HiveContext private[hive](
sc: SparkContext,
cacheManager: CacheManager,
@transient listener: SQLListener,
@transient execHive: ClientWrapper,
@transient metaHive: ClientInterface,
listener: SQLListener,
@transient private val execHive: ClientWrapper,
@transient private val metaHive: ClientInterface,
isRootContext: Boolean)
extends SQLContext(sc, cacheManager, listener, isRootContext) with Logging {
self =>
Expand Down

0 comments on commit 60851bc

Please sign in to comment.