Talend isDate function generating a java.lang.Error on yyyyMMdd form

One Star

Talend isDate function generating a java.lang.Error on yyyyMMdd form

I am attempting to use the isDate function in an expression for a incoming 8 character date string to see if it is a valid date or not. The date is in a ?yyyymmdd? format. The expression I am using is as follows: TalendDate.isDate(row1.OPTOUT_DATE,"yyyyMMdd") == true ? TalendDate.parseDate("yyyy-MM-dd",row1.OPTOUT_DATE):null. I am using the Test functionality in Expression Builder to ensure the logic works. It does if I change the date format to ?yyyy-MM-dd?, but not ?yyyyMMdd?. Test window in Expression builder displays the following error when I a date such as 20130906 as a value for the OPTOUT_DATE variable: Exception in thread "main" java.lang.Error: Unresolved compilation problems: . Has anyone encountered this issue before and do you have a resolution or workaround I can use in Talend Expression Builder.
Five Stars

Re: Talend isDate function generating a java.lang.Error on yyyyMMdd form

Shouldn't the formats that you're passing to isDate and parseDate be the same?
Seven Stars

Re: Talend isDate function generating a java.lang.Error on yyyyMMdd form

And don't trust the Test window in Expression builder. Best way is to look at the whole generated Code or run the job.