Viewing: Java

Jan 8

January 8, 2016

A Question of Style

Going through legacy code and I find this: if (docs != null) { if (docs.size() > 0) { … } } Since there is no else is there a good reason to not just have a single if statement? if (docs != null && docs.size() > 0) { … } Thoughts?

Posted in Java | By

Sep 9

September 9, 2014

Java timezone madness

I was recently working on a legacy java servlet application and ran into an interesting problem. It seems that somewhere between Java 5 and Java 7 there were some changes to the way timezones are handled. The application was reading and writing dates to the database, and web page, but for some reason the time was fluctuating by 1 hour in the database. Ordinarily this wouldn’t have been a big deal since we really only worried about the date portion…

Posted in Java, Web Application Programming | By