Varargs: jakarta.el.MethodNotFoundException
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start at ELUtil.findMethod and findMostSpecificWrapper, following the call from BeanELResolver.invoke, and reproduce the supplied varargs expression with the TestBean methods. Check how ambiguous overloads and enum arguments are resolved against the applicable specification. Done means the expected method selection or a confirmed specification limitation is covered by a regression test.
Written by the indexing model from the issue text.
Description
I encountered the following exception when testing the code below on Wildfly 24."
Tomcat had updated their varargs handling in BZ 65358, and I'm wondering if this API could have something similar applied?
However, I understand this might also be due to vagueness in the spec? Enum could be coerce to a string? I appreciate any assistance. Thanks!
Caused by: javax.el.MethodNotFoundException: Unable to find unambiguous method: class com.test.TestBean.testMethod(com.test.Level, com.test.Level, com.test.Level)
at javax.el.ELUtil.findMostSpecificWrapper(ELUtil.java:407)
at javax.el.ELUtil.findWrapper(ELUtil.java:376)
at javax.el.ELUtil.findMethod(ELUtil.java:271)
at javax.el.ELUtil.findMethod(ELUtil.java:230)
at javax.el.BeanELResolver.invoke(BeanELResolver.java:327)
at org.apache.jasper.el.JasperELResolver.invoke(JasperELResolver.java:147)
public enum Level {
LOW (1);
private final int levelCode;
private Level(int levelCode) {
this.levelCode = levelCode;
}
}
public class TestBean {
public Level getLevel() {
return Level.LOW;
}
public String testMethod(Level level1, Level... level2) {
return "(Level level1, Level... level2)";
}
public String testMethod(String param1, Level... level2) {
return "(String param1, Level... level2)";
}
}
EL Expression:
${testBean.testMethod(testBean.getLevel(), testBean.getLevel(), testBean.getLevel())}
- Dominant language
- Java
- Stars
- 15
- Forks
- 10
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from eclipse-ee4j/expressly
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
eclipse-ee4j/expressly#24 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
eclipse-ee4j/expressly#23 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
eclipse-ee4j/expressly#21 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
eclipse-ee4j/expressly#20 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
eclipse-ee4j/expressly#15 · 5 comments ·
All issues in eclipse-ee4j/expressly
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
commonmark/commonmark-java#460 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
GoogleCloudPlatform/spring-cloud-gcp#4664 ·
Maintainers usually reply within 1 day
-
enhancement user story
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100