In general, I suggest to remove all use of null return values. It is the bane of programming....
On Sun, Jan 14, 2018 at 3:18 PM, Christofer Dutz <[email protected]> wrote: > Sounds good to me ... Eventually we should check, if this makes sense for > the other enums. > > Chris > > Outlook for Android<https://aka.ms/ghei36> herunterladen > > ________________________________ > From: Justin Mclean <[email protected]> > Sent: Sunday, January 14, 2018 12:07:38 AM > To: [email protected] > Subject: null Tpdu codes > > Hi, > > In writing a couple of bad code code I found that the the existing code > would NPE when doing switch of a TdpuCode of null. In order to get around > this I add a new enum of UNKNOWN and now have valueOF return that instead > of null if the tpdu code is not in the enum map. Anyone think this is not > the right approach? > > Thanks, > Justin > -- Niclas Hedhman, Software Developer http://polygene.apache.org - New Energy for Java
