Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-6952

All Filter* delegating classes should be abstract

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.0
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      I think it's confusing that FilterLeafReader (and it's Filter* inner classes) are not abstract. By making them abstract, we clarify to users how to use them by virtue of them being abstract. It seems only a couple tests directly instantiate them. This applies to other Filter* classes as well.

      1. LUCENE_6952.patch
        12 kB
        David Smiley
      2. LUCENE_6952.patch
        13 kB
        David Smiley

        Activity

        Hide
        dsmiley David Smiley added a comment -

        I expanded the scope to include any class starting with Filter that is a delegate that wasn't already abstract:

        Lucene-core:

        • FilterCodecReader
        • FilterLeafReader
        • FilterCollector
        • FilterDirectory

        Lucene-test-framework

        • FilterFileChannel
        • FilterFileStore
        • not FilterFileSystem
        • FilterFileSystemProvider
        • FilterOutputStream2
        • not FilterPath

        When I had tentatively made FilterFileSystem and FilterPath abstract, I noticed a bunch of direct usages that seemed to use it as a pair of a delegate with a FileSystem impl so it wasn't a pure delegate. But that's debatable; it's fine either way I guess.

        Show
        dsmiley David Smiley added a comment - I expanded the scope to include any class starting with Filter that is a delegate that wasn't already abstract: Lucene-core: FilterCodecReader FilterLeafReader FilterCollector FilterDirectory Lucene-test-framework FilterFileChannel FilterFileStore not FilterFileSystem FilterFileSystemProvider FilterOutputStream2 not FilterPath When I had tentatively made FilterFileSystem and FilterPath abstract, I noticed a bunch of direct usages that seemed to use it as a pair of a delegate with a FileSystem impl so it wasn't a pure delegate. But that's debatable; it's fine either way I guess.
        Hide
        dsmiley David Smiley added a comment -

        Updated to fix bug introduced in my patch related to the presence of trivial anonymous inner subclasses that didn't need to be there any more. They were there because the very first attempt made some classes Abstract and I had since changed my mind. A test discovered this.

        Show
        dsmiley David Smiley added a comment - Updated to fix bug introduced in my patch related to the presence of trivial anonymous inner subclasses that didn't need to be there any more. They were there because the very first attempt made some classes Abstract and I had since changed my mind. A test discovered this.
        Hide
        yseeley@gmail.com Yonik Seeley added a comment -

        +1

        Show
        yseeley@gmail.com Yonik Seeley added a comment - +1
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 57a7820d1ff67969e75a4f022239bdcede09d95b in lucene-solr's branch refs/heads/branch_6_0 from David Smiley
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=57a7820 ]

        LUCENE-6952: Make most Filter* classes abstract.
        (cherry picked from commit ae59bc0)

        Show
        jira-bot ASF subversion and git services added a comment - Commit 57a7820d1ff67969e75a4f022239bdcede09d95b in lucene-solr's branch refs/heads/branch_6_0 from David Smiley [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=57a7820 ] LUCENE-6952 : Make most Filter* classes abstract. (cherry picked from commit ae59bc0)
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit ae59bc0785b57ff5ce8cc4f88cd7728de3735e18 in lucene-solr's branch refs/heads/branch_6x from David Smiley
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=ae59bc0 ]

        LUCENE-6952: Make most Filter* classes abstract.
        (cherry picked from commit 9393a31)

        Show
        jira-bot ASF subversion and git services added a comment - Commit ae59bc0785b57ff5ce8cc4f88cd7728de3735e18 in lucene-solr's branch refs/heads/branch_6x from David Smiley [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=ae59bc0 ] LUCENE-6952 : Make most Filter* classes abstract. (cherry picked from commit 9393a31)
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 9393a3190ce6af48ae0aac40d5d4b17c3b5d5423 in lucene-solr's branch refs/heads/master from David Smiley
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=9393a31 ]

        LUCENE-6952: Make most Filter* classes abstract.

        Show
        jira-bot ASF subversion and git services added a comment - Commit 9393a3190ce6af48ae0aac40d5d4b17c3b5d5423 in lucene-solr's branch refs/heads/master from David Smiley [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=9393a31 ] LUCENE-6952 : Make most Filter* classes abstract.

          People

          • Assignee:
            dsmiley David Smiley
            Reporter:
            dsmiley David Smiley
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development