LUCENE-2315: AttributeSource's methods for accessing attributes are now final, else its easy to corrupt the internal states

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1075065 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2011-02-27 14:41:26 +00:00
parent b76bef12fd
commit b77a33362c
2 changed files with 6 additions and 3 deletions

View File

@ -138,6 +138,9 @@ Changes in backwards compatibility policy
* LUCENE-2236: Similarity can now be configured on a per-field basis. See the
migration notes in MIGRATE.txt for more details. (Robert Muir, Doron Cohen)
* LUCENE-2315: AttributeSource's methods for accessing attributes are now final,
else its easy to corrupt the internal states. (Uwe Schindler)
Changes in Runtime Behavior
* LUCENE-2846: omitNorms now behaves like omitTermFrequencyAndPositions, if you

View File

@ -131,14 +131,14 @@ public class AttributeSource {
/**
* returns the used AttributeFactory.
*/
public AttributeFactory getAttributeFactory() {
public final AttributeFactory getAttributeFactory() {
return this.factory;
}
/** Returns a new iterator that iterates the attribute classes
* in the same order they were added in.
*/
public Iterator<Class<? extends Attribute>> getAttributeClassesIterator() {
public final Iterator<Class<? extends Attribute>> getAttributeClassesIterator() {
return Collections.unmodifiableSet(attributes.keySet()).iterator();
}
@ -146,7 +146,7 @@ public class AttributeSource {
* This iterator may contain less entries that {@link #getAttributeClassesIterator},
* if one instance implements more than one Attribute interface.
*/
public Iterator<AttributeImpl> getAttributeImplsIterator() {
public final Iterator<AttributeImpl> getAttributeImplsIterator() {
if (hasAttributes()) {
if (currentState == null) {
computeCurrentState();