generic for sub classes also?
This commit is contained in:
parent
6754a26d08
commit
b86d07fc9a
|
@ -285,12 +285,12 @@ public class PercolateContext extends SearchContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FetchSubPhaseContext getFetchSubPhaseContext(FetchSubPhase.ContextFactory contextFactory) {
|
public <SubPhaseContext extends FetchSubPhaseContext> SubPhaseContext getFetchSubPhaseContext(FetchSubPhase.ContextFactory<SubPhaseContext> contextFactory) {
|
||||||
String subPhaseName = contextFactory.getName();
|
String subPhaseName = contextFactory.getName();
|
||||||
if (subPhaseContexts.get(subPhaseName) == null) {
|
if (subPhaseContexts.get(subPhaseName) == null) {
|
||||||
subPhaseContexts.put(subPhaseName, contextFactory.newContextInstance());
|
subPhaseContexts.put(subPhaseName, contextFactory.newContextInstance());
|
||||||
}
|
}
|
||||||
return subPhaseContexts.get(subPhaseName);
|
return (SubPhaseContext) subPhaseContexts.get(subPhaseName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unused:
|
// Unused:
|
||||||
|
|
|
@ -305,14 +305,15 @@ public class DefaultSearchContext extends SearchContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FetchSubPhaseContext getFetchSubPhaseContext(FetchSubPhase.ContextFactory contextFactory) {
|
public <SubPhaseContext extends FetchSubPhaseContext> SubPhaseContext getFetchSubPhaseContext(FetchSubPhase.ContextFactory<SubPhaseContext> contextFactory) {
|
||||||
String subPhaseName = contextFactory.getName();
|
String subPhaseName = contextFactory.getName();
|
||||||
if (subPhaseContexts.get(subPhaseName) == null) {
|
if (subPhaseContexts.get(subPhaseName) == null) {
|
||||||
subPhaseContexts.put(subPhaseName, contextFactory.newContextInstance());
|
subPhaseContexts.put(subPhaseName, contextFactory.newContextInstance());
|
||||||
}
|
}
|
||||||
return subPhaseContexts.get(subPhaseName);
|
return (SubPhaseContext) subPhaseContexts.get(subPhaseName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SearchContextHighlight highlight() {
|
public SearchContextHighlight highlight() {
|
||||||
return highlight;
|
return highlight;
|
||||||
|
|
|
@ -621,7 +621,7 @@ public abstract class FilteredSearchContext extends SearchContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FetchSubPhaseContext getFetchSubPhaseContext(FetchSubPhase.ContextFactory subPhase) {
|
public <SubPhaseContext extends FetchSubPhaseContext> SubPhaseContext getFetchSubPhaseContext(FetchSubPhase.ContextFactory<SubPhaseContext> contextFactory) {
|
||||||
return in.getFetchSubPhaseContext(subPhase);
|
return in.getFetchSubPhaseContext(contextFactory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -204,12 +204,12 @@ public class TestSearchContext extends SearchContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FetchSubPhaseContext getFetchSubPhaseContext(FetchSubPhase.ContextFactory contextFactory) {
|
public <SubPhaseContext extends FetchSubPhaseContext> SubPhaseContext getFetchSubPhaseContext(FetchSubPhase.ContextFactory<SubPhaseContext> contextFactory) {
|
||||||
String subPhaseName = contextFactory.getName();
|
String subPhaseName = contextFactory.getName();
|
||||||
if (subPhaseContexts.get(subPhaseName) == null) {
|
if (subPhaseContexts.get(subPhaseName) == null) {
|
||||||
subPhaseContexts.put(subPhaseName, contextFactory.newContextInstance());
|
subPhaseContexts.put(subPhaseName, contextFactory.newContextInstance());
|
||||||
}
|
}
|
||||||
return subPhaseContexts.get(subPhaseName);
|
return (SubPhaseContext) subPhaseContexts.get(subPhaseName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue