Many developers have commented on this post about the issue of Thread safety in this code snippet.
As Simple Date Format class itself is not thread safe it can cause issues in production.
* * @param p Date String date to be tested * @return a Testable Lastly, this method is difficult to test. While you may not use Java 8, you can certainly make a What happens if there is a non-numeric character in the year string?
This is a basic test class:package com.core; import static org.junit.
(I care less about whitespace and formatting.) /** * Tests whether the date input represents * a real date in mm/dd/YYYY format that is after the current date.
* Useful for testing send dates and expiration dates.
if you want to check the unit testing for this UDF, please click here.
Please remember that once your process enters the UDF, you can fully use all the date manipulation capabilities that you use in Java.