Hi Hari,
The queue in your example, all the values is unique, not duplicated, so probably not UDF problem.
The error is complaint about string index out-of-bound at LocationGroup[8], which is 9th start from index 0. At 9th string of your queue is empty string, so hit error when map to substring(1..4) but with string with zero length.
Are you sure is UDF lead to this error or providing the correct error? post a display queue of the removeDuplicate might help.
I have an UDF similar with your UDF too is working fine.http://scn.sap.com/docs/DOC-63651
List uniqueList = new ArrayList();
for (int i = 0; i < contextValues.length; i++){
String value = contextValues[i];
if (!uniqueList.contains(value)) {
uniqueList.add(value);
result.addValue(value);
}
}
Regards,
Yee Loon