Lucene - Core
  1. Lucene - Core
  2. LUCENE-2188

A handy utility class for tracking deprecated overridden methods

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.1
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      This issue provides a new handy utility class that keeps track of overridden deprecated methods in non-final sub classes. This class can be used in new deprecations.

      See the javadocs for an example.

      1. LUCENE-2188.patch
        17 kB
        Uwe Schindler
      2. LUCENE-2188.patch
        17 kB
        Uwe Schindler
      3. LUCENE-2188.patch
        16 kB
        Uwe Schindler
      4. LUCENE-2188.patch
        13 kB
        Uwe Schindler
      5. LUCENE-2188.patch
        12 kB
        Uwe Schindler
      6. LUCENE-2188.patch
        9 kB
        Uwe Schindler

        Issue Links

          Activity

          Hide
          Uwe Schindler added a comment -

          The again heavy class from Uwe's reflection tools...

          Show
          Uwe Schindler added a comment - The again heavy class from Uwe's reflection tools...
          Hide
          Uwe Schindler added a comment -

          By the way, this of course passes Mike's testcase, where he tests this with a dummy Analyzer that overrides the old method.

          Show
          Uwe Schindler added a comment - By the way, this of course passes Mike's testcase, where he tests this with a dummy Analyzer that overrides the old method.
          Hide
          Uwe Schindler added a comment -

          Improved patch:

          • add runtime checks to not fail on spelling errors
          • add testcase for distance measurement
          Show
          Uwe Schindler added a comment - Improved patch: add runtime checks to not fail on spelling errors add testcase for distance measurement
          Hide
          Michael McCandless added a comment -

          Haven't looked closely at the patch, but, this sounds useful Uwe!

          Show
          Michael McCandless added a comment - Haven't looked closely at the patch, but, this sounds useful Uwe!
          Hide
          Uwe Schindler added a comment -

          Also added test for protected methods and some tests that all IAEs are thrown correctly.

          Show
          Uwe Schindler added a comment - Also added test for protected methods and some tests that all IAEs are thrown correctly.
          Hide
          Uwe Schindler added a comment -

          Some API cleanup and more readability for client code (see Analyzer.java and javadocs). Also enforce singleton status (static instantiations needed!).

          Show
          Uwe Schindler added a comment - Some API cleanup and more readability for client code (see Analyzer.java and javadocs). Also enforce singleton status (static instantiations needed!).
          Hide
          Uwe Schindler added a comment -

          New patrch, the previous one had the compare method in wrong order. Fixed docs and Analyzer and tests. I always get "totally disturbed" when using compareTo() and compare()

          Show
          Uwe Schindler added a comment - New patrch, the previous one had the compare method in wrong order. Fixed docs and Analyzer and tests. I always get "totally disturbed" when using compareTo() and compare()
          Hide
          Simon Willnauer added a comment -

          Uwe,
          I'm not sure if I have a really good replacement for the your names, none of the following suggestions seem to be a 100% match though.

          for getOverrideDistance() you could call it:

          • getDefinitionDistanceFrom(Class)
          • getImplementationDistanceFrom(Class)

          The term distance is fine IMO, I would rather extend the javadoc a little and explain that this is the distance between the given class and the next class implementing the method on the path from the given class to the base class where the method was initally declared / defined

          for isOverriddenBy() you could call it:

          • isDefinedBy()
          • isImplementedBy()

          I also wanna mention an option for the class name, "VirtualMethod" pretty much matches what this class represents.

          Show
          Simon Willnauer added a comment - Uwe, I'm not sure if I have a really good replacement for the your names, none of the following suggestions seem to be a 100% match though. for getOverrideDistance() you could call it: getDefinitionDistanceFrom(Class) getImplementationDistanceFrom(Class) The term distance is fine IMO, I would rather extend the javadoc a little and explain that this is the distance between the given class and the next class implementing the method on the path from the given class to the base class where the method was initally declared / defined for isOverriddenBy() you could call it: isDefinedBy() isImplementedBy() I also wanna mention an option for the class name, "VirtualMethod" pretty much matches what this class represents.
          Hide
          Uwe Schindler added a comment -

          I renamed the class to VirtualMethod as suggested by Simon and also changed method names and their javadocs to better describe whats happening. It is still hard to use, but client code never should use this class.

          I will commit this soon to proceed with the dependent issues. Improvements to Javadocs can be done later of course.

          Show
          Uwe Schindler added a comment - I renamed the class to VirtualMethod as suggested by Simon and also changed method names and their javadocs to better describe whats happening. It is still hard to use, but client code never should use this class. I will commit this soon to proceed with the dependent issues. Improvements to Javadocs can be done later of course.
          Hide
          Uwe Schindler added a comment -

          Changed javadocs and changes.txt.

          Will commit this now.

          Show
          Uwe Schindler added a comment - Changed javadocs and changes.txt. Will commit this now.
          Hide
          Uwe Schindler added a comment -

          Committed revision: 898507

          Show
          Uwe Schindler added a comment - Committed revision: 898507
          Hide
          Simon Willnauer added a comment -

          good stuff uwe, I will fix LUCENE-2183 now.

          Show
          Simon Willnauer added a comment - good stuff uwe, I will fix LUCENE-2183 now.

            People

            • Assignee:
              Uwe Schindler
              Reporter:
              Uwe Schindler
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development