Skip to content

Apache Lucene open-source search software

don't return pkg-private test class in public method, don't narrow public method to return pkg-private type in preflex

Robert Muir2553592c1593
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xCodec.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xCodec.java
index 888c1b8b666..96e64aa5e1a 100644
--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xCodec.java
+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xCodec.java
@@ -24,6 +24,7 @@ import org.apache.lucene.codecs.Codec;
import org.apache.lucene.codecs.DocValuesFormat;
import org.apache.lucene.codecs.FieldInfosFormat;
import org.apache.lucene.codecs.LiveDocsFormat;
+import org.apache.lucene.codecs.NormsFormat;
import org.apache.lucene.codecs.PerDocConsumer;
import org.apache.lucene.codecs.PerDocProducer;
import org.apache.lucene.codecs.PostingsFormat;
@@ -119,7 +120,7 @@ public class Lucene3xCodec extends Codec {
}
@Override
- public Lucene3xNormsFormat normsFormat() {
+ public NormsFormat normsFormat() {
return normsFormat;
}
@@ -146,7 +147,7 @@ public class Lucene3xCodec extends Codec {
}
// never inside CFS
liveDocsFormat().files(info, files);
- normsFormat().separateFiles(info, files);
+ ((Lucene3xNormsFormat)normsFormat()).separateFiles(info, files);
// shared docstores: these guys check the hair
if (info.getDocStoreOffset() != -1) {
diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/lucene3x/PreFlexRWCodec.java b/lucene/test-framework/src/java/org/apache/lucene/codecs/lucene3x/PreFlexRWCodec.java
index e76756ae46d..26052484049 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/codecs/lucene3x/PreFlexRWCodec.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/codecs/lucene3x/PreFlexRWCodec.java
@@ -22,6 +22,7 @@ import java.util.Set;
import org.apache.lucene.codecs.FieldInfosFormat;
import org.apache.lucene.codecs.LiveDocsFormat;
+import org.apache.lucene.codecs.NormsFormat;
import org.apache.lucene.codecs.PostingsFormat;
import org.apache.lucene.codecs.SegmentInfosFormat;
import org.apache.lucene.codecs.StoredFieldsFormat;
@@ -56,7 +57,7 @@ public class PreFlexRWCodec extends Lucene3xCodec {
}
@Override
- public Lucene3xNormsFormat normsFormat() {
+ public NormsFormat normsFormat() {
if (LuceneTestCase.PREFLEX_IMPERSONATION_IS_ACTIVE) {
return norms;
} else {
diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/automaton/DaciukMihovAutomatonBuilder.java b/lucene/test-framework/src/java/org/apache/lucene/util/automaton/DaciukMihovAutomatonBuilder.java
index c0f52e572da..784350bccc8 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/util/automaton/DaciukMihovAutomatonBuilder.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/util/automaton/DaciukMihovAutomatonBuilder.java
@@ -32,7 +32,7 @@ public final class DaciukMihovAutomatonBuilder {
/**
* DFSA state with <code>char</code> labels on transitions.
*/
- final static class State {
+ public final static class State {
/** An empty set of labels. */
private final static int[] NO_LABELS = new int[0];