DO NOT REPLY [Bug 17728] - EvalHelper should not throw NullAttributeException, it's too slow
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17728. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17728 EvalHelper should not throw NullAttributeException, it's too slow [EMAIL PROTECTED] changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution||FIXED --- Additional Comments From [EMAIL PROTECTED] 2003-03-09 05:55 --- Fixed performance problem by removing usage of NullAttributeException for normal processing flow. It now will just not call the setter method if the original expression or resulting value is null. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DO NOT REPLY [Bug 17728] - EvalHelper should not throw NullAttributeException, it's too slow
bugzilla == bugzilla [EMAIL PROTECTED] writes: bugzilla DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG bugzilla RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT bugzilla http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17728. bugzilla ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND bugzilla INSERTED IN THE BUG DATABASE. bugzilla http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17728 bugzilla EvalHelper should not throw NullAttributeException, it's too slow bugzilla [EMAIL PROTECTED] changed: bugzillaWhat|Removed |Added bugzilla bugzilla Status|REOPENED|RESOLVED bugzilla Resolution||FIXED bugzilla --- Additional Comments From [EMAIL PROTECTED] 2003-03-09 05:55 --- bugzilla Fixed performance problem by removing usage of NullAttributeException for normal bugzilla processing flow. It now will just not call the setter method if the original bugzilla expression or resulting value is null. Note that I successfully committed this change, along with changes to the structure of the BeanInfo classes, but both commit emails bounced, for being too large. -- === David M. Karr ; Java/J2EE/XML/Unix/C++ [EMAIL PROTECTED] ; SCJP; SCWCD - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 17728] - EvalHelper should not throw NullAttributeException, it's too slow
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17728. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17728 EvalHelper should not throw NullAttributeException, it's too slow [EMAIL PROTECTED] changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|LATER | --- Additional Comments From [EMAIL PROTECTED] 2003-03-08 06:29 --- Despite what I said about waiting for after 1.1 to fix this, I've decided to fix this now for a couple reasons: 1. I knew it would be slower, but if people doing performance measurements are really seeing a big slowdown, then I think I'd like to get this fixed for 1.1. 2. When 1.1 is released, I'm planning on writing an article on Struts-EL, including code from the tags. It was bad enough knowing that I had mistakenly wrote this exception-based logic flow, it'll be incredibly worse if thousands of other people see it :) . I've finished the changes, and I've tested them in my exercise taglib and my tld/bean validator. I'm planning on committing these changes tomorrow evening after I do some final cleanup. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 17728] - EvalHelper should not throw NullAttributeException, it's too slow
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17728. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17728 EvalHelper should not throw NullAttributeException, it's too slow [EMAIL PROTECTED] changed: What|Removed |Added Status|NEW |RESOLVED Resolution||INVALID --- Additional Comments From [EMAIL PROTECTED] 2003-03-06 15:31 --- You are misundersanding what evalNotNull() does. A NullAttributeException is thrown only if a value *is* specified for the attribute, and that value is an expression that evaluates to null. If no value is specified for the attribute, evalNotNull() does *not* throw an exception, it simply returns null. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 17728] - EvalHelper should not throw NullAttributeException, it's too slow
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17728. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17728 EvalHelper should not throw NullAttributeException, it's too slow [EMAIL PROTECTED] changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|INVALID | --- Additional Comments From [EMAIL PROTECTED] 2003-03-06 15:37 --- You're wrong, Look at the code, I even ran it through a profiler and this identifies the bottleneck. public final class EvalHelper { private EvalHelper() {} public static Object eval(String tagName, String attrName, String attrValue, Class attrType, Tag tagObject, PageContext pageContext) throws JspException, NullAttributeException { Object result = ExpressionUtil.evalNotNull(tagName, attrName, attrValue, attrType, tagObject, pageContext); if (result == null) throw new NullAttributeException(attrName, tagName); return (result); } } When ExpressionUtil returns null, a NullAttributeException is thrown. The EL Tags call this for every attribute, catch the NullAttributeException and enter a default. For example, here is a snippet from the ELSizeTag.java try { setName((String) evalAttr(name, getName(), String.class)); } catch (NullAttributeException ex) { setName(null); } Name is an optional attribute since you can specify collection. If you use the collection object on this tag it will always throw at least 2 NullAttributeException exceptions since name and property aren't filled in. The overhead of the exception in both creating an I18N string and and also additional garbage collection is uneeded. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 17728] - EvalHelper should not throw NullAttributeException, it's too slow
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17728. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17728 EvalHelper should not throw NullAttributeException, it's too slow --- Additional Comments From [EMAIL PROTECTED] 2003-03-06 15:46 --- I don't know enough about the EL tags to make a judgement but I can say that exceptions shouldn't be used as a common execution path. There is 0 overhead for executing in a try/catch block until you throw an exception. If it's reasonable for the eval() method to return null then we should do that instead of throwing an exception. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 17728] - EvalHelper should not throw NullAttributeException, it's too slow
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17728. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17728 EvalHelper should not throw NullAttributeException, it's too slow --- Additional Comments From [EMAIL PROTECTED] 2003-03-06 15:51 --- Ah, sorry. You're right, Nick. The last time I looked at the code, it was calling evalNotNull() directly, rather than EvalHelper.eval(). The former does not throw an exception if no value is specified. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 17728] - EvalHelper should not throw NullAttributeException, it's too slow
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17728. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17728 EvalHelper should not throw NullAttributeException, it's too slow --- Additional Comments From [EMAIL PROTECTED] 2003-03-06 15:54 --- No problem Mark, I was just about to add that I looked at more of the tags and some do call ExpressionUtil directly while others call EvalHelper. That may be why some of the tags work a little faster... I guess the main reason I noticed this is the Link tag is really slow and it calls the EvalHelper... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 17728] - EvalHelper should not throw NullAttributeException, it's too slow
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17728. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17728 EvalHelper should not throw NullAttributeException, it's too slow --- Additional Comments From [EMAIL PROTECTED] 2003-03-06 16:31 --- I'm well aware of this. It's already on my list of changes after the 1.1 release. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 17728] - EvalHelper should not throw NullAttributeException, it's too slow
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17728. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17728 EvalHelper should not throw NullAttributeException, it's too slow --- Additional Comments From [EMAIL PROTECTED] 2003-03-06 16:37 --- Created an attachment (id=5183) updated EvalHelper with methods to return defaults, null exception removed. Would need to update all EL tags to use this. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 17728] - EvalHelper should not throw NullAttributeException, it's too slow
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17728. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17728 EvalHelper should not throw NullAttributeException, it's too slow [EMAIL PROTECTED] changed: What|Removed |Added Severity|Major |Normal Status|REOPENED|RESOLVED Resolution||LATER Target Milestone|--- |1.2 Family - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 17728] - EvalHelper should not throw NullAttributeException, it's too slow
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17728. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17728 EvalHelper should not throw NullAttributeException, it's too slow --- Additional Comments From [EMAIL PROTECTED] 2003-03-06 21:53 --- Created an attachment (id=5187) Altered EvalHelper to return null or default values when desired, updated all tags - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]