Summary: | NPE is thrown for env-entry without env-entry-type but with injection-target specified | ||
---|---|---|---|
Product: | Tomcat 7 | Reporter: | Violeta Georgieva <violetagg> |
Component: | Catalina | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 7.0.27 | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All | ||
Attachments: |
Test web application
Patch proposal |
Description
Violeta Georgieva
2012-05-30 19:28:00 UTC
Created attachment 28864 [details]
Patch proposal
Thanks for pointing this out. It is definitely a bug. As I started to look at this I found some clean-up that could be done. It changes the failure point although I think the patch is currently trying to identify the type at the correct point. However, I'm not sure that NamingResources is the best home for the actual functionality. I think some refactoring may be in order. I'm looking at the now. I also think that the specification wording is ambiguous. There is <quote> type may be ommitted or MUST match the type of the injection target </quote> and <quote> type MUST be assignment compatible with the type of the injection target </quote> Clearly the wording is different but I am not convinced that the meaning is. It depends what is meant by "match". I am leaning towards implementing the more flexible "assignment compatible" in all cases. Thanks for the suggested patch. I used it as a basis for the committed solution although I tweaked the code a little and made it more relaxed regarding inputs. Generally, as long as the types are compatible - it will work. The change has been applied to trunk and 7.0.x and will be included in 7.0.28 onwards. Thanks |