Cleanup EngineDependentOperation, String caching is not needed

This commit is contained in:
Antonin Delpeuch 2018-09-05 14:56:56 +01:00
parent fbc9b27640
commit 2236420f3b
2 changed files with 0 additions and 15 deletions

View File

@ -12,7 +12,6 @@ import org.json.JSONWriter;
import com.google.refine.Jsonizable; import com.google.refine.Jsonizable;
import com.google.refine.browsing.Engine.Mode; import com.google.refine.browsing.Engine.Mode;
import com.google.refine.browsing.facets.Facet;
import com.google.refine.browsing.facets.FacetConfig; import com.google.refine.browsing.facets.FacetConfig;
import com.google.refine.browsing.facets.ListFacet.ListFacetConfig; import com.google.refine.browsing.facets.ListFacet.ListFacetConfig;
import com.google.refine.browsing.facets.RangeFacet.RangeFacetConfig; import com.google.refine.browsing.facets.RangeFacet.RangeFacetConfig;

View File

@ -33,23 +33,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package com.google.refine.operations; package com.google.refine.operations;
import org.json.JSONException;
import com.google.refine.browsing.Engine; import com.google.refine.browsing.Engine;
import com.google.refine.browsing.EngineConfig; import com.google.refine.browsing.EngineConfig;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
import com.google.refine.model.Project; import com.google.refine.model.Project;
import com.google.refine.util.ParsingUtilities;
abstract public class EngineDependentOperation extends AbstractOperation { abstract public class EngineDependentOperation extends AbstractOperation {
final private String _engineConfigString;
transient protected EngineConfig _engineConfig; transient protected EngineConfig _engineConfig;
protected EngineDependentOperation(EngineConfig engineConfig) { protected EngineDependentOperation(EngineConfig engineConfig) {
_engineConfig = engineConfig; _engineConfig = engineConfig;
_engineConfigString = engineConfig == null
? null : engineConfig.toString();
} }
protected Engine createEngine(Project project) throws Exception { protected Engine createEngine(Project project) throws Exception {
@ -59,14 +53,6 @@ abstract public class EngineDependentOperation extends AbstractOperation {
} }
protected EngineConfig getEngineConfig() { protected EngineConfig getEngineConfig() {
if (_engineConfig == null && _engineConfigString != null) {
try {
_engineConfig = EngineConfig.reconstruct(
ParsingUtilities.evaluateJsonStringToObject(_engineConfigString));
} catch (JSONException e) {
// ignore
}
}
return _engineConfig; return _engineConfig;
} }
} }