Grokbase Groups Lucene dev March 2010
FAQ
AttributeSource's methods for accessing attributes should be final, else its easy to corrupt the internal states
----------------------------------------------------------------------------------------------------------------

Key: LUCENE-2315
URL: https://issues.apache.org/jira/browse/LUCENE-2315
Project: Lucene - Java
Issue Type: Bug
Reporter: Uwe Schindler
Priority: Minor




--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org

Search Discussions

  • Uwe Schindler (JIRA) at Mar 13, 2010 at 11:44 am
    [ https://issues.apache.org/jira/browse/LUCENE-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Uwe Schindler updated LUCENE-2315:
    ----------------------------------

    Description:
    The methods that operate and modify the internal maps of AttributeSource should be final, which is a backwards break. But anybody that overrides such methods simply creates a buggy AS either case.

    I want to makeall impls final (in general the class should be final at all, but it is made for extension in TokenStream). So its important that the implementations are final!
    Affects Version/s: 2.9
    2.9.1
    2.9.2
    3.0
    3.0.1
    Fix Version/s: 3.1
    AttributeSource's methods for accessing attributes should be final, else its easy to corrupt the internal states
    ----------------------------------------------------------------------------------------------------------------

    Key: LUCENE-2315
    URL: https://issues.apache.org/jira/browse/LUCENE-2315
    Project: Lucene - Java
    Issue Type: Bug
    Affects Versions: 2.9, 2.9.1, 2.9.2, 3.0, 3.0.1
    Reporter: Uwe Schindler
    Priority: Minor
    Fix For: 3.1


    The methods that operate and modify the internal maps of AttributeSource should be final, which is a backwards break. But anybody that overrides such methods simply creates a buggy AS either case.
    I want to makeall impls final (in general the class should be final at all, but it is made for extension in TokenStream). So its important that the implementations are final!
    --
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-dev-help@lucene.apache.org
  • Shai Erera (JIRA) at Mar 13, 2010 at 12:58 pm
    [ https://issues.apache.org/jira/browse/LUCENE-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12844869#action_12844869 ]

    Shai Erera commented on LUCENE-2315:
    ------------------------------------

    bq. in general the class should be final at all

    How can AttributeSource be final? We want people to develop their own AttributeSources no? Can you please list the methods that you want to make final? I want to check that none of our AttributeSources override them.
    AttributeSource's methods for accessing attributes should be final, else its easy to corrupt the internal states
    ----------------------------------------------------------------------------------------------------------------

    Key: LUCENE-2315
    URL: https://issues.apache.org/jira/browse/LUCENE-2315
    Project: Lucene - Java
    Issue Type: Bug
    Affects Versions: 2.9, 2.9.1, 2.9.2, 3.0, 3.0.1
    Reporter: Uwe Schindler
    Priority: Minor
    Fix For: 3.1


    The methods that operate and modify the internal maps of AttributeSource should be final, which is a backwards break. But anybody that overrides such methods simply creates a buggy AS either case.
    I want to makeall impls final (in general the class should be final at all, but it is made for extension in TokenStream). So its important that the implementations are final!
    --
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-dev-help@lucene.apache.org
  • Uwe Schindler (JIRA) at Mar 13, 2010 at 1:32 pm
    [ https://issues.apache.org/jira/browse/LUCENE-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12844870#action_12844870 ]

    Uwe Schindler commented on LUCENE-2315:
    ---------------------------------------

    bq. How can AttributeSource be final?

    This was just a comment about the class, but its not possible because it is extended by TokenStreams or similar classes - but the implementation of methods should not be alterable. So *all* methods should be final, at least all methods that access/modify the private maps.

    A correct plan for "own implementations of AttributeSource" would be to create an abstract AttributeSource base class that defines the behaviour and all impls in the current AttributeSource are final. Because there may be other implementations that work without maps or have a hardcoded number of attributes with optimized implementations.
    AttributeSource's methods for accessing attributes should be final, else its easy to corrupt the internal states
    ----------------------------------------------------------------------------------------------------------------

    Key: LUCENE-2315
    URL: https://issues.apache.org/jira/browse/LUCENE-2315
    Project: Lucene - Java
    Issue Type: Bug
    Affects Versions: 2.9, 2.9.1, 2.9.2, 3.0, 3.0.1
    Reporter: Uwe Schindler
    Priority: Minor
    Fix For: 3.1


    The methods that operate and modify the internal maps of AttributeSource should be final, which is a backwards break. But anybody that overrides such methods simply creates a buggy AS either case.
    I want to makeall impls final (in general the class should be final at all, but it is made for extension in TokenStream). So its important that the implementations are final!
    --
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-dev-help@lucene.apache.org
  • Shai Erera (JIRA) at Mar 13, 2010 at 2:18 pm
    [ https://issues.apache.org/jira/browse/LUCENE-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12844884#action_12844884 ]

    Shai Erera commented on LUCENE-2315:
    ------------------------------------

    Ok I see. I think that instead of creating another class to introduce new users to, we can stick w/ AS and make all the methods that no one shouldn't have any reason to ever extend final. We can keep the methods that define the 'behavior' not final, though I don't see any at the moment. Maybe getAttributeImplsIterator.

    But if will make sense to factor out just these methods to a separate class, so that custom AS don't need to be a sub-class of AS for just that purpose, then I think it'll also be ok.
    AttributeSource's methods for accessing attributes should be final, else its easy to corrupt the internal states
    ----------------------------------------------------------------------------------------------------------------

    Key: LUCENE-2315
    URL: https://issues.apache.org/jira/browse/LUCENE-2315
    Project: Lucene - Java
    Issue Type: Bug
    Affects Versions: 2.9, 2.9.1, 2.9.2, 3.0, 3.0.1
    Reporter: Uwe Schindler
    Priority: Minor
    Fix For: 3.1


    The methods that operate and modify the internal maps of AttributeSource should be final, which is a backwards break. But anybody that overrides such methods simply creates a buggy AS either case.
    I want to makeall impls final (in general the class should be final at all, but it is made for extension in TokenStream). So its important that the implementations are final!
    --
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-dev-help@lucene.apache.org
  • Uwe Schindler (JIRA) at Mar 28, 2010 at 1:15 pm
    [ https://issues.apache.org/jira/browse/LUCENE-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Uwe Schindler reassigned LUCENE-2315:
    -------------------------------------

    Assignee: Uwe Schindler
    AttributeSource's methods for accessing attributes should be final, else its easy to corrupt the internal states
    ----------------------------------------------------------------------------------------------------------------

    Key: LUCENE-2315
    URL: https://issues.apache.org/jira/browse/LUCENE-2315
    Project: Lucene - Java
    Issue Type: Bug
    Affects Versions: 2.9, 2.9.1, 2.9.2, 3.0, 3.0.1
    Reporter: Uwe Schindler
    Assignee: Uwe Schindler
    Priority: Minor
    Fix For: 3.1


    The methods that operate and modify the internal maps of AttributeSource should be final, which is a backwards break. But anybody that overrides such methods simply creates a buggy AS either case.
    I want to makeall impls final (in general the class should be final at all, but it is made for extension in TokenStream). So its important that the implementations are final!
    --
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-dev-help@lucene.apache.org

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categorieslucene
postedMar 13, '10 at 11:40a
activeMar 28, '10 at 1:15p
posts6
users1
websitelucene.apache.org

1 user in discussion

Uwe Schindler (JIRA): 6 posts

People

Translate

site design / logo © 2021 Grokbase