Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.3-rc1
-
None
-
None
-
Operating System: Windows XP
Platform: PC
-
13637
Description
1 create a class with two overloaded methods like
public class Helper {
public String getFoo(Integer v)
public String getFoo(String v)
{ return "str "+v; }}
2. put an instance of Helper and a collection containing two items of
different types
col = new ArrayList();
col.add(new Integer(100));
col.add("STRVALUE");
ctx.put("helper", new Helper());
ctx.put("col", col);
3. in a template, do
#foreach ( $item in $col )
${helper.getFoo($item)
#end
4. evaluate the template and you should see
int 100
${helper.getFoo($item)
The error: the second item should invoke getFoo(String) but it apparently
fails and causing the invocation failure.