mirror of https://github.com/apache/lucene.git
SOLR-1421 FieldreaderDataSource uses a stale Variableresolver
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@813676 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1df597856d
commit
e723f7fbad
|
@ -271,6 +271,14 @@ public class EntityProcessorWrapper extends EntityProcessor {
|
|||
contextCopy = null;
|
||||
}
|
||||
|
||||
public VariableResolverImpl getVariableResolver() {
|
||||
return resolver;
|
||||
}
|
||||
|
||||
public Context getContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
delegate.close();
|
||||
|
|
|
@ -52,16 +52,17 @@ public class FieldReaderDataSource extends DataSource<Reader> {
|
|||
protected VariableResolver vr;
|
||||
protected String dataField;
|
||||
private String encoding;
|
||||
private EntityProcessorWrapper entityProcessor;
|
||||
|
||||
public void init(Context context, Properties initProps) {
|
||||
vr = context.getVariableResolver();
|
||||
dataField = context.getEntityAttribute("dataField");
|
||||
encoding = context.getEntityAttribute("encoding");
|
||||
entityProcessor = (EntityProcessorWrapper) context.getEntityProcessor();
|
||||
/*no op*/
|
||||
}
|
||||
|
||||
public Reader getData(String query) {
|
||||
Object o = vr.resolve(dataField);
|
||||
Object o = entityProcessor.getVariableResolver().resolve(dataField);
|
||||
if (o == null) {
|
||||
throw new DataImportHandlerException (SEVERE, "No field available for name : " +dataField);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue