je-ik commented on pull request #14986:
URL: https://github.com/apache/beam/pull/14986#issuecomment-858538776


   I'm not 100% sure this is the best solution. We should definitely not throw 
ClassCastException in the described case. My first iteration was to simply 
throw an exception explaining why this doesn't work, but then I realized, that 
by wrapping into anonymous subclass the problem can be solved. Not sure if the 
anonymous subclass should be created as well, but looks reusable and actually 
helps a lot (at least with JDK11+, where it is possible to create anonymous 
subclasses with diamond operator, so the user does not actually know that the 
accumulator of Max is `Combine.Holder<T>`, which is nice).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to