Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
From cpettitt-linkedin:
I picked up the latest code and found that MessageStream.merge is now broken for nested types. For example, the following: final MessageStream<BeamMessage<InT>> inputStream = ...; final Collection<MessageStream<BeamMessage<InT>>> sideInputStreams = ...; final MessageStream<BeamMessage<OutT>> outputStream = inputStream .merge(sideInputStreams); Now fails to compile: incompatible types: java.util.Collection<org.apache.samza.operators.MessageStream<com.linkedin.beam.runners.samza.runtime.BeamMessage<InT>>> cannot be converted to java.util.Collection<org.apache.samza.operators.MessageStream<? extends com.linkedin.beam.runners.samza.runtime.BeamMessage<InT>>> This forces the user to go to raw types, which is not intuitive and certainly not type safe. Per http://www.angelikalanger.com/GenericsFAQ/FAQSections/TypeArguments.html#FAQ104, I believe we want the parameter type to be Collection<? extends MessageStream<? extends M>> , which does compile.