Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-2169

Automatic logging of deprecated method calls in Velocity

    XMLWordPrintable

Details

    • New Feature
    • Resolution: Fixed
    • Minor
    • 1.5 M1
    • 1.3 RC1
    • {Unused} Core
    • None
    • Unit

    Description

      We should automatically log calls to deprecated methods from velocity. This will allow early fix of the code, as it is otherwise hard to maintain velocity code up to date until things stop working.

      This can be done in three ways:

      • put LOG.warn messages in the deprecated methods
      • use a custom Velocity Introspector that checks for @Deprecated annotations on each method called
      • use an aspect that inserts these calls for each deprecated method

      The first solution is the worst, as it pollutes the code too much, and makes it hard to maintain and keep track of deprecated methods. So the choice is between an introspector and an aspect. The introspector seems better, as it allows checking all the method calls, even from other packages than our own. And given that we'll split the platform in even more components, it will be awkward to run and maintain the aspect in each module.

      Attachments

        Issue Links

          Activity

            People

              sdumitriu Sergiu Dumitriu
              sdumitriu Sergiu Dumitriu
              Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: