On May 10, 2008, at 3:56 AM, Sergiu Dumitriu wrote:
Hi devs,
This week I introduced the support for chainable uberspectors, and beside the SecureUberspector that was used before, now there's also a DeprecatedCheckUberspector, that prints a warning in the logs whenever a deprecated method is called from velocity.
This is very cool. BTW one new uberspector that I'd like to add in the future is an ExceptionCatchingUberspector which allows catching exception from methods called and making them available in a velocity context variable. By default the uberspector would let the exception go through but a flag could be set to enable it. The general idea is to have a single API, the java one and not a special API for Velocity calls.
Several things I'd like to emphasize: - These logs break the validity check done in the XmlRpc tests, so this allows us to detect (almost) any usage of the deprecated methods in wiki documents and update these documents
that's cool
- It also means that we can't make a product release while there are deprecated calls in the wiki pages
even better ;)
- "deprecated" means "having the @Deprecated annotation". There's no (simple) way of checking for the @deprecated doclet. - whenever something gets deprecated, be sure to add this annotation, as otherwise the calls to the deprecated method won't be detected - could someone help with cleaning the wiki source in order to fix the builds on the 1.5-depending products? Just look at the continuum build results (for example http://continuum.xwiki.org/continuum/buildResult.action?buildId=20015&projec...) and look for messages like: [WARNING] Deprecated usage of method [com.xpn.xwiki.api.XWiki.parseInt] in Main.Dashboard@14,25 and update the affected document (could be a GSoC student...)
I'll help.
- the logged document name is not always right, as it doesn't reflect inclusions and calls to $xwiki.parseText
I guess this is because of the trick we have of using the same template name when we do includes... :( Thanks -Vincent