Yes, it is a valid workaround for the time. Is it possible to make them
private nonetheless?


On Wed, Dec 4, 2013 at 4:58 PM, Aljoscha Krettek
<notifications@github.com>wrote:

> In
> pact-scala/pact-scala-core/src/main/scala/eu/stratosphere/scala/stubs/MapStub.scala:
>
> > @@ -0,0 +1,71 @@
> > +package eu.stratosphere.scala.stubs
> > +
> > +import eu.stratosphere.scala.analysis.{UDTSerializer, UDT, UDF1}
> > +import eu.stratosphere.pact.common.stubs.{Collector, MapStub => JMapStub}
> > +import eu.stratosphere.nephele.configuration.Configuration
> > +import eu.stratosphere.pact.common.`type`.PactRecord
> > +
> > +abstract class MapStubBase[In: UDT, Out: UDT] extends JMapStub with Serializable with Function1[In, Out] {
> > +  val inputUDT: UDT[In] = implicitly[UDT[In]]
> > +  val outputUDT: UDT[Out] = implicitly[UDT[Out]]
> > +  lazy val udf: UDF1[In, Out] = new UDF1(inputUDT, outputUDT)
> > +
> > +  lazy val deserializer: UDTSerializer[In] = udf.getInputDeserializer
>
> First I did not use lazy vals and did the initialization in the open
> method. But it can happen that a user overrides open() and forgets to call
> super.open(). In that case the code will fail with null pointer exceptions.
> Even I forget this at first and was wondering whether I had made a mistake.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/stratosphere/stratosphere/pull/319/files#r8099340>
> .
>