|Summary:||Bad exception thrown by ProxyDirContext.lookup|
|Product:||Tomcat 7||Reporter:||Marc Guillemot <mguillemot>|
|Component:||Catalina||Assignee:||Tomcat Developers Mailing List <dev>|
|Attachments:||Unit tests illustrating the problems|
Description Marc Guillemot 2010-07-16 05:38:47 UTC
Comment 1 Mark Thomas 2010-07-21 14:05:57 UTC
The gain by using notFoundException is in GC. It prevents exception objects being created for resources that don't exist. I agree it could be static (final too).
Comment 2 Mark Thomas 2010-07-21 16:33:07 UTC
Thanks for the test case. I kept the "not Found" test (with a minor modification" but not the strack trace test. The returned exceptions have been made consistent for 7.0.x and will be included in 7.0.1 onwards.
Comment 3 Marc Guillemot 2010-07-22 02:50:00 UTC
Can you explain why GC gain are considered at this special place in detriment of a correct exception? For me if GC gain is an argument, then there are so many other places in Tomcat where it should apply. This starts with the BaseDirContext.lookup that you've fixed to address the "not Found" point of this case.
Comment 4 Mark Thomas 2010-07-22 09:42:03 UTC
No, I didn't write the original code but I trust that Remy had a good reason for this particular optimisation.