[
https://jira.codehaus.org/browse/JIBX-479?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=296211#comment-296211
]
Sergio Ortiz edited comment on JIBX-479 at 4/11/12 5:16 AM:
------------------------------------------------------------
Current code with proper format (including line numbers):
<code>
1441 public static String serializeDateTime(Date date) {
1442 return serializeDateTime(date.getTime(), true);
1443 }
</code>
was (Author: sergioortiz):
Current code with proper format (including line numbers):
<code>
1441 public static String serializeDateTime(Date date) {
1442 return serializeDateTime(date.getTime(), true);
1443 }
<code>
> 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-devs