From 3b90c5eee52163e0eb586d373d0f412d74921492 Mon Sep 17 00:00:00 2001 From: Noble Paul Date: Thu, 17 Sep 2009 07:41:14 +0000 Subject: [PATCH] refactoring git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@816082 13f79535-47bb-0310-9956-ffa450edef68 --- .../handler/dataimport/EntityProcessorBase.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorBase.java b/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorBase.java index a348b2c5870..2cee9d43f6e 100644 --- a/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorBase.java +++ b/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorBase.java @@ -54,15 +54,20 @@ public class EntityProcessorBase extends EntityProcessor { public void init(Context context) { rowIterator = null; this.context = context; + resolver = (VariableResolverImpl) context.getVariableResolver(); if (isFirstInit) { - entityName = context.getEntityAttribute("name"); - String s = context.getEntityAttribute(ON_ERROR); - if (s != null) onError = s; + firstInit(context); } - resolver = (VariableResolverImpl) context.getVariableResolver(); query = null; - isFirstInit = false; + } + /**first time init call. do one-time operations here + */ + protected void firstInit(Context context) { + entityName = context.getEntityAttribute("name"); + String s = context.getEntityAttribute(ON_ERROR); + if (s != null) onError = s; + isFirstInit = false; }