Hi Louis Müller
Thank you for you support.
My question missed some information to let you be able to reproduce the issue.
This is my sample project that can reproduce the issue I described: https://file.io/WQUZqjEein6B.
Let me re-tell 4 cases with this sample project:
Case 1:❌
The bean:
@ManagedBean(name="myTextBean")
public class MyTextBean {
public static String getText(String cmsUrl, Object ...objects) {
return "foobar1";
}
public static String getText(String cmsUrl, List<Integer> objects) {
return "foobar2";
}
public static String getText(String cmsUrl, ArrayList<Integer> objects) {
return "foobar3";
}
}
The expression:
#{myTextBean.getText('messageUri', '')}
=> The exception occurs:
javax.el.MethodNotFoundException: Unable to find unambiguous method: class my.project.text.creator.bean.MyTextBean.getText(java.lang.String, java.lang.String)
at javax.el.Util.findWrapper(Util.java:367)
at javax.el.Util.findMethod(Util.java:217)
at javax.el.BeanELResolver.invoke(BeanELResolver.java:141)
Case 2:❌
The bean:
@ManagedBean(name="myTextBean")
public class MyTextBean {
public static String getText(String cmsUrl, Object ...objects) {
return "foobar1";
}
public static String getText(String cmsUrl, List<Integer> objects) {
return "foobar2";
}
/*public static String getText(String cmsUrl, ArrayList<Integer> objects) {
return "foobar3";
}*/
}
The expression:
#{myTextBean.getText('messageUri', '')}
=> The text "foobar2" is displayed while the expectation is "foobar1".
Case 3:❌
The bean:
@ManagedBean(name="myTextBean")
public class MyTextBean {
public static String getText(String cmsUrl, Object ...objects) {
return "foobar1";
}
/*public static String getText(String cmsUrl, List<Integer> objects) {
return "foobar2";
}*/
public static String getText(String cmsUrl, ArrayList<Integer> objects) {
return "foobar3";
}
}
The expression:
#{myTextBean.getText('messageUri', '')}
=> The text "foobar3" is displayed while the expectation is "foobar1".
Case 4:✅
The bean:
@ManagedBean(name="myTextBean")
public class MyTextBean {
public static String getText(String cmsUrl, Object ...objects) {
return "foobar1";
}
public static String getText(String cmsUrl, List<Integer> objects) {
return "foobar2";
}
public static String getText(String cmsUrl, ArrayList<Integer> objects) {
return "foobar3";
}
}
The expression:
#{myTextBean.getText('messageUri', 'hello')}
=> The text "foobar1" is displayed as expected.
In conclusion, it seems that the problem only happens if the bean has some overloaded methods that require generic parameters. It only happens if we call the method from EL Expression in Ivy 9.3.4. There is no problem in pure Java and EL Express in Ivy 9.1.1.