[ http://issues.apache.org/jira/browse/XALANJ-2236?page=comments#action_12443142 ] Kevin Cormier commented on XALANJ-2236: ---------------------------------------
I have reviewed the patch and I think it should be applied, but with one small change. The patch adds an import to src/org/apache/xpath/axes/DescendantIterator.java that is not needed: import org.w3c.dom.DOMException; Static calls via instance references are confusing - they suggest polymorphism, but such calls are always resolved statically. As Dave Brosius points out, this is especially misleading in the case of static methods of the Thread class. They always operate on the current thread - not on the thread via which the *static* call is made. So I think this is a good change to make to the code. Note that the changes to src/org/apache/xpath/axes/WalkerFactory.java in the patch go slightly beyond the description for this issue. Two variables that are not used are removed, but it is safe to do so in both cases. The first is defined in terms of other variables and constants, and the second via a very simple static method that does not have any side-effects. Incidentally, there are a few other local variables that are never referenced and could be safely removed from this class. > [PATCH] clean up static calls thru instance references > ------------------------------------------------------ > > Key: XALANJ-2236 > URL: http://issues.apache.org/jira/browse/XALANJ-2236 > Project: XalanJ2 > Issue Type: Improvement > Affects Versions: Latest Development Code > Reporter: Dave Brosius > Priority: Trivial > Attachments: static_ins_invocations.diff > > > for code documentation purposes, it is better to call static methods thru the > class rather than an instance of the class, especially in the > myThread.yield() call, when in fact, you are calling it on the current > thread, not necessarily myThread. > patch, cleans this up. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
