Summary: | EL-API does not find overriden method | ||
---|---|---|---|
Product: | Tomcat 7 | Reporter: | S. Dabek <dabek> |
Component: | Jasper | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 7.0.55 | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All |
Description
S. Dabek
2014-07-31 15:55:58 UTC
That's because the method is ambiguous. Even Java can't figure it out. Something is wrong with your sample code: it won't compile. public class AmbiguousTest { public static class TesterBeanA { public CharSequence getCharSequence(CharSequence cs) { return cs; } } public static class TesterBeanAA { @Override public String getCharSequence(CharSequence cs) { return cs.toString(); } } public static void main(String[] args) { new TesterBeanAA().getCharSequence("test"); } } The code above will not compile under Java 8: $ javac AmbiguousTest.java AmbiguousTest.java:11: error: method does not override or implement a method from a supertype @Override ^ 1 error You may have to come up with a better test case. The test-code is fine. Of course, it won't compile if you don't extend TesterBeanAA from TesterBeanA. Just add the code to the test-classes of the same name in the tomcat7 trunk. And of course an overriden method can't be ambiguous. That's the essence of polymorphism. Aw, crap. I missed that, obviously. It's always easier to run a unit test when it comes in a self-contained example. ;) Thanks for the report. This has been fixed in 8.0.x for 8.0.11 onwards and in 7.0.x for 7.0.56 onwards. |