Sergio Ortiz created JIBX-479: --------------------------------- Summary: Missing Null check in org.jibx.runtime.Utility.serializeDateTime() Key: JIBX-479 URL: https://jira.codehaus.org/browse/JIBX-479 Project: JiBX Issue Type: Bug Components: core Affects Versions: JiBX 1.2.3 Reporter: Sergio Ortiz
Utility.serializeDateTime() throws a NullPointerException when trying to serialize a null Date (an Object's property of Date type that hasn't been initialized for whatever reason). Current code: 1441 public static String serializeDateTime(Date date) { 1442 return serializeDateTime(date.getTime(), true); 1443 } So if for some reason date is null, line 1442 would throw a java.lang.NullPointerException. It should include the null check and return null or an empty string. For example: public static String serializeDateTime(Date date) { if(date == null){ return null; } return serializeDateTime(date.getTime(), true); } Regards, Sergio -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira ------------------------------------------------------------------------------ Better than sec? Nothing is better than sec when it comes to monitoring Big Data applications. Try Boundary one-second resolution app monitoring today. Free. http://p.sf.net/sfu/Boundary-dev2dev _______________________________________________ jibx-devs mailing list jibx-devs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-devs