https://issues.apache.org/bugzilla/show_bug.cgi?id=57132

            Bug ID: 57132
           Summary: ImportHandler.resolveClass() fails to report
                    conflicting import when called repeatedly
           Product: Tomcat 8
           Version: 8.0.14
          Hardware: PC
            Status: NEW
          Severity: minor
          Priority: P2
         Component: EL
          Assignee: dev@tomcat.apache.org
          Reporter: knst.koli...@gmail.com

I noted this issue when reviewing ImportHandler code after r1633440. I have
test case that demonstrates it, but I do not have a fix yet.

javax.el.ImportHandler.resolveClass(String name) should throw an ELException if
the same class can be ambiguously found in several packages.

To do so, it relies on calling findClass(className, true) and on "clazzes"
field that is a cache of classes keyed by their "simple class names". A simple
class name is the name without its package.

If resolveClass("foo") finds class foo in several packages then the first call
to findClass() updates the clazzes cache and the second call finds the
duplicate when trying to update the cache with a different class.

If resolveClass("foo") call is repeated, expected result is to report the error
again. The actual result is that the first thing it does is to look into the
cache. It finds the first class there and returns it without any errors.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to