this 'Priv' wrapper trick isn't portable (seems to work on sun-only

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1033074 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2010-11-09 16:34:34 +00:00
parent 48cfdf0738
commit e3232c3289
1 changed files with 38 additions and 43 deletions

View File

@ -55,7 +55,7 @@ public final class FuzzyTermsEnum extends TermsEnum {
attributes().addAttribute(MultiTermQuery.BoostAttribute.class); attributes().addAttribute(MultiTermQuery.BoostAttribute.class);
private final MultiTermQuery.MaxNonCompetitiveBoostAttribute maxBoostAtt; private final MultiTermQuery.MaxNonCompetitiveBoostAttribute maxBoostAtt;
private final Priv.LevenshteinAutomataAttribute dfaAtt; private final LevenshteinAutomataAttribute dfaAtt;
private float bottom; private float bottom;
private BytesRef bottomTerm; private BytesRef bottomTerm;
@ -110,7 +110,7 @@ public final class FuzzyTermsEnum extends TermsEnum {
for (int cp, i = 0, j = 0; i < utf16.length(); i += Character.charCount(cp)) for (int cp, i = 0, j = 0; i < utf16.length(); i += Character.charCount(cp))
termText[j++] = cp = utf16.codePointAt(i); termText[j++] = cp = utf16.codePointAt(i);
this.termLength = termText.length; this.termLength = termText.length;
this.dfaAtt = atts.addAttribute(Priv.LevenshteinAutomataAttribute.class); this.dfaAtt = atts.addAttribute(LevenshteinAutomataAttribute.class);
//The prefix could be longer than the word. //The prefix could be longer than the word.
//It's kind of silly though. It means we must match the entire word. //It's kind of silly though. It means we must match the entire word.
@ -552,9 +552,6 @@ public final class FuzzyTermsEnum extends TermsEnum {
return scale_factor; return scale_factor;
} }
// Wrapper class to hide the attribute from outside!
private static final class Priv {
/** @lucene.internal */ /** @lucene.internal */
public static interface LevenshteinAutomataAttribute extends Attribute { public static interface LevenshteinAutomataAttribute extends Attribute {
public List<ByteRunAutomaton> automata(); public List<ByteRunAutomaton> automata();
@ -595,6 +592,4 @@ public final class FuzzyTermsEnum extends TermsEnum {
targetAutomata.addAll(automata); targetAutomata.addAll(automata);
} }
} }
}
} }