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:
Noble Paul 2009-09-11 06:34:35 +00:00
parent 1df597856d
commit e723f7fbad
2 changed files with 11 additions and 2 deletions

View File

@ -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();

View File

@ -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);
}