On Fri, Jun 3, 2016 at 9:10 AM, Gary Gregory <[email protected]> wrote:
> Talk about NOT object-oriented though! :-( > It feels like more and more code like this instanceof has been sneaking in for 2.6 :-( A code review might help at some point, not today for me and not a blocker for 2.6.1. Gary > On Jun 3, 2016 3:49 AM, "Mikael Ståldal" <[email protected]> > wrote: > >> Would it make sense if AbstractMessageFactory was changed so that this >> method: >> >> @Override >> public Message newMessage(final Object message) { >> return new ObjectMessage(message); >> } >> >> did this: >> >> @Override >> public Message newMessage(final Object message) { >> if (message instanceof CharSequence) { >> return new SimpleMessage((CharSequence) message) >> } else { >> return new ObjectMessage(message); >> } >> } >> >> >> -- >> [image: MagineTV] >> >> *Mikael Ståldal* >> Senior software developer >> >> *Magine TV* >> [email protected] >> Grev Turegatan 3 | 114 46 Stockholm, Sweden | www.magine.com >> >> Privileged and/or Confidential Information may be contained in this >> message. If you are not the addressee indicated in this message >> (or responsible for delivery of the message to such a person), you may >> not copy or deliver this message to anyone. In such case, >> you should destroy this message and kindly notify the sender by reply >> email. >> > -- E-Mail: [email protected] | [email protected] Java Persistence with Hibernate, Second Edition <http://www.manning.com/bauer3/> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/> Spring Batch in Action <http://www.manning.com/templier/> Blog: http://garygregory.wordpress.com Home: http://garygregory.com/ Tweet! http://twitter.com/GaryGregory
