Lucene - Core
  1. Lucene - Core
  2. LUCENE-2288

Create EMPTY_ARGS constsant in SnowballProgram instead of allocating new Object[0]

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0-ALPHA
    • Component/s: modules/analysis
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      Instead of allocating new Object[0] create a proper constant in SnowballProgram. The same (for new Class[0]) is created in Among, although it's less critical because Among is called from static initializers ... Patch will follow shortly.

        Activity

        Shai Erera created issue -
        Hide
        Shai Erera added a comment -

        Patch w/ the trivial change.

        Show
        Shai Erera added a comment - Patch w/ the trivial change.
        Shai Erera made changes -
        Field Original Value New Value
        Attachment LUCENE--2288.patch [ 12437358 ]
        Hide
        Shai Erera added a comment -

        Forgot to mention all analysis tests pass.

        Show
        Shai Erera added a comment - Forgot to mention all analysis tests pass.
        Hide
        Robert Muir added a comment -

        thanks Shai, the patch looks good to me, though i hope it only affects the Lovins stemmer (or in case someone has written their own Snowball stemmer), as the others should not be using this reflection!

        will commit in a few days unless someone objects.

        Show
        Robert Muir added a comment - thanks Shai, the patch looks good to me, though i hope it only affects the Lovins stemmer (or in case someone has written their own Snowball stemmer), as the others should not be using this reflection! will commit in a few days unless someone objects.
        Robert Muir made changes -
        Assignee Robert Muir [ rcmuir ]
        Hide
        Shai Erera added a comment -

        Thanks Robert. I never checked if those methods are actually code, as I didn't do it to earn any CPU cycles back. I just followed good coding practice, and since it appeared in two places, thought that a constant will look like a bit less waste. If you're sure those are not called by the other stemmers (and I'm sure you are ), then I'm fine if you leave those out as well

        Show
        Shai Erera added a comment - Thanks Robert. I never checked if those methods are actually code, as I didn't do it to earn any CPU cycles back. I just followed good coding practice, and since it appeared in two places, thought that a constant will look like a bit less waste. If you're sure those are not called by the other stemmers (and I'm sure you are ), then I'm fine if you leave those out as well
        Hide
        Robert Muir added a comment -

        Committed revision 917161.

        Thanks Shai!

        Show
        Robert Muir added a comment - Committed revision 917161. Thanks Shai!
        Robert Muir made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Mark Thomas made changes -
        Workflow jira [ 12500357 ] Default workflow, editable Closed status [ 12564212 ]
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12564212 ] jira [ 12585634 ]
        Uwe Schindler made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        13h 14m 1 Robert Muir 28/Feb/10 10:41
        Resolved Resolved Closed Closed
        1167d 2m 1 Uwe Schindler 10/May/13 11:44

          People

          • Assignee:
            Robert Muir
            Reporter:
            Shai Erera
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development